Pre-Sign String
1. Prepare Pre-Sign String
By default, the pre-sign string is a combined string of below information:
- HTTP method
- HTTP URI
- Client ID
- Request time
- HTTP body
Pre-sign string syntax
copy
<HTTP METHOD> <HTTP URI WITH QUERY STRING>
<Client-Id>.<Request-Time>.<HTTP BODY>
Sample pre-sign string
copy
POST /api/open/alipay/intl/promotion/order/contractCardSync
ABCD1234567890.2024-07-15T10:00:00+08:00.{"body":"payload body"}
Private key sample (Java)
copy
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCozuwZZ1H0yKleXkTceCVmDIo4+kl9b9vvOAXvJcrzJM7p1KCRvBX9HffXhvO8Bhn8/YuhNlP4OEQPgGQoy7byBoJ/CUgLg0oKMvBotq2wcf0lIYzpJy0MoCurl370L/LLJZtP953C4WrQZkcL/MIKVqNNZNVgwT6NrINWcWqHO+UbHFmRojiyXUAR9YrRULONeHu+CkwOiiQh+tcibe1ieUsiN02vC6hp/PMf9Ebd0N/uxibk8HeHIIEm9RLx7VxF2tPEDC4Yog/gYOKuzq2UYMwrlui555uyDvoYq+dNAi+zaTObeR25wlDVIU1fTNTR9IoRkgtYeVcKaHt0Eq4HAgMBAAECggEALAe84WtnnxdvxeOExpS3/IQs0WvHG2a/0Qel1Jjg9MaXCbqiHyEWAy175cWXcWWOBcUEVIpdIJNcfUaZ2WI5V6uHAiejmQ0nlL1wo39ykmFJDBRSMsY7I93rRhh/zqVrCL3IYvVNOvWc7LqgsWm+GwA6HAe++DuvWziyESwIAzmZuIAHTMnppxV5hsjqlv+BuH6Fbw93qc0JmjQgHh5KwkhneJQQ+dpprZEQFdTg9XUP+Vt6NZ1c2uajPMSmwRoYJcuXMMzUpevV5HZA5wyrhsyJtJSYDt7WepudWX+C3YQLsjvYek906oHGym5tPbpoPVb9fXxqrKxdcBB+vR62oQKBgQDQbyty5JKpvUjASNULVHY5aY6xarR5Ubp0mmDUDK0y9Sc6LHfOFSz/U983Nk4dnbWuEQiRswxMjCJHesPXXs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JnaiHVHrH57QTvYPvzTwgd7Y%2F0mAIWixOp%2BDX0IW%2F9PhsaH6sRYe7IJidHiR1x1FO0Jdniu2X5Q%3D%3D
Sample HTTP headers
copy
"Content-Type": "application/json;charset=UTF-8",
"Request-Time": "2024-07-15T10:00:00+08:00",
"Client-Id": "ABCD1234567890",
"Signature": "algorithm=RSA256,keyVersion=1,signature=eunGn9jF3luM63zk5VbBvPHd1TOGcetaHkHK3EQL%2B54JnJ6eaKuZ8uIWr4idx4Coe2T8HOb%2BtQ20ia1vvdEm4u9gP5luiMIGs0D%2FZvAFVWYaR85teBL2tAzMfl1HudPtIkMV0Joq2FUqEg8%2FlxE1HNSs4sPgD4amNtGWRakc0%2B4DYsSmkfMgP2IB%2BmKhMj47urTfo2mMsQ%2BoHy0EWegBwnNJzzSmQFWX%2FHo%2Bzhtz1hyyrp68WFyoncx5k8L7Uv0vl0h2RU2fTKKJnaiHVHrH57QTvYPvzTwgd7Y%2F0mAIWixOp%2BDX0IW%2F9PhsaH6sRYe7IJidHiR1x1FO0Jdniu2X5Q%3D%3D"
2. Obtain Signature
By default, the signature is within the response headers as in the request, please use the exchanged public key from AlipayHK for verification.