Security & Authentication
The endpoints use a Supplier ID and an API key to allow access. You can obtain your Supplier ID and API key by reaching out to Cherries.
To authenticate, include both the Supplier ID and the API key in the headers of the request. Content type should be JSON.
You can test just the authentication by using our private "hello world" endpoint:
OR
Please see the code example below.
curl -X POST "https://grabcherries.com/api/s/hello_private" \
-H "Supplier-ID: your_supplier_id" \
-H "Private-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"example_param": "example_value"
}'import requests
url = 'https://grabcherries.com/api/s/hello_private'
headers = {
'Supplier-ID': 'your_supplier_id',
'Private-Key': 'your_api_key',
}
data = {
'example_param': 'example_value',
}
response = requests.post(url, headers=headers, json=data)
print(response.status_code)
print(response.json())<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$url = 'https://grabcherries.com/api/s/hello_private';
$headers = [
'Supplier-ID' => 'your_supplier_id',
'Private-Key' => 'your_api_key',
];
$data = [
'example_param' => 'example_value',
];
try {
$response = $client->post($url, [
'headers' => $headers,
'json' => $data
]);
echo 'Response Code: ' . $response->getStatusCode() . PHP_EOL;
echo 'Response Data: ' . $response->getBody() . PHP_EOL;
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage() . PHP_EOL;
}
?>Updated 10 months ago
