const url = 'https://api.thanks.io/api/v2/message-templates/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}, body: undefined};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
{
"data": [
{
"id": 2,
"user_id": 2,
"sub_account_id": null,
"handwriting_style_id": 18,
"font_size": null,
"font_color": null,
"realism": null,
"name": "Thank You Message Templates",
"content": "Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!",
"additional_pages": null,
"skip_creative_generation": 0,
"custom_background_url": null,
"qrcode_url": null,
"cc_emails": [],
"created_at": "2018-08-08T02:56:59.000000Z",
"updated_at": "2025-02-12T05:13:15.000000Z",
"type": "notecard",
"giftcard_brand_code": null,
"giftcard_brand_image": null,
"giftcard_amount": null,
"youtube_id": null,
"landing_page_url": null,
"settings": null,
"external_settings": null,
"share_uuid": "5J5N-QAD3-6LLL-LSZZ"
},
{
"id": 116,
"user_id": 2,
"sub_account_id": null,
"handwriting_style_id": 1,
"font_size": null,
"font_color": null,
"realism": null,
"name": "This is another test",
"content": "Dear %FIRST_NAME%\n\nThis is another test message.",
"additional_pages": null,
"skip_creative_generation": 0,
"custom_background_url": null,
"qrcode_url": null,
"cc_emails": [],
"created_at": "2018-11-10T23:10:52.000000Z",
"updated_at": "2024-05-07T15:24:24.000000Z",
"type": "postcard",
"giftcard_brand_code": null,
"giftcard_brand_image": null,
"giftcard_amount": null,
"youtube_id": null,
"landing_page_url": null,
"settings": null,
"external_settings": null,
"share_uuid": "QT74-5VK4-DJ38-M227"
}
],
"links": {
"first": "https://api.thanks.io/api/v2/message-templates?page=1",
"last": "https://api.thanks.io/api/v2/message-templates?page=71",
"prev": null,
"next": "https://api.thanks.io/api/v2/message-templates?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 71,
"path": "https://api.thanks.io/api/v2/message-templates",
"per_page": "2",
"to": 2,
"total": 141
}
}
List all available message templates.
const url = 'https://api.thanks.io/api/v2/message-templates/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}, body: undefined};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
{
"data": [
{
"id": 2,
"user_id": 2,
"sub_account_id": null,
"handwriting_style_id": 18,
"font_size": null,
"font_color": null,
"realism": null,
"name": "Thank You Message Templates",
"content": "Hey %FIRST_NAME%!,\n\nTHANK YOU for allowing us the opportunity to HELP you with your plan!",
"additional_pages": null,
"skip_creative_generation": 0,
"custom_background_url": null,
"qrcode_url": null,
"cc_emails": [],
"created_at": "2018-08-08T02:56:59.000000Z",
"updated_at": "2025-02-12T05:13:15.000000Z",
"type": "notecard",
"giftcard_brand_code": null,
"giftcard_brand_image": null,
"giftcard_amount": null,
"youtube_id": null,
"landing_page_url": null,
"settings": null,
"external_settings": null,
"share_uuid": "5J5N-QAD3-6LLL-LSZZ"
},
{
"id": 116,
"user_id": 2,
"sub_account_id": null,
"handwriting_style_id": 1,
"font_size": null,
"font_color": null,
"realism": null,
"name": "This is another test",
"content": "Dear %FIRST_NAME%\n\nThis is another test message.",
"additional_pages": null,
"skip_creative_generation": 0,
"custom_background_url": null,
"qrcode_url": null,
"cc_emails": [],
"created_at": "2018-11-10T23:10:52.000000Z",
"updated_at": "2024-05-07T15:24:24.000000Z",
"type": "postcard",
"giftcard_brand_code": null,
"giftcard_brand_image": null,
"giftcard_amount": null,
"youtube_id": null,
"landing_page_url": null,
"settings": null,
"external_settings": null,
"share_uuid": "QT74-5VK4-DJ38-M227"
}
],
"links": {
"first": "https://api.thanks.io/api/v2/message-templates?page=1",
"last": "https://api.thanks.io/api/v2/message-templates?page=71",
"prev": null,
"next": "https://api.thanks.io/api/v2/message-templates?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 71,
"path": "https://api.thanks.io/api/v2/message-templates",
"per_page": "2",
"to": 2,
"total": 141
}
}
Bearer token authentication using your thanks.io API key
Number of items to return per page.
Filter results by Sub Account ID.
OK
The response is of type object
.
Was this page helpful?