Configure SMS
This request is used to configure SMS messages with the appropriate settings on content, scheduling and targetted contacts.
HTTP Request
URL | HTTP Method | Description |
---|---|---|
https://app.tellody.com/CampaignCloud/Config | POST | Submit Configuration |
Parameters
Name | Description |
---|---|
title | SMS title to appear for SMS configuration in UI messages list. A string value is used. |
startDate | Sets the date and time to send bulk messages to all selected contacts. It is set as an integer value which represents the date in milliseconds. To start sending at the time of request, the value should be “null” or alternatively this parameter can be omitted. |
contactIds | This should include all the contact Ids that should receive the SMS. It is set as an array of comma separated integers; each of them representing a contact Id (e.g. “contactIds”:[5,18,29,30]). Leave array blank [] when no individual contacts should be selected. |
includedGroups | This will include the selected groups based on their ids in the form of a string “Group<id>“. It is set as an array of comma separated strings; each of them representing a group Id. e.g. “includedGroups”:[“Group2”, “Group3”]. Leave array blank [] when no groups should be selected. |
excludedGroups | This will include explicitly or groups that should not receive the message. The supported value format is exactly the same as for included groups. However, the value should always include the Blocked group (Group1) amongst any other groups to be excluded . e.g. "excludedGroups":["Group1”,”Group5”] |
message | This is parameter sets the message content as a string value. The value of this parameter should be no longer than 160 characters for single SMS. In case more characters are included then additional SMS will be sent to each contact. In general the number of SMS that is sent follows the rule: abs(Total Characters/160) = N+1 SMS, where N is the integer part of the result. |
contentForUniqueCode | This parameter includes a selected file to be sent with the message. Its value is set to a string of the form “file/filename>(campaign_id)” e.g. "contentForUniqueCode":"file/cream-cheese - Copy.jpgcampaign_60" |
urlForUniqueCode | This parameter includes a url that appears embedded in the body of the message. Its value is a URL string e.g. "urlForUniqueCode":"http://www.msensis.com" |
voucherForUniqueCode | This is an integer value that is generated automatically by the system upon executing/activating a configured voucher. |
campaignTemplateType | This declares the type of configuration. For bulk SMS, it is set to the string "BULK" |
campaignChannel | This declares the type of service. For send SMS request it should be set to the string value “SMS” |
userId | This is set to integer zero by default |
sender | This is the username of the Tellody user to create and send the SMS. |
Sample Request
#Retrieving the XSRF Token needed for Session
pingResponse = my_session.get("https://app.tellody.com/CampaignCloud/RememberMeController/ping")
#Import the X-XSRF-Token returned from RememberMeController/ping into the request header
xsrfToken = pingResponse.headers.get("X-XSRF-TOKEN")
#HTTP request header
header = {"Content-Type" : "application/json", "X-XSRF-TOKEN" : xsrfToken}
#get current date
t=datetime.datetime.now()
startDate = time.mktime(t.timetuple())*1000
print("double date is: {}".format(startDate))
startDate = int(startDate)
print('\ncurrent date is: {}'.format(startDate))
#Create a json file with the config of the sms message and send it
data = {
"title":"Greetings to ALL",
"startDate":startDate,
"contactIds":[],
"includedGroups":["Group2"],
"excludedGroups":["Group1"],
"message":"Dear friends 111",
"campaignTemplateType":"BULK",
"campaignChannel":"SMS",
"userId":0,
"sender":"tester",
"contentForUniqueCode":null,
"urlForUniqueCode":null
}
url="https://app.tellody.com/CampaignCloud/Config"
response = my_session.post(url, header, data).json()
response_id=response['id']
print('\nresponse id is: {} \n'.format(response_id))
Sample Response
The result of the request returns an alphanumeric string value which serves as the configuration identifier which can be used later on to select and send this message.
{
"contactIds":[],
"contentForUniqueCode":null,
"excludedGroups":["Group1"],
"message":"Dear friends 111",
"id":"55cb4a5dc5ed6e0c60bbe12d",
"campaignId":0,
"sender":"tester",
"endDate":null,
"title":"Greetings to Everyone",
"userId":0,
"campaignTemplateType":"BULK",
"startDate":1439386205000,
"campaignChannel":"SMS",
"includedGroups":["Group2"],
.......
}
Errors
If the result of the configuration does not return such a value, then the request has failed. More information on the issue can be derived by the HTTP response. (e.g. HTTP 400, 414 etc.)