Requests

All API accepts application/json content and returns response with application/json as content type.

Base URL

Base or server url for the Sembark APIs is https://api.sembark.com/integrations/v1 and it will be referred as <BASE_URL> throughout the documentation.

Sample Request

Here are some samples codes in different language for your reference.

Info

Your MUST include the Accept header with value as application/json in all your requests.

curl --location --request GET '<BASE_URL>/ping' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <TOKEN_HERE>'
var axios = require("axios");
var config = {
  method: "get",
  url: "<BASE_URL>/ping",
  headers: {
    Accept: "application/json",
    Authorization: "Bearer <TOKEN_HERE>",
  },
};
axios(config)
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
var request = require("request");
var options = {
  method: "GET",
  url: "<BASE_URL>/ping",
  headers: {
    Accept: "application/json",
    Authorization: "Bearer <TOKEN_HERE>",
  },
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => '<BASE_URL>/ping',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_TIMEOUT => 0,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Accept: application/json',
    'Authorization: Bearer <TOKEN_HERE>'
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Share