const url = 'https://api.thanks.io/api/v2/image-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": 6,
"user_id": 2,
"sub_account_id": null,
"type": "postcard",
"name": "Test",
"image": "https://s3.amazonaws.com/cdn.thanks.io/user_image_library/1533645532.png",
"is_dynamic": false,
"dynamic_image_url": null,
"canva_id": null,
"share_uuid": "AQQX-VYXJ-DZM6-XSPD",
"created_at": "2018-08-07T00:00:00.000000Z",
"updated_at": "2022-07-28T00:00:00.000000Z"
},
{
"id": 7,
"user_id": 2,
"sub_account_id": null,
"type": "postcard",
"name": "Test #2",
"image": "https://s3.amazonaws.com/cdn.thanks.io/user_image_library/1533645579.png",
"is_dynamic": false,
"dynamic_image_url": null,
"canva_id": null,
"share_uuid": "ZLSK-FF7K-CF44-UVJM",
"created_at": "2018-08-07T00:00:00.000000Z",
"updated_at": "2022-07-28T00:00:00.000000Z"
}
],
"links": {
"first": "https://api.thanks.io/api/v2/image-templates?page=1",
"last": "https://api.thanks.io/api/v2/image-templates?page=214",
"prev": null,
"next": "https://api.thanks.io/api/v2/image-templates?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 214,
"path": "https://api.thanks.io/api/v2/image-templates",
"per_page": "2",
"to": 2,
"total": 428
}
}
List all available image templates.
const url = 'https://api.thanks.io/api/v2/image-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": 6,
"user_id": 2,
"sub_account_id": null,
"type": "postcard",
"name": "Test",
"image": "https://s3.amazonaws.com/cdn.thanks.io/user_image_library/1533645532.png",
"is_dynamic": false,
"dynamic_image_url": null,
"canva_id": null,
"share_uuid": "AQQX-VYXJ-DZM6-XSPD",
"created_at": "2018-08-07T00:00:00.000000Z",
"updated_at": "2022-07-28T00:00:00.000000Z"
},
{
"id": 7,
"user_id": 2,
"sub_account_id": null,
"type": "postcard",
"name": "Test #2",
"image": "https://s3.amazonaws.com/cdn.thanks.io/user_image_library/1533645579.png",
"is_dynamic": false,
"dynamic_image_url": null,
"canva_id": null,
"share_uuid": "ZLSK-FF7K-CF44-UVJM",
"created_at": "2018-08-07T00:00:00.000000Z",
"updated_at": "2022-07-28T00:00:00.000000Z"
}
],
"links": {
"first": "https://api.thanks.io/api/v2/image-templates?page=1",
"last": "https://api.thanks.io/api/v2/image-templates?page=214",
"prev": null,
"next": "https://api.thanks.io/api/v2/image-templates?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 214,
"path": "https://api.thanks.io/api/v2/image-templates",
"per_page": "2",
"to": 2,
"total": 428
}
}
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?