Usage of the API [code]

the AUTOLOGIN process meant to receive form information by POST method and register the lead to the CRM, as well as register user onto the platform, and redirect user with auto login.

to follow the lead status, you use the API (GET LEADS BY DATE / BY ID) to get the statuses of all your leads by the source_id field you have from onboarding.

the API, and the AUTOLOGIN are separated processes.

Auto login uses: username, password, email, source_id and name as mandatory fields.
the email field will be setup as username to the platform cause the login is by email.
username, and name are for CRM and PLATFORM use, and also have to be provided.

Available commands of the API are described below, along with their responses.

For this example, we will use a dummy token and a random command.

Let’s say your new token is jEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztX and that you need to list all available customers, using the API, through a cURL request.

Command Request


curl -H "authtoken: jEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztXjEheVytlAoFl7F8MqUQ7jAo2hOXASztX" https://mysite.com/api/customers



Response of command request


[
   {
      "stripe_id" : null,
      "active" : "1",
      "vat" : "1234567890",
      "address" : "Test Address",
      "billing_country" : "0",
      "phonenumber" : "1234567890",
      "registration_confirmed" : "1",
      "longitude" : null,
      "billing_city" : "",
      "state" : "Test State",
      "shipping_zip" : "",
      "billing_zip" : "",
      "city" : "Test City",
      "shipping_country" : "0",
      "billing_street" : "",
      "datecreated" : "2019-11-29 12:34:56",
      "company" : "Jk Technologies",
      "shipping_street" : "",
      "zip" : "123456",
      "billing_state" : "",
      "leadid" : null,
      "addedfrom" : "8",
      "userid" : "3",
      "default_language" : "english",
      "shipping_state" : "",
      "show_primary_contact" : "0",
      "country" : "102",
      "default_currency" : "3",
      "shipping_city" : "",
      "latitude" : null,
      "website" : "https://example.com"
   },
   {
      "website" : "https://example2.com",
      "latitude" : null,
      "default_currency" : "0",
      "shipping_city" : "London",
      "country" : "235",
      "show_primary_contact" : "0",
      "shipping_state" : "Greater London",
      "default_language" : "",
      "addedfrom" : "1",
      "userid" : "1",
      "leadid" : null,
      "billing_state" : "Greater London",
      "zip" : "WC1 ASW",
      "shipping_street" : "123 Road Street",
      "company" : "Sample Company LTD",
      "datecreated" : "2019-04-02 13:38:28",
      "billing_street" : "123 Road Street",
      "shipping_country" : "235",
      "city" : "London",
      "billing_zip" : "WC1 ASW",
      "shipping_zip" : "WC1 ASW",
      "longitude" : null,
      "registration_confirmed" : "1",
      "billing_city" : "London",
      "state" : "Greater London",
      "phonenumber" : "+44 210 7298299",
      "billing_country" : "235",
      "address" : "123 Road Street",
      "vat" : "123456789",
      "active" : "1",
      "stripe_id" : null
   }
]

Did you find this article useful?