Lead Campaign

List Category

GET ‎https://<domain>/<api prefix>/<version>/campaign/list/category/

This API endpoint will return a list of campaign categories.

Query Parameters

NameTypeDescription

datesetting

string

Possible values are 'on', 'before', and 'after'

dateon

string

Required if datesetting is provided, formate mm/dd/yyyy

offset

string

limit

string

name

string

Category name

Headers

NameTypeDescription

apikey*

string

Apikey

Authorization*

string

Bearer access token

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.

Query Parameters

NameTypeDescription

datesetting

string

Possible values are on, before, and after

dateon

string

Required if datesetting is provided, formate mm/dd/yyyy

offset

string

linit

string

title

string

Campaign title

category

string

Category name

user

string

user name

Headers

NameTypeDescription

apikey*

string

Aapikey

Authorization*

string

Bearer access token

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.

Query Parameters

NameTypeDescription

campaign_slug

string

Slug of the campaign.

offset

string

limit

string

datesetting

string

Possible values are on, before, and after.

dateon

string

Required if datesetting is provided. formate is mm/dd/yyyy

title

string

Page title

user

string

user

Headers

NameTypeDescription

apikey*

string

Apikey

Authorization*

string

Bearer access token


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

Last updated