You need to contact the open platform staff to add the merchant server's IP whitelist for prod env.
Glossary
api-key: Unique identifier of the merchant.
public-key: User's RSA public key.
private-key: User's RSA private key.
wsb-public-key: Platform RSA public key.
The above parameters can be obtained and updated in the dashboard.
Authentication
Use api-key to authenticate the request. User need to put X-WSB-API-KEY in the request header every time they make a request.
Signature
To ensure the security of API calls, each request and response needs to be verified for message integrity through signature.
User requests API are signed with user's RSA private key and verified with merchant RSA public key;
User requests responses are signed with platform RSA private key and verified with platform RSA public key;
Notification subscriptions are signed with platform RSA private key and verified with platform RSA public key.
The signing rules are as follows:
The merchant sends a request to the development platform, signs it with the user's RSA private key, and the open platform verifies the signature with the user's RSA public key;
The open platform interface responds and sends notifications to the merchant, signs it with the platform's RSA private key, and the merchant verifies the signature with the platform's RSA public key;
Signing is to encrypt the HTTP request body, and all requests are called using the POST method;
Use sha256 RSA to sign it and then use base64 as the signature string;
Put the encrypted signature string signature in the HTTP header X-WSB-SIGNATURE field.
If the interface does not require request parameters, please construct an empty JSON object for body for transmission and signing.
Code
Java Demo
Contains code information such as mobile area code, region, etc.; and java-demo