Quick start
Get an access token
To get an access token, go to Settings - API
Note
Keep in mind: you need access rights to the API section. Each generated token is stored in a special registry. If something goes wrong, you can turn the token off at any time, and all traffic using it will be stopped.
Authentication method
Bearer Token ⚡️ Content-Type : application/json
cURL
PHP
Node (Request)
TypeScript
--header 'Authorization: Bearer XXXXXXX.XXXXXXXX.XXXXXXX'
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer XXXXXXX.XXXXXX.XXXXXXXXX'
)
'headers': {
'Authorization': 'Bearer XXXXXXX.XXXXXXX.XXXXXXX'
}
// Some code
constructor(private http: HttpClient) { }
// Some code
public GetWelcome() : Observable<any>
{
var token = "XXXXXX.XXXXXX.XXXXXX";
return this.http.get("https://do.workzeal.com/welcome",
{ headers:
{"Authorization" : `Bearer ${token}`}
});
}
First request and first response
Note
Note: to test requests, you can use Postman or any other API tool you prefer
To begin, let's get the Welcome! response ⚡️This request must contain the authorization token
Welcome!
GET https://do.workzeal.com/welcome/
Headers
| Name | Type | Description |
|---|---|---|
| Content-Type | String | application/json |
| Authorization* | String | Bearer XXXXX.XXXXX.XXXXX |
200: OK Standard response object inside
401: Unauthorized Authorization error
{
"status": "success",
"error": null,
"code": null,
"rows": 1,
"pages": 1,
"page": 1,
"value": "Welcome! And let's continue: /"
}
{
// Response
}
cURL
PHP
Node (Request)
TypeScript
curl --location --request GET 'https://do.workzeal.com/welcome/first' \
--header 'Authorization: Bearer XXXXXXX.XXXXXXX.XXXXXX'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://do.workzeal.com/welcome/first',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer XXXXXX.XXXXXXX.XXXXXX'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://do.workzeal.com/welcome/first',
'headers': {
'Authorization': 'Bearer XXXXXX.XXXXXXX.XXXXXX'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
// Some code
constructor(private http: HttpClient) { }
// Some code
public GetWelcome() : Observable<any>
{
var token = "XXXXXX-XXXXX-XXXXX";
return this.http.get("https://do.workzeal.com/welcome/first",
{ headers:
{"Authorization" : `Bearer ${token}`}
});
}
Response object
{
"status": "success",
"error": null,
"code": null,
"rows": 1,
"pages": 1,
"page": 1,
"value": "Welcome! And let's continue: /"
}
// status - execution status [success] [error]
// error - error text, if any
// code - error code, if any
// rows - number of rows
// pages - number of pages
// page - current page
// value - the requested data, usually in JSON format