NAV
cURL Java Go PHP

Introduction

Welcome to the MaaxMarket API! You can use our API to access MaaxMarket API endpoints, which can get information on various leads, campaigns, and many more in our database.

We have language bindings in Shell, GO, Java and PHP! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

  _          _ _             
 | |__   ___| | | ___        
 | '_ \ / _ \ | |/ _ \       
 | | | |  __/ | | (_) |      
 |_| |_|\___|_|_|\___/     _ 
 __      _____  _ __| | __| |
 \ \ /\ / / _ \| '__| |/ _` |
  \ V  V / (_) | |  | | (_| |
   \_/\_/ \___/|_|  |_|\__,_|


Authentication

To authorize, use this code:

Request request = new Request.Builder()
  .url("yourendpoint")
  .post(null)
  .addHeader("maaxmarketapikey", "yourapikey")
  .build();
req, _ := http.NewRequest("APIMethod", endpoint, nil)
req.Header.Add("maaxmarketapikey", "yourapikey")
<?php
$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('yourendpoint');
$request->setRequestMethod('APIMethod');
$request->setHeaders(array(
  'maaxmarketapikey' => 'yourapikey'
));
?>
# With shell, you can just pass the correct header with each request
curl -X GET -H "maaxmarketapikey: yourapikey" 
  "yourendpoint"

Make sure to replace yourapikey with your API key.

MaaxMarket uses API keys to allow access to the API. You can create your own API key from your MaaxMarket account by going through “Settings/API” page.

MaaxMarket expects for the API key to be included in all API requests to the server in a header that looks like the following:

maaxmarketapikey: yourapikey

Leads

Get All Leads

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://api.maaxmarket.com/leads")
  .get()
  .addHeader("maaxmarketapikey", "yourapikey")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "http://api.maaxmarket.com/leads"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("maaxmarketapikey", "yourapikey")
  req.Header.Add("cache-control", "no-cache")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}
curl -X GET -H "maaxmarketapikey: yourapikey" 
  "http://api.maaxmarket.com/leads"
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('http://api.maaxmarket.com/leads');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'maaxmarketapikey' => 'yourapikey'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
?>

The above command returns JSON structured like this:

{
  "list_id": 1,
  "leads": [
    {
      "company_phone": "",
      "owner": 1,
      "contact_phone": "",
      "company_website": "",
      "last_name": "Sivanandham",
      "source": 0,
      "company_fax": "",
      "contact_id": 1,
      "title": "0",
      "company_mobile": "",
      "contact_email": "thileepan@maaxmarket.com",
      "company_name": "Maax Market Inc",
      "contact_mobile": "",
      "first_name": "Thileepan",
      "lead_id": 1
    },
    {
      "company_phone": "",
      "owner": 1,
      "contact_phone": "",
      "company_website": "",
      "last_name": "Sivanandham",
      "source": 0,
      "company_fax": "",
      "contact_id": 2,
      "title": "0",
      "company_mobile": "",
      "contact_email": "sktgthill@gmail.com",
      "company_name": "Maax Market Inc",
      "contact_mobile": "",
      "first_name": "Thileepan",
      "lead_id": 2
    },
    {
      "company_phone": "",
      "owner": 1,
      "contact_phone": "",
      "company_website": "",
      "last_name": "sivanandham",
      "source": 0,
      "company_fax": "",
      "contact_id": 4,
      "title": "0",
      "company_mobile": "",
      "contact_email": "thileepan@maaxmarket.com",
      "company_name": "testcom",
      "contact_mobile": "",
      "first_name": "thileepan",
      "lead_id": 4
    },
    {
      "company_phone": "",
      "owner": 1,
      "contact_phone": "",
      "company_website": "",
      "last_name": "sivanandham",
      "source": 0,
      "company_fax": "",
      "contact_id": 5,
      "title": "0",
      "company_mobile": "",
      "contact_email": "thileepan@maaxmarket.com",
      "company_name": "TestCompany",
      "contact_mobile": "",
      "first_name": "thileepan",
      "lead_id": 5
    }
  ],
  "total_records": 4,
  "current_page": 1,
  "no_of_pages": 1
}

This endpoint retrieves all leads.

Method

GET

HTTP Request

GET http://api.maaxmarket.com/leads

Query Parameters

