Communication API

API Reference Wiki


SMS

Voice


Send SMS

Use this to send SMS
Path : /api/SMS
Method : Send
Action POST
Parameters
# Parameter Name Type Mandatory Description
1 UserName String Yes
  • Url Parameter
  • Accountid that is provided to you for authentication
2 Password String Yes
  • Url Parameter
  • Provided while account creation for authentication
3 Destination JArray Yes
  • Body Parameter
  • JArray of mobile numbers
  • The destination phone number. Format with a '00' and country code e.g. 0016175551212 (E.164 format)

Example

"Destination" : [{"MobileNo" : "0016175551212"}, {"MobileNo" : "0016175551212"}]
4 Sender JProperty Yes
  • Body Parameter
  • A platform approved phone number (in E.164 format) or Alphanumeric Sender ID enabled in your account to send SMS

Example

"Sender" : "OM"
5 Message JProperty Yes
  • Body Parameter
  • The text of the message you want to send, limited to 1000 characters.

Example

"Message" : "Welcome to Optimum Measures meassaging solution"
5 ReferenceID JProperty No
  • Body Parameter
  • Unique identifier passed by the client for each record

Example

"ReferenceID" : "ID09890"
6 CallBack JProperty No
  • Body Parameter
  • Determines whether Status callback is needed for this submission
  • Default set to "No"

Example

"CallBack" : "Yes"

Sample Request

"Destination" : { [{"MobileNo" : "0016175551212"}, {"MobileNo" : "0016175551212"}], "Message" : "Welcome to Optimum Measures meassaging solution", "Sender" : "OM", "ReferenceID" : "ID09890", "CallBack" : "Yes" }

Response

API returns a response in json format
Parameters
# Parameter Name Type Description
1 ID / Error ID JProperty
  • Response Body
  • JProperty

Example

Success
"ID" : "7865"
Error
"Error ID" : "125"
2 Status JProperty
  • Response Body
  • JProperty

Example

Success
"Status" : "Received"

Example

Error
"Status" : "Received with Error. Parameter Sender is missing or empty"

Sample Response

Success
{ "ID" : "7865", "Status" : "Received" }
Error
{ "Error ID": "125", "Status": "Received with error - Parameter Sender is missing or empty" }

Callback

A client URL that messaging service will POST to, each time the status of the SMS changes in messaging service system. it will POST the following parameters to the URL
Parameters
# Parameter Name Type Description
1 ID JProperty
  • Request Body
  • JProperty
  • ID response received in Submit request

Example

"ID" : "7865"
2 MobileNo JProperty
  • Request Body
  • JProperty
  • Mobile no posted to in the request

Example

"MobileNo" : "0016175551212"
3 Status JProperty
  • Request Body
  • JProperty
  • Delivery status of the SMS obtained by the operator

Example

"Status" : "Delivered"
4 DateTime JProperty
  • Request Body
  • JProperty
  • SMS sent date time

Example

"DateTime" : "2017-07-16 12:08:56.690"
5 ReferenceID JProperty
  • Request Body
  • JProperty
  • Unique identifier received in Submit request

Example

"ReferenceID" : "ID09890"
6 Error JProperty
  • Request Body
  • JProperty
  • Error Description

Example

"Error" : "International Number Invalid"
7 ErrorLogsID JProperty
  • Request Body
  • JProperty
  • Error ID response received in Submit request

Example

"ErrorLogsID" : "42"

Sample Response

{ "ID" : "7865", "MobileNo" : "0016175551212", "Status" : "Delivered", "DateTime" : "2017-07-16 12:08:56.690", "ReferenceID" : "ID09890", "Error": "International Number Invalid", "ErrorLogsID": "42" }

Get Status

Get status of the SMS
Path : /api/SMS
Method : GetStatus
Parameters
# Parameter Name Type Description
1 ID String
  • URL

Example

ID=1233
Response
1 ID JProperty
  • Response Body
  • JProperty
  • ID passed in request

Example

"ID" : "1233"
2 Status JProperty
  • Response Body
  • JProperty
  • Delivery status of the SMS obtained from the operator

Example

"Status" : "Delivered"
3 Delivery Date JProperty
  • Response Body
  • JProperty
  • Delivery status of the SMS obtained by the operator

Example

"Delivery Date" : "2017-07-16 12:08:56.690"

Sample Response

{ "ID" : "1234", "Status" : "Delivered", "Delivery Date" : "2017-07-16 12:08:56.690" }

Voice Call

Trigger a call
Path : /api/Voice
Method : Call
Action POST
Parameters
# Parameter Name Type Mandatory Description
1 UserName String Yes
  • Url Parameter
  • Accountid that is provided to you for authentication
2 Password String Yes
  • Url Parameter
  • Provided while account creation for authentication
3 Destination JArray Yes
  • Body Parameter
  • JArray of mobile numbers
  • The destination phone number. Format with a '00' and country code e.g. 0016175551212 (E.164 format)

Example

