Create Collection
This endpoint will allow the User to create a collection in a specific bot.
Request
The following request will create a collection in the bot specified by the Bot Token.
curl --location --request POST 'https://<SERVICE ENDPOINT>/data/collection' \
--header 'Authorization: Bearer <BOT_AUTH_TOKEN>' \
--header 'Content-Type: application/json'
--data-raw '{ "Item":{
"CollectionName":"Customer_Emails"
}
}'
Response
If successful, the response will contain the created collection associated with bot specified in the request token.
{
"CollectionId": "The ID of the collection",
"Name": "Name of the collection",
"Fields": [{
"Group": "Group of the Field",
"Name": "Name of the Field",
"Value": "Value of the Field",
"Mandatory": boolean,
"DisplayInView": boolean,
"Indexed": boolean,
"Type": number,
"OrderField": "The position of the field",
}],
}
The Type property is a number that goes from 0 to 8 that specifies the Field Type.
Text = 0,
LongText = 1,
MultiChoice = 2,
Date = 3,
DateTime = 4,
IntegerNumber = 5,
DecimalNumber = 6,
Boolean = 7,
Upload = 8
Response Codes
This endpoint will reply with the following standard HTTP codes.
Code
Meaning
200
Ok. The request has been successfully fulfilled.
400
Bad Request. The supplied token is invalid or does not have enough permissions.
401
Unauthorized. The account associated to the token is not authorized
404
Not Found. The account or the chatbot specified could not be found.
Last updated
Was this helpful?