Create Group
This request is used to create a new group.
HTTP Request
URL | Method | Description |
---|---|---|
https://app.tellody.com/CampaignCloud/Group | POST | Create group |
POST Parameters
The group's details have to be passed as a data parameter in the POST request.
During group creation, it is mandatory to set the group's title and creation date.
Name | Description |
---|---|
"generationDate" | This key is set to the current date represented as an integer in milliseconds. |
"size" | This key is set to zero since a new group cannot have existing members during its creation. |
"title" | This key is set to a string value for the title of the group. |
"description" | This key is set to a string value with the desription of the group. |
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 headers
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)
data = {"generationDate":startDate,"size":0,"title":"My New Group","description":"A new group"}
response = my_session.post("https://app.tellody.com/CampaignCloud/Group", header, data).json()
print(json.dumps(response,ensure_ascii=False))
Sample Response
The new group is created successfully when the result returns an integer value for "subscriptionId".
{
"size":0,
"generationDate":1439808335000,
"id":21,
"description":"A new group",
"title":"My New Group"
}
Errors
When the result does not return a "subscriptionId", then the request has failed. More information on the error can be derived by the HTTP response. (e.g. HTTP 400, 414 etc.)