Subscription
Client Subscription
To subscribe or unsubscribe a client you need to send a HTTP POST
to the endpoints below:
Endpoints
Production: https://api.suntech-solutions.net/subscription/serve
Required headers
Header Name | Value |
---|---|
Content-Type: |
application/json |
Parameters
Name | Parameter Type | Description | Required | Default Value |
---|---|---|---|---|
countrycode |
String |
Destination country for the sms recipient. | Optional |
|
operation |
String |
The current operation code(case sensitive). | Required |
subscribe/unsubscribe |
apikey |
String |
Suntech Api Key on Api Settings. | Required |
|
auth |
String |
Suntech authentication.
This is generated as per request. You sha256 encrypt the combination of Clientkey which shall be a preshared key issued and the recipient msisdn param below
Auth = sha256(ClientKey + Msisdn) |
Required |
|
reference |
String |
Unique transaction reference for the transaction, you can use guid. | Required |
|
operator |
String |
The mobile network to bill from. | Optional |
|
serviceid |
String |
Shortcode to subsriber. | Optional |
|
msisdn |
String |
The subscriber to bill. | Required |
|
offercode |
String |
The offer to subscribe. | Required |
Sample Subscription request
{
"countrycode": "ke",
"apikey": "sergdf8ifd",
"auth": "ltn3g2q6f37yhlglfhmn",
"operation": "subscribe",
"operator": "safaricom",
"serviceid": "22167",
"offercode": "324334344343",
"msisdn": "254710000000",
"reference": "SBQAVTBJK"
}
Response
Response comes as a JSON string with the following fields:
Parameter | Parameter Type | Description | Values |
---|---|---|---|
status | string |
The status code of the transaction | 200 |
message | string |
The description of the status code of the transaction | Successful |
Sample Reponse
Below is a sample send sms response for a successful request:
{
"status":"200",
"message":"Successful"
}
Sample UnSubscription request
{
"countrycode": "ke",
"apikey": "sergdf8ifd",
"auth": "ltn3g2q6f37yhlglfhmn",
"operation": "unsubscribe",
"operator": "safaricom",
"serviceid": "22167",
"offercode": "324334344343",
"msisdn": "254710000000",
"reference": "SBQAVTBJK"
}
Response
Response comes as a JSON string with the following fields:
Parameter | Parameter Type | Description | Values |
---|---|---|---|
status | string |
The status code of the transaction | 200 |
message | string |
The description of the status code of the transaction | Successful |
Sample Reponse
Below is a sample send sms response for a successful request:
{
"status":"200",
"message":"Successful"
}