Parameter Default Description
list_id (Optional) 1 If set to 1, the result will include all contacts
records_per_page (Optional) 100 It will get 100 leads per page
current_page (Optional) 1 It will get the first page data

Get Lead Detail

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://api.maaxmarket.com/leads/4")
  .get()
  .addHeader("maaxmarketapikey", "yourapikey")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "http://api.maaxmarket.com/leads/4"

  req, _ := http.NewRequest("GET", url, nil)

  req.Header.Add("maaxmarketapikey", "yourapikey")
  req.Header.Add("cache-control", "no-cache")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
curl -X GET -H "maaxmarketapikey: yourapikey" 
  "http://api.maaxmarket.com/leads/4"
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('http://api.maaxmarket.com/leads/4');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'maaxmarketapikey' => 'yourapikey'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
?>

The above command returns JSON structured like this:

{
  "listdetail": [],
  "lead": {
    "company_phone": "",
    "country": 0,
    "contact_facebook": "",
    "contact_phone": "",
    "city": "",
    "contact_twitter": "",
    "company_website": "",
    "company_email": "testcompany@gmail.com",
    "source": 0,
    "contact_id": 4,
    "title": 0,
    "company_mobile": "",
    "contact_email": "thileepan@maaxmarket.com",
    "company_facebook": "",
    "state": "",
    "first_name": "thileepan",
    "lead_id": 4,
    "owner": 1,
    "address2": "",
    "address1": "",
    "last_name": "sivanandham",
    "company_fax": "",
    "zipcode": "",
    "company_name": "testcom",
    "company_twitter": "",
    "contact_mobile": ""
  }
}

This endpoint retrieves a specific lead detailed information.

Method

GET

HTTP Request

GET http://api.maaxmarket.com/leads/<ID>

URL Parameters

Parameter Description
ID The ID of the lead to retrieve

Create Lead

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://api.maaxmarket.com/leads?company_name=TestCompany&company_email=testcompany%40gmail.com&last_name=sivanandham&first_name=thileepan")
  .post(null)
  .addHeader("maaxmarketapikey", "yourapikey")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "http://api.maaxmarket.com/leads?company_name=TestCompany&company_email=testcompany%40gmail.com&last_name=sivanandham&first_name=thileepan"

  req, _ := http.NewRequest("POST", url, nil)

  req.Header.Add("maaxmarketapikey", "yourapikey")
  req.Header.Add("cache-control", "no-cache")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}
curl -X GET -H "maaxmarketapikey: yourapikey" 
  "http://api.maaxmarket.com/leads?company_name=TestCompany&company_email=testcompany@gmail.com&last_name=sivanandham&first_name=thileepan"
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('http://api.maaxmarket.com/leads');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString(array(
  'company_name' => 'TestCompany',
  'company_email' => 'testcompany@gmail.com',
  'last_name' => 'sivanandham',
  'first_name' => 'thileepan'
)));

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'maaxmarketapikey' => 'yourapikey'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
?>

The above command returns JSON structured like this:

{
  "message": "Lead has been created successfully!",
  "contact_id": 6,
  "lead_id": 6,
  "status": 1
}

This endpoint creates new Lead.

Method

POST

HTTP Request

POST http://api.maaxmarket.com/leads

URL Parameters

Parameter Description
first_name (Required) Contact first name
last_name (Required) Contact last name
contact_email (Required) Email address of the contact
company_name Name of the company
company_email Company Email address
address1 Address line 1
address2 Address line 2
city City
state State
country Country
company_mobile Company mobile number
company_phone Company phone number
company_fax Company fax
website Company website address
company_twitter Company twitter account
company_facebook Company facebook account
list_id Id of the list if you want to add this lead into any specific email list
title Title of the contact person
position Contact person position
contact_mobile Contact person mobile number
contact_phone Contact person phone number
contact_twitter Contact person twitter account
contact_facebook Contact person facebook account

Update Lead

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://api.maaxmarket.com/leads/4?company_name=testcom")
  .put(null)
  .addHeader("maaxmarketapikey", "4a9d0d50a5fdb1a93a210ce7e61fc403")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "http://api.maaxmarket.com/leads/4?company_name=testcom"

  req, _ := http.NewRequest("PUT", url, nil)

  req.Header.Add("maaxmarketapikey", "yourapikey")
  req.Header.Add("cache-control", "no-cache")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}
