Spark Sender SMS API Documentation

SEND INDIVIDUAL SMS

You can use this endpoint directly to send SMS to a contact number.

ENDPOINT https://cp.sparksender.com/api/send/
TYPE GET OR POST
RETURN TYPE JSON

SEND INDIVIDUAL SMS PARAMETERS

Key Value Required
user_id User ID from your profile page. YES
api_key API key from your profile page. YES
sender_id Your approved Sender ID. Use “SparkDEMO” for testing. This one is case sensitive. YES
message Your message. Max: 480 chars. YES
recipient_contact_no The Number of the Recipient. YES

API RESPONSE SAMPLE

{
"status_code": 204,
"msg_id": "14364"
}

API RESPONSE PARAMETERS

Key Description
status_code Your Status Code
msg_id Message Id

API STATUS CODE LIST

HTTP Response Response
201 Client API Status is Inactive
202 Invalid API Key
203 Contact Number is Invalid or Operator not Support
204 Successfuly Sent the Message
205 Length of Contact is Invalid
206 Country is not Availble for Sending SMS
207 No Contact Numbers
208 Account Balance is Insufficient
209 Sending the Messsage is Unsuccessfull
210 Client is Suspended
211 No Mask ID / Mask Id is not Approved
212 Rate Card is not Set for the Country
213 Route is not Set for the Country

SAMPLE CODE FOR SENDING INDIVIDUAL SMS

SEND BULK SMS

You can use this endpoint directly to send SMS to bulk contact numbers.

ENDPOINT https://cp.sparksender.com/api/bulkSMS/
TYPE GET OR POST
RETURN TYPE JSON

SEND BULK SMS PARAMETERS

Key Value Required
user_id User ID from your profile page. YES
api_key API key from your profile page. YES
sender_id Your approved Sender ID. Use “SparkDEMO” for testing. This one is case sensitive. YES
message Your message. Max: 480 chars. YES
recipient_contacts The Numbers of the Recipients. (E.g. 94711111111, 94773333333, 94752222222, 94214545455, 58478) YES

API RESPONSE SAMPLE

{
   "success": [
         [
                 {
                       "number": "94711111111",
                       "msgId": "1000"
                 },
                 {
                       "number": "94773333333",
                       "msgId": "1001"
                 },
                 {
                       "number": "94752222222",
                       "msgId": "1002"
                 }
         ]
   ],
   "unsuccess": [
         [
                 {
                       "number": "94214545455",
                       "status": 203
                 },
                 {
                       "number": "58478",
                       "status": 203
                 }
         ]
   ]
}

API RESPONSE PARAMETERS

Key Description
success Your Result (Success Messages Details)
unsuccess Your Result (Unsuccess Messages Details)
number Your Contact Number
msgId Message Id
status Your Status Code

API STATUS CODE LIST

HTTP Response Response
201 Client API Status is Inactive
202 Invalid API Key
203 Contact Number is Invalid or Operator not Support
205 Length of Contact is Invalid
206 Country is not Availble for Sending SMS
207 No Contact Numbers
208 Account Balance is Insufficient
209 Sending the Messsage is Unsuccessfull
210 Client is Suspended
211 No Mask ID / Mask Id is not Approved
212 Rate Card is not Set for the Country
213 Route is not Set for the Country

SAMPLE CODE FOR SENDING BULK SMS

GET SMS STATUS

The protocol is used to query the submission result of specific msgId array

GET SMS STATUS REQUEST PARAMETERS

Parameters Description Required Type
user_id User ID from your profile page. YES String
api_key API key from your profile page. YES String
msg_id Your Message ID. YES String

GET SMS STATUS SAMPLE

{
"sms_status": 2
}

GET SMS STATUS PARAMETERS

Key Description
sms_status SMS Status Code

SMS STATUS CODE LIST

HTTP Response Response
0 Pending
1 Send
2 Delivered
3 Fail
4 Processing
5 Invalid Msg Id
6 Api key is invalid
7 Api status in inactive
8 Client is Suspended

SAMPLE CODE FOR GETTING SMS STATUS