How does it work

If you are not a developer, read this article, it will make it much easier to use API 2.0.

You can create contacts and / or add them to groups by making a request to the service API programmatically. This method is similar to addupdatelead and is a simplified version of it.

The request is sent by the POST method in the URLencode format to the address: https://username.justclick.io/api/addleadtolist, where username is the user’s login in the system and his 3rd level domain in the JustClick service.

In response to the request, your system will receive the function execution result in JSON format. For example, like this:

{"error_code":0,"error_text":"OK","result":[],"hash":"******************************"}

For more details, see the article “Service API Responses“.

Parameters passed in the request

The request parameters are as follows, the required parameter is “rps_key” – your API key:

  • rpsKey – API key; the key for your account is in the “Integration and API” section, the link to the section is in the footer of your personal account or here /shops/setts/apisettings/
  • lead_email – contact email (if not specified, it will be created without email); string
  • add_to_lists – which groups to add the contact to; string, group (s) IDs are indicated, separated by commas (group editing => API tab, for example 1473249885.2899961004)

Пример на PHP (cURL)

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://username.justclick.io/api/addleadtolist', //your username
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => 'rpsKey={Your API key}&lead_email={lead email}&add_to_lists={list the groups in the format indicated in the description}',
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/x-www-form-urlencoded'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>

Rate article

1 star2 stars3 stars4 stars5 stars (No votes)
Loading...