curl -X GET -H "maaxmarketapikey: yourapikey" 
  "http://api.maaxmarket.com/leads/4?company_name=testcom"
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('http://api.maaxmarket.com/leads/4');
$request->setRequestMethod('PUT');
$request->setQuery(new http\QueryString(array(
  'company_name' => 'testcom'
)));

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'maaxmarketapikey' => 'yourapikey'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
?>

The above command returns JSON structured like this:

{
  "message": "Lead has been updated successfully!",
  "contact_id": 4,
  "lead_id": 4,
  "status": 1
}

This endpoint update the existing contact

Method

PUT

HTTP Request

PUT http://api.maaxmarket.com/leads/<ID>

URL Parameters

Parameter Description
ID (Required) The ID of the lead to retrieve
first_name Contact first name
last_name Contact last name
contact_email Email address of the contact
company_name Name of the company
company_email Company Email address
address1 Address line 1
address2 Address line 2
city City
state State
country Country
company_mobile Company mobile number
company_phone Company phone number
company_fax Company fax
website Company website address
company_twitter Company twitter account
company_facebook Company facebook account
list_id Id of the list if you want to add this lead into any specific email list
title Title of the contact person
position Contact person position
contact_mobile Contact person mobile number
contact_phone Contact person phone number
contact_twitter Contact person twitter account
contact_facebook Contact person facebook account

Create List

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://api.maaxmarket.com/lists?name=MyList&sender_name=Sivanandham%20Thileepan&sender_email=sktgrthill%40gmail.com")
  .post(null)
  .addHeader("maaxmarketapikey", "yourapikey")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "http://api.maaxmarket.com/lists?name=MyList&sender_name=Sivanandham%20Thileepan&sender_email=sktgrthill%40gmail.com"

  req, _ := http.NewRequest("POST", url, nil)

  req.Header.Add("maaxmarketapikey", "yourapikey")
  req.Header.Add("cache-control", "no-cache")

  res, _ := http.DefaultClient.Do(req)

  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))

}
curl -X GET -H "maaxmarketapikey: yourapikey" 
  "http://api.maaxmarket.com/lists?name=MyList&sender_name=Sivanandham Thileepan&sender_email=sktgrthill@gmail.com"
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('http://api.maaxmarket.com/lists');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString(array(
  'name' => 'MyList',
  'sender_name' => 'Sivanandham Thileepan',
  'sender_email' => 'sktgrthill@gmail.com'
)));

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'maaxmarketapikey' => 'yourapikey'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
?>

The above command returns JSON structured like this:

{
  "list_id": 3,
  "message": "List has been created successfully!",
  "status": 1
}

This endpoint creates a new recipient list.

Method

POST

HTTP Request

POST http://api.maaxmarket.com/lists

URL Parameters

Parameter Description
name (Required) Name of the list
sender_name Defaut sender name to use in email campaign for this list
sender_email Defaut sender email to use in email campaign for this list

Campaigns

Get All Campaigns

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://api.maaxmarket.com/campaigns")
  .get()
  .addHeader("maaxmarketapikey", "yourapikey")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "http://api.maaxmarket.com/campaigns"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("maaxmarketapikey", "yourapikey")
    req.Header.Add("cache-control", "no-cache")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
curl -X GET -H "maaxmarketapikey: yourapikey" 
  "http://api.maaxmarket.com/campaigns"
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('http://api.maaxmarket.com/campaigns');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'maaxmarketapikey' => 'yourapikey'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
?>

The above command returns JSON structured like this:

{
  "campaigns": [
    {
      "unique_click": 0,
      "unique_open": 0,
      "name": "Test Campaign",
      "modified_by": 1,
      "description": "",
      "created_at": 1459461231,
      "modified_at": 1459461231,
      "schedule_date": 1466157600,
      "created_by": 1,
      "total_recipient": 0,
      "campaign_id": 2,
      "status": 1
    }
  ],
  "no_of_pages": 1
}

This endpoint retrieves all campaigns.

Method

GET

HTTP Request

GET http://api.maaxmarket.com/campaigns

Query Parameters

Parameter Default Description
filter_by (Optional) 0 If set to 0, it will get all campaigns
sort_by (Optional) 1 If set to 1, sort by created_date; If set to 2, sort by schedule date;
records_per_page (Optional) 100 It will get 100 leads per page
current_page (Optional) 1 It will get the first page data

