Contrib API Documentation

Add leads to a domain

Method

POST

URL

https://e7lq80c199.execute-api.us-west-2.amazonaws.com/api1?

Making a Request

Available post request parameters are (param should be ):
  • request — addLeads
  • key — api key
  • domain — domain name (should be in contrib/vnoc system).
  • email — User email (required).
  • ip_address — User ip address (optional)

  • Sample Request

    private function createApiCall($url, $method, $headers, $data = array(),$user=null,$pass=null)
    {
    if (($method == 'PUT') || ($method=='DELETE'))
    {
    $headers[] = 'X-HTTP-Method-Override: '.$method;
    }

    $handle = curl_init();
    curl_setopt($handle, CURLOPT_URL, $url);
    curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
    if ($user){
    curl_setopt($handle, CURLOPT_USERPWD, $user.':'.$pass);
    }

    switch($method)
    {
    case 'GET':
    break;
    case 'POST':
    curl_setopt($handle, CURLOPT_POST, true);
    curl_setopt($handle, CURLOPT_POSTFIELDS, json_encode($data));
    break;
    case 'PUT':
    curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'PUT');
    curl_setopt($handle, CURLOPT_POSTFIELDS, http_build_query($data));
    break;
    case 'DELETE':
    curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE');
    break;
    }
    $response = curl_exec($handle);
    return $response;
    }


    $headers = array('Accept: application/json');
    $url = 'https://e7lq80c199.execute-api.us-west-2.amazonaws.com/api1';
    $params = array('request'=>'addLeads','key'=>'xxxxxxxxxxxxxxxxxxxx',
    'domain'=>'yourdomain.com','email'=>'[email protected]',
    'ip_address'=>'110.0.0.0');
    $result = $this->createApiCall($url, 'POST', $headers, $params);

API Responses

sample json data:
{
"success": true,
"data": {
"id": 920791
}
}


  • Id — Lead Id.

API Errors

{"error":"Email is required"}
{"error":"Api key is required"}
{"error":"Domain is required"}
{"error":"Domain does not exist"}
{"error":"Invalid api key"}
{"error":"Email exists"}