API Endpoint and Authentication
Your API endpoint varies based on where your imiconnect account is hosted. Visit Know Your API Endpoint section to know more.
You can use either Service Key or JSON Web Tokens (JWT) for authentication. If you use both JWT authentication and Service Key in an API request, JWT authentication takes priority, and the Service Key is ignored.
The SMS API supports batching. You can send personalized messages to a maximum of 1000 destinations at once (subject to your TPS limits). E.g., if your SMS API TPS configuration is 10 you can send messages to up to 10 destinations at once.
Prerequisites
Channel | Prerequisite |
---|---|
SMS | Sender ID - A Sender ID is a name or number that an SMS appears to come from (‘from address’) when you receive a message on your phone. A sender ID can be alpha-numeric or a short-code or a long-code depending on demographical restrictions. |
SMS API - Samples
{
"from":"<from address for the message, for SMS this will be a senderID>",
"to":[
{
"msisdn":[
"single/multiple destination objects of the same type"
],
"correlationId":"<correlationId for this array of destination objects>",
"substitutions":{
"parameter1":"<substitutions for this array of destination objects> ",
"parametern":"<substitutions for this array of destination objects> "
}
},
// Pass multiple objects in a single destination array for bulk messaging
// Pass one object in each destination array for personalized messaging
{
"msisdn":[
"single/multiple destination objects of the same type"
],
"correlationId":"<correlationId for this array of destination objects>",
"substitutions":{
"parameter1":"<substitutions for this array of destination objects> ",
"parametern":"<substitutions for this array of destination objects> "
}
}
],
// Global substitutions
"substitutions":{
"parameterx":"<global replaceable parameters, destination level parameters take precendence",
},
"expireAt":"<ISO8601 date/time>",
// Channel specific message options
"options":{
object(smsOptions)
},
// Call-backs
"callbackData":"<notify data>",
"callbackUrl":"https://notify.example.com",
"content":{
object(smsMessage)
},
}
}
{
"from": "12233XXXXXX",
"to": "1647XXXXXX",
"content": "SMS API v1 ",
"contentType": "text",
"substitutions": {
"name": "AVC",
"env": "XXX",
"key3": "string",
"key4": "String"
},
"correlationId": "Piority 1",
"callbackUrl": "https://abc.com",
"callbackData": "SMS API v1",
"shortenUrls": true,
"shortUrlDomain": "https://abc.com",
"trackShortUrlClicks": true
}
Postman Collection
Try our APIs using the Postman collection here:
Generating the JWT Token
Connect uses a subset of the JWT fields, described here:
alg
A string used in the header, identifying the algorithm used to encode the payload. The alg value is always HS256 when exchanging messages with Business Chat.iss
A claim that is a string identifying the principal that issued the JWT. The value is always the Service ID when exchanging messages with API v1.iat
A claim that is a numeric date—that is, an integer—identifying the time at which the JWT was issued. The value is the number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date and time, ignoring leap seconds. For more information, see the Terminology section in RFC 7519.A Service Secret that is a Base64-encoded string. Decode the string before using the key to sign the JWT
A decoded JWT token should contain the following -
header
{
"alg": HS256,
}
claims
{
"iss": <Service ID>,
"iat": <issued at unix-timestamp (in seconds)>
}
Body Parameters
Parameter | Type | Mandatory | Description |
---|---|---|---|
from | string | yes | sms - Sender ID |
to | JSONArray | yes | array of destination JSON objects that contain the channel specific destination and personalized substitutions for each destination object Channel wise destinations - sms - msisdn |
content | JSONObject | yes, if template is not provided | contains the content of the message for each channel. see below for more examples |
contentType | string | no | Denotes whether the content string is the actual text content to be sent or a reference to a template ID. |
substitutions | JSONObject | no | a JSON object with global substitutions. If a variable exists both in personalized substitutions and global substitutions, the personalized substitution takes preference |
correlationId | string | no | User defined ID that is assigned to an individual message |
dltTemplateId | string | no | Specifies the DLT template ID used for this message. This is only used in certain regions. |
callbackUrl | string | no | If provided, events related to the delivery of this message will be POSTed to this URL. |
callbackData | string | no | A string that is returned with each outbound web-hook for the message (delivery, failed etc). Maximum number of characters allowed in callbackData including any spaces is 2000. |
expireAt | date/time | no | IS08601 time format for when the message has to be expired and failed if not delivered For example, 2021-06-26T13:47:18.000Z - UTC 2021-06-26T13:47:18.000+05:30 - with timezone * 1624782447 epoch timestamp |
SMS Channel
smsOptions
parameter | type | description |
---|---|---|
shortenLinks | boolean | When enabled, this shortens any https links found in the body the message request |
domain | string | Domain configuration for shortening the links. Needs to be configured through Support team. |
trackClicks | boolean | When shortenLinks is true, you can receive CLICKED receipts on your notifyUrl if trackClicks is true. Clicked format available here |
{
"shortenLinks":true, //shortens any https links found in the body of the request
"domain":"https://me.co.uk", //domain for the shorternedLink must be preconfigured.Please reach out to the support team.
"trackClicks":true //when shorten links is true, clicks can be tracked
}
smsMessage
parameter | type | mandatory | description |
---|---|---|---|
type | string | yes | text or unicode |
text | string | yes | body of the message upto 1024 chars |
Steps for configuring branded / short URLs for using 'shortenLinks' capability:
- Work with your IT team to procure the short URL you want to use.
- Add a CNAME record with relevant redirection based on your Webex Connect tenant location (table below).
- If you need HTTPS redirection (highly recommended), reach out to Webex Connect customer support team and provide the domain certificate to add to the Certificate Manager (ACM) for this purpose. This typically requires some lead time hence we recommend you to plan ahead of time for getting this set-up done and leave some time for end-to-end testing.
- Once the backend set-up has been completed by Webex Connect team, you will be notified over email post which you can start using this.
Please note that usage of short domains for SMS links can have an impact on deliverability in some cases. Operators and aggregators implement various firewalls and fraud mitigation services in order to protect customers from fraud. This means URL shortening techniques can sometimes be blocked with no warning, particularly if the words around them seem fraudulent or related to a popular brand or financial entities.
Existing APIs (these APIs will continue to work for existing tenants):
Webex Connect Region | CNAME | Redirect To |
---|---|---|
AWS Canada | star-1176184099.ca-central-1.elb.amazonaws.com | https://track.imiconnect.ca:443/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
AWS Ireland | star-1747495833.eu-west-1.elb.amazonaws.com | https://track.imiconnect.io:443/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
AWS London | star-1656037958.eu-west-2.elb.amazonaws.com | https://track.imiconnect.eu:443/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
AWS Oregon | star-1571873968.us-west-2.elb.amazonaws.com | https://track.us.webexconnect.io:443/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
Azure (US) | 52.138.107.55 (A Record) | https://track.imiconnect.us/ump-sltrack/TrackServlet?p=https://#{host} |
AWS Mumbai | star-64546195.ap-south-1.elb.amazonaws.com | https://track.imiconnect.in:443/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
AWS Sydney | star-131871454.ap-southeast-2.elb.amazonaws.com | https://track.imiconnect.com.au:443/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
New API endpoints (we recommend you use these for new tenants and services post v6.0 release):
Webex Connect Region | CNAME | Redirect To |
---|---|---|
AWS Canada | star-1176184099.ca-central-1.elb.amazonaws.com | https://track.imiconnect.ca/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
AWS Ireland | star-1747495833.eu-west-1.elb.amazonaws.com | https://track.imiconnect.io/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
AWS London | star-1656037958.eu-west-2.elb.amazonaws.com | https://track.imiconnect.eu/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
AWS Oregon | star-1571873968.us-west-2.elb.amazonaws.com | https://track-us.imiconnect.io/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
Azure (US) | 52.138.107.55 (A Record) | https://track.imiconnect.us/ump-sltrack/TrackServlet?p=https://#{host} |
AWS Mumbai | star-64546195.ap-south-1.elb.amazonaws.com | https://track.imiconnect.in/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
AWS Sydney | star-131871454.ap-southeast-2.elb.amazonaws.com | https://track.imiconnect.com.au/ump-sltrack/TrackServlet?p=https://#{host}/#{path} |
smsMessage
parameter | type | mandatory | description |
---|---|---|---|
type | string | yes | text or unicode |
text | string | yes | body of the message upto 1024 chars |
{
"type":"text or unicode",
"text":"Hi $(name), this is a text message ${field2}" //body of the message with variables represented as $(variable)
}