Custom message API
Custom API
Message open interface, white label docking instructions
Applicable scene
For the sending channels (email, SMS) that MultiMarket does not support, the white label can connect to the sending channel by itself and provide an external interface to connect with MultiMarket. The MultiMarket platform will call this interface according to the specifications of this document;
MultiMarket provides a set of interface docking APIs. White labels need to provide interfaces according to this specification. The API specifications are detailed below.
Then, on the white label management backend page (SMS account, email account page), select "Custom" when adding a new account, and configure the interface URL and public key (for authentication).
Public and private key rules
Asymmetric encryption algorithm: RSA algorithm, key length: 1024.
Example:
API Specifications
Our calling method is http post
The parameters use the json format.
Parameters need to be authenticated
The following details the parameters of SMS and email, as well as the authentication method.
Email Parameters
Parameter Description
SMS parameters
Parameter Description
Authentication
Decrypt the request parameter sign and record the result as signContent: 1) Get the value of the sign field from the request parameter, record it as data; 2) Use your own private key, record it as privateKey; 3) Decode data and privateKey by base64: Base64.decodeBase64(data), Base64.decodeBase64(privateKey); 4) Use the two data decoded by base64 in the previous step to perform RSA decryption to obtain a byte array, convert it to String, record it as signContent;
According to the request parameters, get the encrypted original text, recorded as signContentSource 1) Encrypted original text of email: signContentSource=toUser@timestamp@trace; 1) Encrypted original text of SMS: signContentSource=toUser@timestamp@trace;
Compare the encrypted original text (signContentSource) and the decrypted result (signContent): if they are equal, authentication is successful.
Successful response data
Last updated