Find Template
The Find Template method allows you to get multiple email templates.
Important!
In this method, pagination is used to display information about a large number of lists simultaneously. The offset is considered the starting point, and the limit is the endpoint.
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"offset": 0,
"limit": 20
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
offset optional
|
integer | 0 |
Allows you to omit a specified number of rows (number of templates) before the beginning of return rows (events) from the query. |
limit optional
|
integer | 20 |
Allows you to limit the number of rows (templates) returned from a query. |
Response
{
"result": true,
"data": [{
"templateId": "YOUR_TEMPLATE_ID_1",
"name": "",
"html": "Hello, World!",
"templateSource": "dnd",
"subject": "Hello subject",
"createdAt": "YYYY-MM-DD HH:mm:ss",
"updatedAt": "YYYY-MM-DD HH:mm:ss"
},
{
"templateId": "YOUR_TEMPLATE_ID_2",
"name": "",
"html": "Hello, World!",
"templateSource": "dnd",
"subject": "Hello subject",
"createdAt": "YYYY-MM-DD HH:mm:ss",
"updatedAt": "YYYY-MM-DD HH:mm:ss"
}],
"totalCount":217,
"offset": 0,
"limit": 20
}
Parameters
Title | Type | Description |
---|---|---|
result |
boolean |
Indicated that the query was successful:
|
data |
array |
An array of fetched information. |
data.templateId |
string |
YOUR_TEMPLATE_ID from the Wooxy system. |
data.name |
string |
Template name in the Wooxy system. |
data.html |
string |
The full HTML or text content of the template. |
data.templateSource |
string |
Template creation type in the Wooxysystem. Some types of templates are not possible to update via API to avoid breaking metadata necessary for correct work:
|
data.subject |
string |
The Email subject. |
data.createdAt |
string |
Time of template creation |
data.updatedAt |
string |
Time of template last updated in |
totalCount |
integer |
The number of templates that were found in the request. |
offset |
integer |
Allows you to omit a specified number of rows (number of templates) before the beginning of return rows (templates) from the query. |
limit |
integer |
Allows you to limit the number of rows (templates) returned from a query. |
Method Errors
{
"result": false,
"errors": [
"Error description text"
]
}
Error |
---|
“Argument name must be a non-empty string with max length within 255 characters” |
“Parameter offset must be an integer” |
“Parameter limit must be an integer” |
“Invalid authorization token!” |
“Internal server error” |
“Bad Request” |
“no matches found for access token {accessToken}” |
“user {id} not enabled” |
“no data found for key {userId}” |
“access token check failed for key\/secret $key\/$accessToken” |
“Argument {argument} required” |
Code Examples
$accessToken = "YOUR_API_KEY";
$url = 'https://api.wooxy.com/v3/template/email/find';
$body = json_encode([
'offset' => 0,
'limit' => 20
]);
/**
* Request Example
*/
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Access-Token: $accessToken",
'Content-Type: application/json',
'Content-Length: ' . strlen($body),
]);
$result = curl_exec($ch);
if ($result === false) {
echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
echo strval($result) . PHP_EOL;
}
curl_close($ch);