Skip to main content

Templates

01. List templates

Back to top

Get a list of templates.

GET /int/v1/template

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Query Parameters

NameTypeDescription
categoryStringoptional 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

NameTypeDescription
successBooleanIndicates whether the operation was successful.
dataArrayoptionalList of template objects. Present when success is true.
messageStringoptionalError 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"
}
]
}