Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by visiting your profile and clicking Generate API key.
Endpoints
Healthcheck
Check that the service is up. If everything is okay, you'll get a 200 OK response.
Otherwise, the request will fail with a 400 error, and a response listing the failed services.
Example request:
curl --request GET \
--get "http://klik.social/api/healthcheck" \
--header "Accept: application/json" \
--header "Authorization: Bearer {key}"
const url = new URL(
"http://klik.social/api/healthcheck"
);
const headers = {
"Accept": "application/json",
"Authorization": "Bearer {key}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://klik.social/api/healthcheck';
$response = $client->get(
$url,
[
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer {key}',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
strict-transport-security: max-age=31536000; includeSubdomains
access-control-allow-origin: *
{
"status": true
}
Example response (400, Service is unhealthy):
{
"status": false
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Response
Response Fields
status
boolean
The status of this API (true or false).
POST api/v1/{session_uuid}/send-message
requires authentication
Example request:
curl --request POST \
"http://klik.social/api/v1/ffd7f83e-06c3-47c8-a6a1-dd943da13b5f/send-message" \
--header "Authorization: Bearer {key}" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data "{
\"mobile\": \"919999999999\",
\"message\": \"Hello buddy\",
\"image\": \"iVBORw0KGgoAAA...\"
}"
const url = new URL(
"http://klik.social/api/v1/ffd7f83e-06c3-47c8-a6a1-dd943da13b5f/send-message"
);
const headers = {
"Authorization": "Bearer {key}",
"Accept": "application/json",
"Content-Type": "application/json",
};
let body = {
"mobile": "919999999999",
"message": "Hello buddy",
"image": "iVBORw0KGgoAAA..."
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://klik.social/api/v1/ffd7f83e-06c3-47c8-a6a1-dd943da13b5f/send-message';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {key}',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'mobile' => '919999999999',
'message' => 'Hello buddy',
'image' => 'iVBORw0KGgoAAA...',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200, success):
{
"success": true,
"data": null,
"message": "Message sent successfully."
}
Example response (200, failed):
{
"success": false,
"errors": [],
"message": "Session is not logged in."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/{session_uuid}/send-file
Example request:
curl --request POST \
"http://klik.social/api/v1/92ab68b7-ca03-3f5e-aece-4b1326030ae5/send-file" \
--header "Accept: application/json" \
--header "Authorization: Bearer {key}" \
--header "Content-Type: application/json" \
--data "{
\"mobile\": \"ea\",
\"file\": \"magnam\"
}"
const url = new URL(
"http://klik.social/api/v1/92ab68b7-ca03-3f5e-aece-4b1326030ae5/send-file"
);
const headers = {
"Accept": "application/json",
"Authorization": "Bearer {key}",
"Content-Type": "application/json",
};
let body = {
"mobile": "ea",
"file": "magnam"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$url = 'http://klik.social/api/v1/92ab68b7-ca03-3f5e-aece-4b1326030ae5/send-file';
$response = $client->post(
$url,
[
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer {key}',
'Content-Type' => 'application/json',
],
'json' => [
'mobile' => 'ea',
'file' => 'magnam',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
strict-transport-security: max-age=31536000; includeSubdomains
access-control-allow-origin: *
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.