Get Tag
The Get Tag method allows you to get tag.
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"name": "api-test-tag-1",
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
name required
|
string|array |
The 'name' parameter accepts the name of the tag required for finding it. |
Response
{
"result": true,
"data": {
"id": "TAG_ID",
"name": "TAG_NAME",
"description": "TAG_DESCRIPTION"
}
}
Parameters
Title | Type | Description |
---|---|---|
result |
boolean |
The value indicates that the tag was successfully geted to your account:
|
data |
object |
The data parameter is an object that contains all the necessary information about a specific tag or a set of tags. |
id |
string |
The id parameter returns the unique identifier of the tag. |
name |
string |
The name parameter returns the tag's name. |
description |
string |
The description parameter returns the description of the requested tag. |
Method Errors
{
"result":false,
"errors":[
"Error description text"
]
}
Error |
---|
"Tag name must be a non-empty string" |
"Tag characters length should be between 2 and 30" |
"Any tags starting with an underscore are reserved for internal use and will cause errors" |
"Tags limit {limit} is reached" |
"Tag {tag} is not registered in account tags" |
"Tag name {tag} must be unique" |
"Tag name must contain only numbers, latin/cyrillic characters or \".\", \"-\", \"_\" symbols" |
"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
<?php
$accessToken = 'YOUR_API_KEY';
$url = 'https://api.wooxy.com/v3/tags/get';
$body = json_encode([
'name' => 'api-test-tag',
]);
$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_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 $result . PHP_EOL;
}
curl_close($ch);
?>