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.
! Undocumented Endpoints
DELETE api/v1/user/delete
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/user/delete"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
set-cookie: stafonline_session=eyJpdiI6IjMyd2pQeXc1aFllRXVKQjJRTVlzMFE9PSIsInZhbHVlIjoiUEtJMFNPYU1VQnI4V1hUMExyU1dyMTVNbTQ3eExlRkJFTEtsbEhYWXFmNzFzd1U3ekpFMVFIdE5DSEZrNDdEdDlVWDVHZ1BwMVBvcVBTd2hJTjZ1ZzhUQzc2MW1rVlh1Ylh4cG5Bb1RrNGJhcVQ0TnY4eVh0dURuRWluUitRV1kiLCJtYWMiOiIxNzVmODhkY2ZjYzYwZTYxZTgwOWVmMDY2OTY0NDAwODEyNGExOTA1N2U0NTUzZDczN2I2MjE2NjYxYjg2OTY1IiwidGFnIjoiIn0%3D; expires=Sun, 19 May 2024 15:48:24 GMT; Max-Age=7200; path=/; httponly; samesite=lax
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/push-notification/send
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/push-notification/send"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Example response (500):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "Server Error"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Auth
This group holds the login/registration related endpoints
Login
The login endpoint
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/auth/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "[email protected]",
"password": "r!\"er,w>=5=CO",
"device_name": "qrjbrwmdfntdwpqopnmwrbyiztszhjkrjujizkockhitbvawhriatgbzweeryhgmnpnfikh",
"device_token": "ejmksytgrmkqjxhnvsseeedqquhtsnctgliepxkfyazqigcckkafqmcdxcgbfiyjxlmecgdbtviawyfz"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, The user was logged and a response was provided):
{
"data": {
"user": {
"id": 2,
"first_name": null,
"last_name": null,
"birthday": null,
"username": null,
"phone_number": null,
"current_position": null,
"current_location": null,
"email": "[email protected]",
"created_at": "2023-09-01T07:07:11.000000Z",
"updated_at": "2023-09-01T07:07:11.000000Z",
"skills": []
},
"access_token": "50|ls_gIH2pSAscNI4OSpaKrGPUp03qGurmtRGbkT7zpff2efad5f4",
"expire_access_token": "2023-09-01T15:02:57.000000Z",
"refresh_token": "51|ls_dPlao62tX5gMKxCYGrxVxk62dSSXSDtmiLwwYgEef0eb02b2",
"expire_refresh_token": "2023-09-08T14:02:57.000000Z",
"token_type": "Bearer"
}
}
Example response (422, Invalid login credentials.):
{
"message": "The email has already been taken. (and 1 more error)",
"errors": {
"email": [
"The email has already been taken."
],
"password": [
"The password field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Logout
The Logout endpoint
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/auth/logout"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"device_token": "axygjxchqaxgemrvbvvpifetoyjptyewgnxvrhaiyfemiydkeerapsfmhlmelxjnjbvzqxknyqdhwclklz"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, The user was logout and a response message success):
{
"message": "Logout success"
}
Example response (422, Invalid login credentials.):
{
"message": "The email has already been taken. (and 1 more error)",
"errors": {
"email": [
"The email has already been taken."
],
"password": [
"The password field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Registration
The registration endpoint
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/auth/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "[email protected]",
"password": "SHlpqgexB{]FSP",
"device_name": "suwwclmeunkfgrfufpchinkgmmpytbwgdvcfdbxjjovfjegxsrtwbegxrcitggoyydcleojao",
"device_token": "bjxtoyaptogyasdxxydkkynkvinfcqs"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, The user was created and a response was provided):
{
"data": {
"user": {
"id": 2,
"first_name": null,
"last_name": null,
"birthday": null,
"username": null,
"phone_number": null,
"current_position": null,
"current_location": null,
"email": "[email protected]",
"created_at": "2023-09-01T07:07:11.000000Z",
"updated_at": "2023-09-01T07:07:11.000000Z",
"skills": []
},
"access_token": "50|ls_gIH2pSAscNI4OSpaKrGPUp03qGurmtRGbkT7zpff2efad5f4",
"expire_access_token": "2023-09-01T15:02:57.000000Z",
"refresh_token": "51|ls_dPlao62tX5gMKxCYGrxVxk62dSSXSDtmiLwwYgEef0eb02b2",
"expire_refresh_token": "2023-09-08T14:02:57.000000Z",
"token_type": "Bearer"
}
}
Example response (422, Invalid registration data.):
{
"message": "The email has already been taken. (and 1 more error)",
"errors": {
"email": [
"The email has already been taken."
],
"password": [
"The password field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Refresh token
Refresh token fill the Auth Bearer with your refresh token
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/auth/refresh-token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Example response (200, The user was logged and a response was provided):
{
"data": {
"user": {
"id": 2,
"first_name": null,
"last_name": null,
"birthday": null,
"username": null,
"phone_number": null,
"current_position": null,
"current_location": null,
"email": "[email protected]",
"created_at": "2023-09-01T07:07:11.000000Z",
"updated_at": "2023-09-01T07:07:11.000000Z",
"skills": []
},
"access_token": "50|ls_gIH2pSAscNI4OSpaKrGPUp03qGurmtRGbkT7zpff2efad5f4",
"expire_access_token": "2023-09-01T15:02:57.000000Z",
"refresh_token": "51|ls_dPlao62tX5gMKxCYGrxVxk62dSSXSDtmiLwwYgEef0eb02b2",
"expire_refresh_token": "2023-09-08T14:02:57.000000Z",
"token_type": "Bearer"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Google Auth
Google Auth Endpoint
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/auth/google"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_token": "jamiobmydpqcqcruqqkhzunujzcdqqjxbzweqbrcncnxiaelpjbnajrkfsb",
"device_name": "jeaptaledmrcbvycnjxwrcrpnkwhpwjzgfgxjycshxrozd",
"device_token": "xndngvdeiwxymqkzbmhbuouoxkaqstjvgpelmuizmwiyuvyzpmhxaryadtsybnx"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, The user was logged and a response was provided):
{
"data": {
"user": {
"id": 2,
"first_name": null,
"last_name": null,
"birthday": null,
"username": null,
"phone_number": null,
"current_position": null,
"current_location": null,
"email": "[email protected]",
"created_at": "2023-09-01T07:07:11.000000Z",
"updated_at": "2023-09-01T07:07:11.000000Z",
"skills": []
},
"access_token": "50|ls_gIH2pSAscNI4OSpaKrGPUp03qGurmtRGbkT7zpff2efad5f4",
"expire_access_token": "2023-09-01T15:02:57.000000Z",
"refresh_token": "51|ls_dPlao62tX5gMKxCYGrxVxk62dSSXSDtmiLwwYgEef0eb02b2",
"expire_refresh_token": "2023-09-08T14:02:57.000000Z",
"token_type": "Bearer"
}
}
Example response (422, Invalid Credentials):
{
"message": "Invalid Credentials"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Facebook Auth
Facebook Auth Endpoint
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/auth/facebook"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_token": "gjfctczhqvqdouabheofofzdjlekpxbmyvuufufcdnmqrxlsklbbjtkvhpwiqmhbpbimpiclgvy",
"device_name": "wgopoyanrsxfwxjstxizqwfvfglhjyoiuowoe",
"device_token": "tlsbdyihyiqbkhmdaotedcfxfomnfsvjrknadlchkdqmwmkvhpdeuukgqvr"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, The user was logged and a response was provided):
{
"data": {
"user": {
"id": 2,
"first_name": null,
"last_name": null,
"birthday": null,
"username": null,
"phone_number": null,
"current_position": null,
"current_location": null,
"email": "[email protected]",
"created_at": "2023-09-01T07:07:11.000000Z",
"updated_at": "2023-09-01T07:07:11.000000Z",
"skills": []
},
"access_token": "50|ls_gIH2pSAscNI4OSpaKrGPUp03qGurmtRGbkT7zpff2efad5f4",
"expire_access_token": "2023-09-01T15:02:57.000000Z",
"refresh_token": "51|ls_dPlao62tX5gMKxCYGrxVxk62dSSXSDtmiLwwYgEef0eb02b2",
"expire_refresh_token": "2023-09-08T14:02:57.000000Z",
"token_type": "Bearer"
}
}
Example response (422, Invalid Credentials):
{
"message": "Invalid Credentials"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Apple Auth
Apple Auth Endpoint
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/auth/apple"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id_token": "anahpwvhumpoxeywvdoqxpxwpdsubdzsyotlhfvzrfudivokpfqlvzxljiywogqhlyhyogqzy",
"device_name": "eplvxmssfiverobyq",
"device_token": "jzovcbfwtzsmzymhuctszmherfuithycubdagcgujebopxsjjcnfnxhetodinuntviogieikafpvzgtottq"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, The user was logged and a response was provided):
{
"data": {
"user": {
"id": 2,
"first_name": null,
"last_name": null,
"birthday": null,
"username": null,
"phone_number": null,
"current_position": null,
"current_location": null,
"email": "[email protected]",
"created_at": "2023-09-01T07:07:11.000000Z",
"updated_at": "2023-09-01T07:07:11.000000Z",
"skills": []
},
"access_token": "50|ls_gIH2pSAscNI4OSpaKrGPUp03qGurmtRGbkT7zpff2efad5f4",
"expire_access_token": "2023-09-01T15:02:57.000000Z",
"refresh_token": "51|ls_dPlao62tX5gMKxCYGrxVxk62dSSXSDtmiLwwYgEef0eb02b2",
"expire_refresh_token": "2023-09-08T14:02:57.000000Z",
"token_type": "Bearer"
}
}
Example response (422, Invalid Credentials):
{
"message": "Invalid Credentials"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
City
This group holds the cities related endpoints
List
Get cities list
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/cities"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"filter": {
"name": "at",
"user": {
"lat": 8,
"lng": 6
}
},
"per_page": 2
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, The cities data):
{
"data": [
{
"id": 69422,
"name": "New York",
"country": {
"id": 147,
"name": "United States",
"phone_code": null,
"sort_name": "US",
"cca3": "USA"
}
},
{
"id": 69423,
"name": "New York Mills",
"country": {
"id": 147,
"name": "United States",
"phone_code": null,
"sort_name": "US",
"cca3": "USA"
}
},
{
"id": 74067,
"name": "West New York",
"country": {
"id": 147,
"name": "United States",
"phone_code": null,
"sort_name": "US",
"cca3": "USA"
}
}
],
"links": {
"first": "http://127.0.0.1:7001/api/v1/cities?page=1",
"last": "http://127.0.0.1:7001/api/v1/cities?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://127.0.0.1:7001/api/v1/cities?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://127.0.0.1:7001/api/v1/cities",
"per_page": 15,
"to": 3,
"total": 3
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Company
This group holds the companies related endpoints
Item
requires authentication
Get company data
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/companies/target"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200, The company data):
{}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Collection
requires authentication
Get own companies list
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/companies"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200, The company data):
{}
Example response (401, The user is not authenticated):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store
requires authentication
Create company data
Example request:
const url = new URL(
"https://admin.staf.online/api/v1/companies"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "lhmljpzxblm",
"description": "quia",
"description_plain": "nobis",
"is_agency": true,
"founded": 22,
"email": "[email protected]",
"phone_number": "sed",
"company_size": 70,
"city_id": 13,
"address": "eaidievzmths",
"video_url": "http:\/\/www.connelly.biz\/",
"industries": [
8
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, The company data):
{}
Example response (401, The user is not authenticated):
{
"message": "Unauthenticated."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.