MENU navbar-image

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."
}
 

Request      

DELETE api/v1/user/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

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"
}
 

Request      

POST api/v1/push-notification/send

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

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."
        ]
    }
}
 

Request      

POST api/v1/auth/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Must be a valid email address. Must not be greater than 255 characters. Example: [email protected]

password   string    =5=CO" data-component="body">

Must not be greater than 255 characters. Must be at least 6 characters. Example: r!"er,w>=5=CO

device_name   string  optional  

Must not be greater than 255 characters. Must be at least 3 characters. Example: qrjbrwmdfntdwpqopnmwrbyiztszhjkrjujizkockhitbvawhriatgbzweeryhgmnpnfikh

device_token   string  optional  

Must not be greater than 255 characters. Must be at least 6 characters. Example: ejmksytgrmkqjxhnvsseeedqquhtsnctgliepxkfyazqigcckkafqmcdxcgbfiyjxlmecgdbtviawyfz

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."
        ]
    }
}
 

Request      

POST api/v1/auth/logout

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

device_token   string  optional  

Must be at least 3 characters. Example: axygjxchqaxgemrvbvvpifetoyjptyewgnxvrhaiyfemiydkeerapsfmhlmelxjnjbvzqxknyqdhwclklz

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."
        ]
    }
}
 

Request      

POST api/v1/auth/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Must be a valid email address. Must not be greater than 255 characters. Example: [email protected]

password   string   

Must not be greater than 255 characters. Must be at least 6 characters. Example: SHlpqgexB{]FSP

device_name   string  optional  

Must not be greater than 255 characters. Must be at least 3 characters. Example: suwwclmeunkfgrfufpchinkgmmpytbwgdvcfdbxjjovfjegxsrtwbegxrcitggoyydcleojao

device_token   string  optional  

Must not be greater than 255 characters. Must be at least 6 characters. Example: bjxtoyaptogyasdxxydkkynkvinfcqs

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"
    }
}
 

Request      

POST api/v1/auth/refresh-token

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

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"
}
 

Request      

GET api/v1/auth/google

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

id_token   string   

Must be at least 3 characters. Example: jamiobmydpqcqcruqqkhzunujzcdqqjxbzweqbrcncnxiaelpjbnajrkfsb

device_name   string  optional  

Must not be greater than 255 characters. Must be at least 3 characters. Example: jeaptaledmrcbvycnjxwrcrpnkwhpwjzgfgxjycshxrozd

device_token   string  optional  

Must not be greater than 255 characters. Must be at least 6 characters. Example: xndngvdeiwxymqkzbmhbuouoxkaqstjvgpelmuizmwiyuvyzpmhxaryadtsybnx

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"
}
 

Request      

GET api/v1/auth/facebook

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

id_token   string   

Must be at least 3 characters. Example: gjfctczhqvqdouabheofofzdjlekpxbmyvuufufcdnmqrxlsklbbjtkvhpwiqmhbpbimpiclgvy

device_name   string  optional  

Must not be greater than 255 characters. Must be at least 3 characters. Example: wgopoyanrsxfwxjstxizqwfvfglhjyoiuowoe

device_token   string  optional  

Must not be greater than 255 characters. Must be at least 6 characters. Example: tlsbdyihyiqbkhmdaotedcfxfomnfsvjrknadlchkdqmwmkvhpdeuukgqvr

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"
}
 

Request      

GET api/v1/auth/apple

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

id_token   string   

Must be at least 3 characters. Example: anahpwvhumpoxeywvdoqxpxwpdsubdzsyotlhfvzrfudivokpfqlvzxljiywogqhlyhyogqzy

device_name   string  optional  

Must not be greater than 255 characters. Must be at least 3 characters. Example: eplvxmssfiverobyq

device_token   string  optional  

Must not be greater than 255 characters. Must be at least 6 characters. Example: jzovcbfwtzsmzymhuctszmherfuithycubdagcgujebopxsjjcnfnxhetodinuntviogieikafpvzgtottq

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
    }
}
 

Request      

GET api/v1/cities

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

filter   object  optional  
name   string  optional  

Example: at

user   object  optional  
lat   number  optional  

Must be at least -300.000000. Must not be greater than 300.000000. Example: 8

lng   number  optional  

Must be at least -300.000000. Must not be greater than 300.000000. Example: 6

per_page   integer  optional  

Example: 2

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):


{}
 

Request      

GET api/v1/companies/{company_slug}

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

company_slug   string   

The slug of the company. Example: target

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."
}
 

Request      

GET api/v1/companies

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

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."
}
 

Request      

POST api/v1/companies

Headers

Authorization      

Example: Bearer {YOUR_AUTH_KEY}

Content-Type      

Exam