NATS4 REST API Adtool Types
From TMM Wiki
Jump to navigationJump to searchGET adtools/types
Description
- This resource allows you to get a list of available adtool types.
Resource URL
- http://domain/api/adtools/types
- Replace domain with the nats domain
- GET
Response Format
- JSON
- HTTP headers
Parameters
- None
Example Request
GET
http://domain/api/adtools/types
- Response:
[ { "adtool_type_id": "1", "adtool_category_id": "1", "name": "Image Banners", "description": "Image Banners" }, { "adtool_type_id": "2", "adtool_category_id": "2", "name": "FHG", "description": "Free Hosted Galleries" }, { "adtool_type_id": "3", "adtool_category_id": "6", "name": "Page Ads", "description": "Half Page \/ Full Page Ads" }, { "adtool_type_id": "4", "adtool_category_id": "3", "name": "Content", "description": "Content Zips" }, { "adtool_type_id": "5", "adtool_category_id": "3", "name": "Feeds", "description": "Feeds" }, { "adtool_type_id": "6", "adtool_category_id": "3", "name": "Mailers", "description": "Mailing Ads" }, { "adtool_type_id": "7", "adtool_category_id": "5", "name": "Page Peels", "description": "Page Peel Ads" }, { "adtool_type_id": "8", "adtool_category_id": "1", "name": "Geo Banners", "description": "Geo Targeted Banners" }, { "adtool_type_id": "9", "adtool_category_id": "1", "name": "Flash Banners", "description": "Flash Banners" }, { "adtool_type_id": "11", "adtool_category_id": "3", "name": "Fan Signs", "description": "Custom Fan Signs" }, { "adtool_type_id": "12", "adtool_category_id": "3", "name": "Video Download", "description": "Downloadable Videos" }, { "adtool_type_id": "14", "adtool_category_id": "6", "name": "HFS", "description": "Free Sites" }, { "adtool_type_id": "18", "adtool_category_id": "5", "name": "IM Popups", "description": "IM Popups" }, { "adtool_type_id": "19", "adtool_category_id": "5", "name": "Footer Ads", "description": "Footer Ads" }, { "adtool_type_id": "21", "adtool_category_id": "6", "name": "Overlays", "description": "Page Overlay Ads" }, { "adtool_type_id": "22", "adtool_category_id": "3", "name": "Video Hosted", "description": "Hosted Videos" }, { "adtool_type_id": "23", "adtool_category_id": "3", "name": "Video Embed", "description": "Embedded Videos" }, { "adtool_type_id": "101", "adtool_category_id": "101", "name": "gbtemplate", "description": "Gallery Builder" }, { "adtool_type_id": "102", "adtool_category_id": "101", "name": "gbcontent", "description": "Gallery Builder Content" }, { "adtool_type_id": "103", "adtool_category_id": "3", "name": "COTD", "description": "Content of the Day" }, { "adtool_type_id": "1000", "adtool_category_id": "1000", "name": "tobiascustom", "description": "custom ad tool" } ]
Example Code
PHP
<?php $url = 'http://domain/api/adtools/types'; $curl = curl_init(); $headers = array( 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: tmm1phrvezsbu' ); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_URL, $url); $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); ?>
Python
- This example requires pip and the request library which can be installed via pip by: 'pip install requests'
import requests url = 'http://domain/api/adtools/types' headers = { 'api-key': '44b5498dbcb481a0d00b404c0169af62', 'api-username': 'tmm1phrvezsbu' } res = requests.get(url, headers=headers) print res.json()
node.js
- This example requires npm and the request module which can be installed via npm by: 'npm install request'
var request = require('request'); var options = { url: 'http://domain/api/adtools/types', method: 'GET', json: true, headers: { 'api-key': '44b5498dbcb481a0d00b404c0169af62', 'api-username': 'tmm1phrvezsbu' } }; function callback(error, response, body) { if (!error && response.statusCode == 200) { console.log(body); } else{ console.log(body); } } request(options, callback);
Curl
curl -X GET 'http://domain/api/adtools/types' -H "api-key: 44b5498dbcb481a0d00b404c0169af62" -H "api-username: tmm1phrvezsbu"