Templates
Templates are returned newest first. Templates made only for Discord are not included.
The first time an account is read, AutoDM can add a few starter templates.
An account can have up to 200 templates.
List
GET /public/v1/templates
curl "https://api.autodm.live/public/v1/templates?page=1&limit=25" \
-H "Authorization: Bearer adpk_your_key"
{
"templates": [
{
"id": "22222222-2222-4222-8222-222222222222",
"name": "Guide",
"description": "Link reply",
"format": "TEXT",
"platformRestriction": "ALL",
"carouselCards": null,
"buttons": null,
"mediaAttachment": null,
"timeRouting": null,
"platformStyles": null,
"messages": [
{ "content": "Here is the guide.", "type": "DM" }
]
}
],
"total": 1,
"page": 1,
"limit": 25,
"totalPages": 1
}
format is TEXT, CAROUSEL, or MEDIA.
messages[].type is DM or COMMENT_REPLY. A template can have up to 5 messages, and each message can be up to 4096 characters.
Get one
GET /public/v1/templates/{id}
The body is one template, the same fields as a row in the list.
Create
POST /public/v1/templates
Requires a read and write key. Returns 201 and the new template.
curl https://api.autodm.live/public/v1/templates \
-H "Authorization: Bearer adpk_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Guide",
"description": "Link reply",
"format": "TEXT",
"messages": [
{ "content": "Here is the guide.", "type": "DM" }
]
}'
name is required and can be up to 80 characters. description can be up to 500 characters.
Buttons
Up to 3 buttons. type is web_url, postback, or quick_reply. title can be up to 20 characters.
{
"name": "Guide with a button",
"format": "TEXT",
"messages": [{ "content": "Tap below.", "type": "DM" }],
"buttons": [
{ "type": "web_url", "title": "Open guide", "url": "https://example.com/guide" }
]
}
Carousel
2 to 10 cards. title can be up to 80 characters. buttonTitle can be up to 20 characters.
{
"name": "Products",
"format": "CAROUSEL",
"carouselCards": [
{
"title": "Starter kit",
"subtitle": "Ships today",
"imageUrl": "https://example.com/kit.jpg",
"buttonTitle": "Buy",
"buttonUrl": "https://example.com/kit"
},
{
"title": "Refill",
"imageUrl": "https://example.com/refill.jpg",
"buttonTitle": "Buy",
"buttonUrl": "https://example.com/refill"
}
]
}