List Category
GET
‎https://<domain>/<api prefix>/<version>/campaign/list/category/
This API endpoint will return a list of campaign categories.
Query Parameters
HTTP/1.1 200 OK
Content-Type: application/json
Body:
{
"status_code": 200,
"errors": {},
"data": {
"results": [
{
"id": <id>,
"category": "<category_name>",
"description": "<category_description>",
"slug": "<category_slug>"
}
...
],
"count": <list_count>,
"previous": <previous_page_url>,
"next": <next_page_url>
}
}
Sample Code
Node
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://<domain>/<api prefix>/<version>/campaign/list/category/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>',
},
formData: { }
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/campaign/list/category/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Error Responses
List Campaign
GET
‎https://<domain>/<api prefix>/<version>/campaign/list/
This API endpoint will return a list of lead campaigns.
Query Parameters
HTTP/1.1 200 OK
Content-Type: application/json
Body:
{
"status_code": 200,
"errors": {},
"data": {
"results": [
{
"id": <campaign_id>,
"campaign": "<campaign_title>",
"description": "<description>",
"slug": "<slug>",
"created": "<created>",
"campaign_image": "<campaign_image>"
},
],
"count": <list_count>,
"previous": <previous_page_url>,
"next": <next_page_url>
}
}
Sample Code
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/campaign/list/campaign/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Node
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://<domain>/<api prefix>/<version>/campaign/list/campaign/',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>',
},
formData: {}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
Error Responses
List Campaign Pages
GET
‎https://<domain>/<api prefix>/<version>/campaign/list/pages/
This API endpoint will return a list of pages under a campaign.
Query Parameters
HTTP/1.1 200 OK
Content-Type: application/json
Body:
{
"status_code": 200,
"errors": {},
"data": {
"results": [
{
"id": <id>,
"slug": "<slug>",
"title": "<title>",
"description": "<description>"
"body": "<body>",
"image": "<image>",
"created": "<created>",
"preview_url": "<page_preview_url>",
"facebooklink": "<facebooke_share_link>",
"twitterlink": "<twitter_share_link>"
}
],
"count": <list_count>,
"previous": <previous_page_url>,
"next": <next_page_url>,
}
}
Sample Code
Node
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://<domain>/<api prefix>/<version>/campaign/list/pages/?campaign_slug=<slug>',
'headers': {
'apikey': '<apikey>',
'Authorization': 'Bearer <access token>',
},
formData: {}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://<domain>/<api prefix>/<version>/campaign/list/pages/?campaign_slug=<slug>',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'apikey: <apikey>',
'Authorization: Bearer <access token>',
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Error Responses