You can use this request to reactivate a suspended customer.
Your method must be structured as follows:
You must include the following parameter for this request to work:
|$id||integer||ID of the customer to unsuspend.||none||yes|
// unsuspend customer
$url = ')Your URL)/api/2.0/customers/unsuspend/:id';
$method = 'POST';
$cSession = curl_init();
$headers = array();
$auth = base64_encode($username . ':' . $apikey);
$headers = 'Authorization: Basic ' . $auth;
curl_setopt($cSession, CURLOPT_URL, $url);
curl_setopt($cSession, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cSession, CURLOPT_HEADER, false);
curl_setopt($cSession, CURLOPT_CUSTOMREQUEST, strtoupper($method));
$headers = 'Content-Type: application/json';
curl_setopt($cSession, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($cSession);
The rest of this document describes the example above, step-by-step.
In our Getting Started section we covered the four important components of an API request; URL, method, headers, and body.
Let's analyse the code sample above to determine where each line fits into this outline.
The following line of code tells the server which API URL to access for the request:
Your URL is the URL of your Everlytic installation.
In this line of code, you tell the API which REST function to use:
cURL is a tool for sending and receiving files from a web server. This line of code initialises the cURL session.
This section of the code opens the headers section and passes the authentication (including your API key).
These lines of code tell the server that we're using cURL to transfer data.