MENU navbar-image

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
}
 

Request      

GET api/healthcheck

Headers

Accept      

Example: application/json

Authorization      

Example: Bearer {key}

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."
}
 

Request      

POST api/v1/{session_uuid}/send-message

Headers

Authorization      

Example: Bearer {key}

Accept      

Example: application/json

Content-Type      

Example: application/json

URL Parameters

session_uuid   string   

The session from your dashboard. Example: ffd7f83e-06c3-47c8-a6a1-dd943da13b5f

Body Parameters

mobile   numbers   

The mobile number to send message with country code. Example: 919999999999

message   string   

The message string. Example: Hello buddy

image   string   

The image should be base64 string without mime prefix. Example: iVBORw0KGgoAAA...

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."
}
 

Request      

POST api/v1/{session_uuid}/send-file

Headers

Accept      

Example: application/json

Authorization      

Example: Bearer {key}

Content-Type      

Example: application/json

URL Parameters

session_uuid   string   

Example: 92ab68b7-ca03-3f5e-aece-4b1326030ae5

Body Parameters

mobile   string   

Example: ea

file   string   

Example: magnam