Templates
01. List templates
Get a list of templates.
GET /int/v1/template
Headers - Header
| Name | Type | Description |
|---|---|---|
| Authorization | String | Prefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result). |
Query Parameters
| Name | Type | Description |
|---|---|---|
| category | String | optional Filter by category. |
Examples
CURL Example:
curl -H "Authorization: Bearer <token>" \
-X GET https://<url>/int/v1/template
Javascript Example:
(async (url, token) => {
try{
const response = await(
await fetch(
`${url}/int/v1/template`,
{
method: "GET",
headers: {
"Authorization": `Bearer ${token}`
}
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN);
Success response
Success response - Success 200
| Name | Type | Description |
|---|---|---|
| success | Boolean | Indicates whether the operation was successful. |
| data | Array | optionalList of template objects. Present when success is true. |
| message | String | optionalError message. Present when success is false. |
Success response example
Success response example - Success:
HTTP/1.1 200 OK
{
"success":true,
"data":[
{
"_id": "63fe9478ae90f495192b2a5c",
"name": "My Template",
"marketImagePath": "https://cf.communic8.com/poit/image/upload/v1677628644/c8test/test/thumbnail_wzVh5.png",
"lang": "en",
"categories": [
"dynamic"
],
"isSurvey": false,
"templateUrl": "https://test.communic8.com/admin/web/#/pitches/details/63fe9478ae90f495192b2a5c"
}
]
}