Get Campaign Detail

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://api.maaxmarket.com/campaigns/2")
  .get()
  .addHeader("maaxmarketapikey", "yourapikey")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "http://api.maaxmarket.com/campaigns/2"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("maaxmarketapikey", "yourapikey")
    req.Header.Add("cache-control", "no-cache")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
curl -X GET -H "maaxmarketapikey: yourapikey" 
  "http://api.maaxmarket.com/campaigns/2"
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('http://api.maaxmarket.com/campaigns/2');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'maaxmarketapikey' => 'yourapikey'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
?>

The above command returns JSON structured like this:

{
  "campaignDetail": {
    "schedule_type": 2,
    "list_id": 1,
    "schedule_time": 1466157600,
    "subject": "Test Subject",
    "campaign_type": 1,
    "name": "Test Campaign",
    "description": "",
    "sender_name": "Sivanandham Thileepan",
    "template_id": 0,
    "id": 2,
    "content": "<p>Hi *|FNAME|*</p>",
    "sender_email": "sktgrthill@maaxmarket.com"
  }
}

This endpoint retrieves a specific information about an campaign

Method

GET

HTTP Request

GET http://api.maaxmarket.com/campaigns/<ID>

URL Parameters

Parameter Description
ID The ID of the campaign to retrieve

Get Campaign Analytics

OkHttpClient client = new OkHttpClient();

Request request = new Request.Builder()
  .url("http://api.maaxmarket.com/campaigns/2/analytics")
  .get()
  .addHeader("maaxmarketapikey", "yourapikey")
  .addHeader("cache-control", "no-cache")
  .build();

Response response = client.newCall(request).execute();
package main

import (
    "fmt"
    "net/http"
    "io/ioutil"
)

func main() {

    url := "http://api.maaxmarket.com/campaigns/2/analytics"

    req, _ := http.NewRequest("GET", url, nil)

    req.Header.Add("maaxmarketapikey", "yourapikey")
    req.Header.Add("cache-control", "no-cache")

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := ioutil.ReadAll(res.Body)

    fmt.Println(res)
    fmt.Println(string(body))

}
curl -X GET -H "maaxmarketapikey: yourapikey" 
  "http://api.maaxmarket.com/campaigns/2/analytics"
<?php

$client = new http\Client;
$request = new http\Client\Request;

$request->setRequestUrl('http://api.maaxmarket.com/campaigns/2/analytics');
$request->setRequestMethod('GET');
$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'maaxmarketapikey' => 'yourapikey'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();
?>

The above command returns JSON structured like this:

{
  "ctr": 0,
  "deferred": 0,
  "sent_rate": 0,
  "total_contact": 0,
  "bounce": 0,
  "delivered_rate": 0,
  "deferred_rate": 0,
  "dropped": 0,
  "bounce_rate": 0,
  "delivered": 0,
  "sent": 0,
  "dropped_rate": 0,
  "unique_click": 0,
  "unique_open_rate": 0,
  "unsubscribe_rate": 0,
  "unique_open": 0,
  "unsubscribe": 0,
  "total_open": 0,
  "spam_rate": 0,
  "campaign": {
    "schedule_type": 2,
    "list_id": 1,
    "schedule_time": 1466157600,
    "subject": "Test Subject",
    "campaign_type": 1,
    "name": "Test Campaign",
    "description": "",
    "sender_name": "Sivanandham Thileepan",
    "template_id": 0,
    "id": 2,
    "content": "<p>Hi *|FNAME|*</p>",
    "sender_email": "sktgrthill@maaxmarket.com"
  },
  "spam": 0,
  "total_click": 0,
  "unique_click_rate": 0
}

This endpoint retrieves campaign analytics data

Method

GET

HTTP Request

GET http://api.maaxmarket.com/campaigns/<ID>/analytics

URL Parameters

Parameter Description
ID The ID of the campaign to retrieve

Errors

The MaaxMarket API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your API key is wrong
404 Not Found – Some required parameters are missing in the request
405 Method Not Allowed – You tried to access a MaaxMarket with an invalid method
429 Too Many Requests – You’re requesting too many request! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarially offline for maintanance. Please try again later.