Lead Campaign

List Category

get
​

β€Žhttps://<domain>/<api prefix>/<version>/campaign/list/category/
This API endpoint will return a list of campaign categories.
Request
Response
Request
Headers
apikey
required
string
Apikey
Authorization
required
string
Bearer access token
Query Parameters
datesetting
optional
string
Possible values are 'on', 'before', and 'after'
dateon
optional
string
Required if datesetting is provided, formate mm/dd/yyyy
offset
optional
string
​
limit
optional
string
​
name
optional
string
Category name
Response
200: OK
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

Status Code

Error Type

FIeld

Description

400

Validation Error

datesetting

Inavalid date settings.

400

dateon

dateon

Invalid date formate...etc

List Campaign

get
​

β€Žhttps://<domain>/<api prefix>/<version>/campaign/list/
This API endpoint will return a list of lead campaigns.
Request
Response
Request
Headers
apikey
required
string
Aapikey
Authorization
required
string
Bearer access token
Query Parameters
datesetting
optional
string
Possible values are on, before, and after
dateon
optional
string
Required if datesetting is provided, formate mm/dd/yyyy
offset
optional
string
​
linit
optional
string
​
title
optional
string
Campaign title
category
optional
string
Category name
user
optional
string
user name
Response
200: OK
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

Status Code

Error Type

FIeld

Description

400

Validation Error

datesetting

Inavalid date settings.

400

dateon

dateon

Invalid date formate...etc

List Campaign Pages

get
​

β€Žhttps://<domain>/<api prefix>/<version>/campaign/list/pages/
This API endpoint will return a list of pages under a campaign.
Request
Response
Request
Headers
apikey
required
string
Apikey
Authorization
required
string
Bearer access token
Query Parameters
campaign_slug
required
string
Slug of the campaign.
offset
optional
string
​
limit
optional
string
​
datesetting
optional
string
Possible values are on, before, and after.
dateon
optional
string
Required if datesetting is provided. formate is mm/dd/yyyy
title
optional
string
Page title
user
optional
string
user
Response
200: OK
​
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

Status Code

Error Type

FIeld

Description

400

Validation Error

campaign_slug

Campaign slug is required.

400

Validation Error

datesetting

Inavalid date settings.

400

Validation Error

dateon

Invalid date formate...etc