MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>

Authenticating requests

This API is not authenticated.

Endpoints

Handles the API request and renders the Swagger documentation view.

Example request:
curl --request GET \
    --get "http://localhost:8000/api/documentation" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}"
const url = new URL(
    "http://localhost:8000/api/documentation"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "state": false,
    "code": 500,
    "message": "Operation failed. Please try again later."
}
 

Request      

GET api/documentation

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Handles the OAuth2 callback and retrieves the required file for the redirect.

Example request:
curl --request GET \
    --get "http://localhost:8000/api/oauth2-callback" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}"
const url = new URL(
    "http://localhost:8000/api/oauth2-callback"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):

Show headers
content-type: text/html; charset=utf-8
cache-control: no-cache, private
access-control-allow-origin: *
 

<!doctype html>
<html lang="en-US">
<body>
<script src="oauth2-redirect.js"></script>
</body>
</html>

 

Request      

GET api/oauth2-callback

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

POST api/register

Example request:
curl --request POST \
    "http://localhost:8000/api/register" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}" \
    --data "{
    \"name\": \"b\",
    \"email\": \"zbailey@example.net\",
    \"password\": \"-0pBNvYgxw\",
    \"image_id\": 4326.41688,
    \"country_code\": \"m\",
    \"iso_code\": \"i\",
    \"type\": \"entrepreneur\",
    \"number\": \"architecto\",
    \"region_id\": \"architecto\",
    \"gender\": \"female\"
}"
const url = new URL(
    "http://localhost:8000/api/register"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

let body = {
    "name": "b",
    "email": "zbailey@example.net",
    "password": "-0pBNvYgxw",
    "image_id": 4326.41688,
    "country_code": "m",
    "iso_code": "i",
    "type": "entrepreneur",
    "number": "architecto",
    "region_id": "architecto",
    "gender": "female"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/register

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Body Parameters

name   string     

Must not be greater than 255 characters. Example: b

email   string     

Must be a valid email address. Example: zbailey@example.net

password   string     

Must be at least 8 characters. Example: -0pBNvYgxw

image_id   number  optional    

Example: 4326.41688

country_code   string  optional    

Must not be greater than 5 characters. Example: m

iso_code   string  optional    

Must not be greater than 5 characters. Example: i

type   string     

Example: entrepreneur

Must be one of:
  • audience
  • admin
  • entrepreneur
  • investor
number   string     

Example: architecto

region_id   string     

The id of an existing record in the regions table. Example: architecto

gender   string     

Example: female

Must be one of:
  • male
  • female
verfication_file_id   string  optional    

The id of an existing record in the files table.

POST api/verify-otp

Example request:
curl --request POST \
    "http://localhost:8000/api/verify-otp" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"otp\": 4326.41688
}"
const url = new URL(
    "http://localhost:8000/api/verify-otp"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

let body = {
    "email": "gbailey@example.net",
    "otp": 4326.41688
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/verify-otp

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Body Parameters

email   string     

Example: gbailey@example.net

otp   number     

Example: 4326.41688

POST api/resend-otp

Example request:
curl --request POST \
    "http://localhost:8000/api/resend-otp" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}" \
    --data "{
    \"email\": \"architecto\"
}"
const url = new URL(
    "http://localhost:8000/api/resend-otp"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

let body = {
    "email": "architecto"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/resend-otp

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Body Parameters

email   string     

Example: architecto

POST api/login

Example request:
curl --request POST \
    "http://localhost:8000/api/login" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}" \
    --data "{
    \"identifier\": \"architecto\",
    \"password\": \"]|{+-0pBNvYg\"
}"
const url = new URL(
    "http://localhost:8000/api/login"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

let body = {
    "identifier": "architecto",
    "password": "]|{+-0pBNvYg"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/login

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Body Parameters

identifier   string     

Example: architecto

password   string     

Must be at least 6 characters. Example: ]|{+-0pBNvYg

POST api/refresh

Example request:
curl --request POST \
    "http://localhost:8000/api/refresh" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}"
const url = new URL(
    "http://localhost:8000/api/refresh"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/refresh

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

POST api/logout

Example request:
curl --request POST \
    "http://localhost:8000/api/logout" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}"
const url = new URL(
    "http://localhost:8000/api/logout"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/logout

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

PUT api/profile/update

Example request:
curl --request PUT \
    "http://localhost:8000/api/profile/update" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}" \
    --data "{
    \"name\": \"b\",
    \"image_id\": 4326.41688,
    \"vendor_name\": \"m\",
    \"vendor_address\": \"i\"
}"
const url = new URL(
    "http://localhost:8000/api/profile/update"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

let body = {
    "name": "b",
    "image_id": 4326.41688,
    "vendor_name": "m",
    "vendor_address": "i"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

PUT api/profile/update

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Body Parameters

name   string  optional    

Must not be greater than 255 characters. Example: b

image_id   number  optional    

Example: 4326.41688

vendor_name   string  optional    

Must not be greater than 255 characters. Example: m

vendor_address   string  optional    

Must not be greater than 255 characters. Example: i

POST api/send-otp

Example request:
curl --request POST \
    "http://localhost:8000/api/send-otp" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}" \
    --data "{
    \"email\": \"gbailey@example.net\"
}"
const url = new URL(
    "http://localhost:8000/api/send-otp"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

let body = {
    "email": "gbailey@example.net"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/send-otp

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Body Parameters

email   string     

Must be a valid email address. The email of an existing record in the users table. Example: gbailey@example.net

POST api/confirm-otp

Example request:
curl --request POST \
    "http://localhost:8000/api/confirm-otp" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"otp\": \"architecto\"
}"
const url = new URL(
    "http://localhost:8000/api/confirm-otp"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

let body = {
    "email": "gbailey@example.net",
    "otp": "architecto"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/confirm-otp

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Body Parameters

email   string     

Must be a valid email address. The email of an existing record in the users table. Example: gbailey@example.net

otp   string     

Example: architecto

POST api/reset-password

Example request:
curl --request POST \
    "http://localhost:8000/api/reset-password" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"password\": \"+-0pBNvYgxwmi\\/#iw\"
}"
const url = new URL(
    "http://localhost:8000/api/reset-password"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

let body = {
    "email": "gbailey@example.net",
    "password": "+-0pBNvYgxwmi\/#iw"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/reset-password

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Body Parameters

email   string     

Example: gbailey@example.net

password   string     

Must be at least 8 characters. Example: +-0pBNvYgxwmi/#iw

POST api/resend-password-otp

Example request:
curl --request POST \
    "http://localhost:8000/api/resend-password-otp" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}" \
    --data "{
    \"email\": \"gbailey@example.net\",
    \"password\": \"+-0pBNvYgxwmi\\/#iw\"
}"
const url = new URL(
    "http://localhost:8000/api/resend-password-otp"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

let body = {
    "email": "gbailey@example.net",
    "password": "+-0pBNvYgxwmi\/#iw"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/resend-password-otp

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

Body Parameters

email   string     

Example: gbailey@example.net

password   string     

Must be at least 8 characters. Example: +-0pBNvYgxwmi/#iw

POST api/upload-file/{folder}

Example request:
curl --request POST \
    "http://localhost:8000/api/upload-file/architecto" \
    --header "Accept: application/json" \
    --header "Content-Type: multipart/form-data" \
    --header "Authorization: Bearer {TOKEN}" \
    --form "file=@C:\Users\ASUS\AppData\Local\Temp\php6DFE.tmp" 
const url = new URL(
    "http://localhost:8000/api/upload-file/architecto"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "multipart/form-data",
    "Authorization": "Bearer {TOKEN}",
};

const body = new FormData();
body.append('file', document.querySelector('input[name="file"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/upload-file/{folder}

Headers

Accept        

Example: application/json

Content-Type        

Example: multipart/form-data

Authorization        

Example: Bearer {TOKEN}

URL Parameters

folder   string     

Example: architecto

Body Parameters

file   file     

Must be a file. Must not be greater than 5120 kilobytes. Example: C:\Users\ASUS\AppData\Local\Temp\php6DFE.tmp

POST api/upload-files/{folder}

Example request:
curl --request POST \
    "http://localhost:8000/api/upload-files/architecto" \
    --header "Accept: application/json" \
    --header "Content-Type: multipart/form-data" \
    --header "Authorization: Bearer {TOKEN}" \
    --form "files[]=@C:\Users\ASUS\AppData\Local\Temp\php6E0E.tmp" 
const url = new URL(
    "http://localhost:8000/api/upload-files/architecto"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "multipart/form-data",
    "Authorization": "Bearer {TOKEN}",
};

const body = new FormData();
body.append('files[]', document.querySelector('input[name="files[]"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Request      

POST api/upload-files/{folder}

Headers

Accept        

Example: application/json

Content-Type        

Example: multipart/form-data

Authorization        

Example: Bearer {TOKEN}

URL Parameters

folder   string     

Example: architecto

Body Parameters

files   file[]     

Must be a file. Must not be greater than 5120 kilobytes.

GET api/regions

Example request:
curl --request GET \
    --get "http://localhost:8000/api/regions" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}"
const url = new URL(
    "http://localhost:8000/api/regions"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (500):

Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
 

{
    "state": false,
    "code": 500,
    "message": "Operation failed. Please try again later."
}
 

Request      

GET api/regions

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

POST api/entrepreneur/profile-setup

Example request:
curl --request POST \
    "http://localhost:8000/api/entrepreneur/profile-setup" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}"
const url = new URL(
    "http://localhost:8000/api/entrepreneur/profile-setup"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/entrepreneur/profile-setup

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}

POST api/investor/profile-setup

Example request:
curl --request POST \
    "http://localhost:8000/api/investor/profile-setup" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    --header "Authorization: Bearer {TOKEN}"
const url = new URL(
    "http://localhost:8000/api/investor/profile-setup"
);

const headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": "Bearer {TOKEN}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST api/investor/profile-setup

Headers

Accept        

Example: application/json

Content-Type        

Example: application/json

Authorization        

Example: Bearer {TOKEN}