Skip to content

API knowledge base

Setup and usage

Our WEB API, JAVASCRIPT API or PHP provides a collection of methods that underpin most of Bechat Cloud's functions. To get started using the Web API, follow the tutorial below.



Make a POST call to the file include/api.php of your Support Board installation. You can use the following code to make the calls:

PHP function support_board_api($query) {
    $ch = curl_init('YOUR-DOMAIN/supportboard/include/api.php');
    $parameters = [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_USERAGENT => 'Support Board',
            CURLOPT_POST => true,
            CURLOPT_POSTFIELDS => http_build_query(array_merge(['token' => 'YOUR-TOKEN'], $query))
    curl_setopt_array($ch, $parameters); 
    $response = curl_exec($ch);
    return json_decode($response, true);
JQUERY Warning! This function is not secure because .js files are accessible by anyone. Make sure this code is only available to the correct user.
$.post('YOUR-DOMAIN/supportboard/include/api.php', {
    function: 'METHOD-NAME',
    token: 'YOUR-TOKEN'
}, function (response) {
    response = JSON.parse(response);
    if (response.success) {
The variable $response will contains the JSON response. You can add new arguments in the query array: ['token' => '', 'function' => '', 'argument-name' => 'value', ...].


Replace the following strings with the correct values:

Replace YOUR-DOMAIN with the URL of your website. The full URL must point to the file include/api.php of your Support Board installation. It should looks like this: (if you're using the WordPress version: If you're using the cloud version:

Replace YOUR-TOKEN with the token of an admin user. You can get the token from the Users area by opening the profile box of an admin user. Only admin tokens are supported and only the admins can view the tokens. If you're using the cloud version you have to use the token from Account > Installation > API token.
Warning! This token must be kept always secret.

Replace METHOD-NAME with the name of the API function you want to use. Get them from the methods list below.

Some functions are protected for security reasons, enter the code $GLOBALS['SB_FORCE_ADMIN'] = true before calling the function to execute it correctly. Enter the code $GLOBALS['SB_FORCE_ADMIN'] = false immedidately after the function call for security reasons.

Some functions require the user details of the active user, use the code $GLOBALS['SB_LOGIN'] = ['id' => '', 'first_name' => '', 'last_name' => '', 'email' => '', 'user_type' => '', 'department' => '']; to set the active user.

Postman example: 



Methods to manage users, agents, and admins.


Returns the user details of a user.