This section provides an overview of how to use Pulsetracker's HTTP API to manage user applications effectively.
Authentication: Bearer Token
All requests to the API require authentication via a Bearer Token. This token ensures secure communication and authorization for the requested actions.
Include your token in the Authorization
header when making API requests:
Example: Authorization: Bearer 123
Get user applications
GET https://www.pulsestracker.com/api/apps
Get current user created apps paginated by 12 per page
Query parameters :
page : int , Default 1
Example request:
const url = 'https://www.pulsestracker.com/api/apps';
const options = {
method: 'GET',
headers: {Accept: 'application/json', Authorization: 'Bearer 123'}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Example response :
{
"data": [
{
"key": "string",
"name": "string",
"quota": [
{
"year": 0,
"month": 0,
"messages_sent": 0
}
],
"devices_count": 0,
"created_at": "2019-08-24T14:15:22Z"
}
],
"meta": {
"current_page": 0,
"from": 0,
"last_page": 0,
"links": [
{
"url": "string",
"label": "string",
"active": true
}
],
"path": "string",
"per_page": 0,
"to": 0,
"total": 0
},
"links": {
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
Or by key :
const url = 'https://www.pulsestracker.com/api/apps/{id}';
const options = {
method: 'GET',
headers: {Accept: 'application/json', Authorization: 'Bearer 123'}
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
{
"data": {
"key": "string",
"name": "string",
"quota": [
{
"year": 0,
"month": 0,
"messages_sent": 0
}
],
"devices_count": 0,
"created_at": "2019-08-24T14:15:22Z"
}
}
Creating new application
POST https://www.pulsestracker.com/api/apps
This endpoint allows you to create a new application for a user. Ensure that your request contains the required fields and valid values. Authentication is mandatory, and your Authorization
header must include a valid Bearer Token.
Quota Limit: If you exceed the maximum number of applications allowed for your account, the server will return a 403 Forbidden error.
Validation Errors: If any required fields are missing or invalid, the server will return a 422 Unprocessable Entity error.
Example request
const url = 'https://www.pulsestracker.com/api/apps';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
Authorization: 'Bearer 123'
},
body: '{"name":"string"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Example response
{
"data": {
"key": "string",
"name": "string",
"quota": [
{
"year": 0,
"month": 0,
"messages_sent": 0
}
],
"devices_count": 0,
"created_at": "2019-08-24T14:15:22Z"
}
}
Updating application name
PUT https://www.pulsestracker.com/api/apps/{id}
Example request
const url = 'https://www.pulsestracker.com/api/apps/{id}';
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
Authorization: 'Bearer 123'
},
body: '{"name":"string"}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
Example response
"string of name"