Get a Template

This retrieves all data related with a specific Template.

Response Code

200

Arguments

template_id The Template ID

Definition

GET https://api.gathercontent.com/templates/<TEMPLATE_ID>

cURL Example

curl https://api.gathercontent.com/templates/<TEMPLATE_ID> \ -u [email protected]:<YOUR_API_KEY> \ -H "Accept: application/vnd.gathercontent.v0.5+json"

Returns

JSON Object

Example Response

{ "data": { "id": 123456, "project_id": 123456, "created_by": 123456, "updated_by": 123456, "name": "Blog Theme", "description": "Blog theme", "config": [ { "label": "Content", "name": "tab1440604292948", "hidden": false, "elements": [ { "type": "text", "name": "el1440604298968", "required": false, "label": "Title", "value": "<p>\n \u200b\n<\/p>", "microcopy": "", "limit_type": "words", "limit": "0", "plain_text": false }, { "type": "text", "name": "el1440604306459", "required": false, "label": "Main Content", "value": "<p>\n \u200b\n<\/p>", "microcopy": "", "limit_type": "words", "limit": "0", "plain_text": false }, { "type": "files", "name": "el1440604311606", "required": false, "label": "Featured Image", "microcopy": "Microcopy text" } ] } ], "used_at": "2015-08-26 17:03:20", "created_at": 1440604320, "updated_at": 1440608600, "usage": { "item_count": 1 } } }

PHP Example

<?php
$username 
[email protected]';
$apikey '<YOUR_API_KEY>';

$template_id '<TEMPLATE_ID>';

$ch curl_init();

curl_setopt$chCURLOPT_HTTPAUTHCURLAUTH_BASIC);
curl_setopt$chCURLOPT_HTTPHEADER, array('Accept: application/vnd.gathercontent.v0.5+json'));
curl_setopt$chCURLOPT_USERPWD$username ':' $apikey);
curl_setopt$chCURLOPT_URL'https://api.gathercontent.com/templates/' $template_id);
curl_setopt$chCURLOPT_RETURNTRANSFERtrue );

$response json_decodecurl_exec$ch ) );
curl_close$ch );

Great, welcome aboard!

That’s it! You’re signed up to our mailing list and can expect content strategy goodness in your inbox soon.