"Destination" : [{"MobileNo" : "0016175551212"}, {"MobileNo" : "0016175551212"}]
4 Sender JProperty Yes
  • Body Parameter
  • A platform approved phone number (in E.164 format) enabled in your account that will act as a CLI to Trigger the call

Example

"Sender" : "00919833111380"
5 Message JProperty Yes
* Message or CampaignID, either of the two should be present in the request for it to be valid. Both cannot be present in the same request.
  • Body Parameter
  • TTS script

Example

"Message" : "Welcome to Optimum Measures Voice solution"
6 CampaignID JProperty Yes
* Message or CampaignID, either of the two should be present in the request for it to be valid. Both cannot be present in the same request.
  • Body Parameter
  • Campaign ID allocated to the account which corresponds to a pre-recorded Audio in the system

Example

"CampaignID" : "fc46b682-b939-4fc2-81c3-891cfb23cd92"
6 Locale JProperty Yes,with condition when 'Message' is present
  • Body Parameter
  • Locale to be used for text to speech
  • Supported Locales
    Language Locale
    Chinese, Mandarin cmn-CN
    Danish da-DK
    Dutch nl-NL
    English, Australian en-AU
    English, British en-GB
    English, Indian en-IN
    English, US en-US
    English, Welsh en-GB-WLS
    French fr-FR
    French, Canadian fr-CA
    Hindi hi-IN
    German de-DE
    Icelandic is-IS
    Italian it-IT
    Japanese ja-JP
    Korean ko-KR
    Norwegian nb-NO
    Polish pl-PL
    Portuguese, Brazilian pt-BR
    Romanian ro-RO
    Russian ru-RU
    Spanish, European es-ES
    Spanish, Mexican es-MX
    Spanish, US es-US
    Swedish sv-SE

Example

"Locale" : "hi-IN"

Sample Request with Message

"Destination" : { [{"MobileNo" : "0016175551212"}, {"MobileNo" : "0016175551212"}], "Message" : "Welcome to Optimum Measures Voice solution", "Sender" : "00919833111380", "Locale" : "hi-IN" }

Sample Request with CampaignID

"Destination" : { [{"MobileNo" : "0016175551212"}, {"MobileNo" : "0016175551212"}], "CampaignID" : "fc46b682-b939-4fc2-81c3-891cfb23cd92", "Sender" : "00919833111380" }

Response

API returns a response in json format
Parameters
# Parameter Name Type Description
1 ID JProperty
  • Response Body
  • JProperty

Example

"ID" : "7865"
2 Status JProperty
  • Response Body
  • JProperty

Success

"Status" : "Received"

Error

For more details visit Call Status and Error Details section

Sample Response

{ "ID" : "7865", "Status" : "Received" }
{ "ID" : "7865", "ErrorID" : "5000", "Message" : "Received with error - Parameter Destination/Mobile No is missing or empty" }

Callback

A client URL that the callback service will POST to, with the Call Details Record(CDR) details of call triggered. It will POST the following parameters to the URL x`x`
Parameters
# Parameter Name Type Description
1 GUID JProperty
  • Request Body
  • JProperty
  • GUID response received in Trigger request

Example

"GUID" : "a4d5b8e3-f415-45bb-a73d-14629b500240"
2 MobileNo JProperty
  • Request Body
  • JProperty
  • Mobile number where the call has been triggered to

Example

"MobileNo" : "0016175551212"
3 Status JProperty

Example

"Status" : "Answered"
4 Calltime JProperty
  • Request Body
  • JProperty
  • Voice Call - Trigger date time

Example

"Calltime" : "2017-07-16 12:08:56.690"
5 AnswerTime JProperty
  • Request Body
  • JProperty
  • Voice Call - Answer date time

Example

"AnswerTime" : "2017-07-16 12:08:56.690"
6 Duration JProperty
  • Request Body
  • JProperty
  • Total Duration of the call in seconds

Example

"Duration" : "10"
7 Reason JProperty

Example

"Reason" : "Blocked"

Sample Response

{ "GUID" : "a4d5b8e3-f415-45bb-a73d-14629b500240", "MobileNo":"0016175551212", "Status" : "Answered", "Calltime":"2017-07-16 12:08:56.690", "AnswerTime":"2017-07-16 12:08:56.690", "Duration":"10", "Reason":"Blocked" }

Call Status and Error details

Call Status
Answered
Busy
NoAnswer
Failed

Reasons may have one of the following values for failed call status
Reasons
NA
Timeout
CallerHangUp
Blocked
General Error
Cancel

Error Details (Platform Rejection)
ErrorID Message
5000 Received with error - Parameter Destination/Mobile No is missing or empty
5000 Received with error - Parameter Sender is missing or empty
5000 Received with error - Parameter Message or CampaignID is missing or empty
5000 Received with error - Parameter Locale is missing or empty
5001 Received with error - Invalid Json
5002 Received with error - Invalid Campaign
5003 Received with error - Message or CampaignID, either of the two should be present