/api/adtool/type
get
Get details of adtool type
Authorizations
api-keystringRequired
api-usernamestringRequired
Query parameters
adtool_type_idintegerRequired
deletedstringOptional
return_fieldsstringOptionalDefault:
1Responses
200
success
successbooleanOptionalExample:
trueget/api/adtool/type
PHP (cURL)<?php
$headers = array( //set your username and API key here
'api-key: 44b5498dbcb481a0d00b404c0169af62',
'api-username: tmm1phrvezsbu'
);
$url = 'https://yourdomain.com'; //set your NATS URL here
$data = array(
'adtool_type_id' => 4,
'deleted' => 1,
'return_fields' => 1
);
$request = array(
'method' => 'GET',
'path' => 'adtool/type',
'data' => $data
);
/*code below is the same for (almost) every API call */
$curl = curl_init();
$url = $url.'/api/'.$request['path'];
$query = http_build_query($request['data']);
if($request['method'] == 'GET'){
//add query string parameters to the end of the url
$url = $url.'?'.$query;
}else{
//send parameters as POST fields
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
if($request['method'] != 'POST'){
$headers[] ='X-HTTP-Method: '.$request['method']; //send custom request method
}
}
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($curl);
//dumps an associative array representation of the json
var_dump(json_decode($resp, true));
// Close request to clear up some resources
curl_close($curl);
?>200
success
{
"success": true,
"adtool_type": {
"adtool_type_id": "4",
"name": "Content",
"adtool_category_id": "3",
"description": "Content Zips",
"orderid": "5",
"deleted": "0",
"switch_db_field": "type",
"disp_tpl": "content",
"form_tpl": "content",
"protection": "2",
"bulk": "3",
"zip_type": "2",
"short": "content",
"adtool_count": 0,
"types": {
"db_field": "type",
"options": {
"1": "Pictures",
"2": "Videos",
"3": "Mixed"
}
},
"fields": [
{
"adtool_field_id": "21",
"adtool_type_id": "4",
"shortname": "name",
"name": "Name",
"type": "0",
"required": "1",
"min": "1",
"max": "128",
"orderid": "1",
"min_display": "1",
"allow_search": "1",
"is_unique": "1",
"protection": "2",
"check_function": "",
"deleted": "0",
"type_nice": "Text Field",
"allow_search_nice": "Text"
},
{
"adtool_field_id": "22",
"adtool_type_id": "4",
"shortname": "content_zip",
"name": "Content Zip",
"type": "3",
"required": "1",
"min": "0",
"max": "0",
"orderid": "2",
"min_display": "0",
"allow_search": "0",
"is_unique": "0",
"protection": "2",
"check_function": "",
"deleted": "0",
"type_nice": "Zip Upload",
"allow_search_nice": "No"
},
{
"adtool_field_id": "23",
"adtool_type_id": "4",
"shortname": "type",
"name": "Type",
"type": "1",
"required": "1",
"min": "0",
"max": "0",
"orderid": "3",
"min_display": "1",
"allow_search": "2",
"is_unique": "0",
"protection": "2",
"check_function": "",
"deleted": "0",
"type_nice": "Multiple Choice",
"allow_search_nice": "Text",
"mc_options": [
{
"id": 1,
"option": "Pictures",
"deleted": "0"
},
{
"id": 2,
"option": "Videos",
"deleted": "0"
},
{
"id": 3,
"option": "Mixed",
"deleted": "0"
}
],
"mc_options_deleted": {
"1": "0",
"2": "0",
"3": "0"
}
},
{
"adtool_field_id": "24",
"adtool_type_id": "4",
"shortname": "thumbnail",
"name": "Thumbnail",
"type": "106",
"required": "0",
"min": "0",
"max": "0",
"orderid": "4",
"min_display": "0",
"allow_search": "0",
"is_unique": "0",
"protection": "2",
"check_function": "content_zip",
"deleted": "0",
"type_nice": "Thumbnail",
"allow_search_nice": "No",
"ext": "thumb_ext"
},
{
"adtool_field_id": "25",
"adtool_type_id": "4",
"shortname": "zip_size",
"name": "File Size",
"type": "102",
"required": "0",
"min": "0",
"max": "0",
"orderid": "5",
"min_display": "0",
"allow_search": "0",
"is_unique": "0",
"protection": "2",
"check_function": "content_zip",
"deleted": "0",
"type_nice": "File Size",
"allow_search_nice": "No"
},
{
"adtool_field_id": "26",
"adtool_type_id": "4",
"shortname": "thumb_ext",
"name": "Thumb Ext",
"type": "103",
"required": "0",
"min": "0",
"max": "0",
"orderid": "6",
"min_display": "0",
"allow_search": "0",
"is_unique": "0",
"protection": "2",
"check_function": "thumbnail",
"deleted": "0",
"type_nice": "Extension",
"allow_search_nice": "No"
}
],
"adtool_category": "Content"
}
}post
Add new adtool type
Authorizations
api-keystringRequired
api-usernamestringRequired
Query parameters
namestringRequired
adtool_category_idintegerOptionalDefault:
4copy_adtool_type_idintegerOptional
descriptionstringOptional
disp_tplstringOptional
form_tplstringOptional
Responses
200
success
successbooleanOptionalExample:
truepost/api/adtool/type
PHP (cURL)<?php
$headers = array( //set your username and API key here
'api-key: 44b5498dbcb481a0d00b404c0169af62',
'api-username: tmm1phrvezsbu'
);
$url = 'https://yourdomain.com'; //set your NATS URL here
$data = array(
'name' => 'testType',
'adtool_category_id' => 2,
'copy_adtool_type_id' => 2,
'description' => 'test type addition',
'disp_tpl' => 'page',
'form_tpl' => 'fhg'
);
$request = array(
'method' => 'POST',
'path' => 'adtool/type',
'data' => $data
);
/*code below is the same for (almost) every API call */
$curl = curl_init();
$url = $url.'/api/'.$request['path'];
$query = http_build_query($request['data']);
if($request['method'] == 'GET'){
//add query string parameters to the end of the url
$url = $url.'?'.$query;
}else{
//send parameters as POST fields
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
if($request['method'] != 'POST'){
$headers[] ='X-HTTP-Method: '.$request['method']; //send custom request method
}
}
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($curl);
//dumps an associative array representation of the json
var_dump(json_decode($resp, true));
// Close request to clear up some resources
curl_close($curl);
?>200
success
{
"success": true,
"result": "adtool type added",
"type": false
}delete
Delete adtool type
Authorizations
api-keystringRequired
api-usernamestringRequired
Query parameters
adtool_type_idintegerRequired
Responses
200
success
successbooleanOptionalExample:
truedelete/api/adtool/type
PHP (cURL)<?php
$headers = array( //set your username and API key here
'api-key: 44b5498dbcb481a0d00b404c0169af62',
'api-username: tmm1phrvezsbu'
);
$url = 'https://yourdomain.com'; //set your NATS URL here
$data = array(
'adtool_type_id' => 2
);
$request = array(
'method' => 'DELETE',
'path' => 'adtool/type',
'data' => $data
);
/*code below is the same for (almost) every API call */
$curl = curl_init();
$url = $url.'/api/'.$request['path'];
$query = http_build_query($request['data']);
if($request['method'] == 'GET'){
//add query string parameters to the end of the url
$url = $url.'?'.$query;
}else{
//send parameters as POST fields
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
if($request['method'] != 'POST'){
$headers[] ='X-HTTP-Method: '.$request['method']; //send custom request method
}
}
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($curl);
//dumps an associative array representation of the json
var_dump(json_decode($resp, true));
// Close request to clear up some resources
curl_close($curl);
?>200
success
{
"success": true,
"result": "Type deleted"
}patch
Edit adtool type
Authorizations
api-keystringRequired
api-usernamestringRequired
Query parameters
adtool_type_idintegerRequired
descriptionstringOptional
switch_db_fieldstringOptional
disp_tplstringOptional
form_tplstringOptional
adtool_category_idintegerOptional
deletedstringOptional
Responses
200
success
successbooleanOptionalExample:
truepatch/api/adtool/type
PHP (cURL)<?php
$headers = array( //set your username and API key here
'api-key: 44b5498dbcb481a0d00b404c0169af62',
'api-username: tmm1phrvezsbu'
);
$url = 'https://yourdomain.com'; //set your NATS URL here
$data = array(
'adtool_type_id' => 2,
'description' => 'test restore type description',
'disp_tpl' => 'page',
'form_tpl' => 'fhg',
'adtool_category_id' => 1,
'deleted' => 1
);
$request = array(
'method' => 'PATCH',
'path' => 'adtool/type',
'data' => $data
);
/*code below is the same for (almost) every API call */
$curl = curl_init();
$url = $url.'/api/'.$request['path'];
$query = http_build_query($request['data']);
if($request['method'] == 'GET'){
//add query string parameters to the end of the url
$url = $url.'?'.$query;
}else{
//send parameters as POST fields
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
if($request['method'] != 'POST'){
$headers[] ='X-HTTP-Method: '.$request['method']; //send custom request method
}
}
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$resp = curl_exec($curl);
//dumps an associative array representation of the json
var_dump(json_decode($resp, true));
// Close request to clear up some resources
curl_close($curl);
?>200
success
{
"success": true,
"result": "Type updated"
}Last updated
Was this helpful?