MENU navbar-image

Introduction

The East AFrica NTB exchange hosts the API calls for the NTB app as well as systems that would want to integrate with the NTB exchange.

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

Base URL

https://ntb-exchange.portal.africa

Authenticating requests

This API is not authenticated.

Endpoints

POST api/auth/register

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/auth/register"
);

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

let body = {
    "first_name": "bwoteysjhtcfcxrjeazsxqinpljhbjplxveeawtuxiufzggkhvnnnaxzumudrcbxzzqoegkhqbgvlvepqxaqalvdypllahssxlbgqhb",
    "last_name": "mrrmlswkyvionsikzhxjjpwcouuiqpiffcaaigotcwvrfbxbpjyizmqccpjtfdtzkbdgigjtofgqdafglmpdlhpmofrrbvshadxnyxvhcspwuuztjihzzywaxizpxnqtqy",
    "email": "duane.lemke@example.org",
    "password": "ldru",
    "country_id": "vbllmqopqjbhlfueivhozmsl",
    "cell_phone_no": "vf",
    "operator_id": "doloremque",
    "gender": "nzsdokricpqd"
};

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

Request   

POST api/auth/register

Body Parameters

first_name  string  

Must not be greater than 255 characters.

last_name  string  

Must not be greater than 255 characters.

email  string  

Must be a valid email address.

password  string  

Must be at least 6 characters.

country_id  string  

Must not be greater than 255 characters.

cell_phone_no  string  

Must not be greater than 10 characters. Must be at least 10 characters.

operator_id  string  

other_operator  string optional  

This field is required when operator_id is 6.

gender  string  

Must not be greater than 20 characters.

POST api/auth/login

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/auth/login"
);

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

let body = {
    "email": "herman.ona@example.net",
    "password": "lewqpl"
};

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

Request   

POST api/auth/login

Body Parameters

email  string  

Must be a valid email address.

password  string  

Must be at least 6 characters.

POST api/auth/forgot-password

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/auth/forgot-password"
);

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

let body = {
    "email": "lubowitz.arlo@example.org"
};

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

Request   

POST api/auth/forgot-password

Body Parameters

email  string  

Must be a valid email address.

Authenticated user

Get information on the current authenticated user.

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/user"
);

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

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

Example response (401):

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

{
    "message": "Unauthenticated."
}
 

Request   

GET api/user

POST api/auth/logout

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/auth/logout"
);

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

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

Request   

POST api/auth/logout

POST api/complaints/wizard

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/complaints/wizard"
);

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

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

Request   

POST api/complaints/wizard

View all complaints for a user

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/complaints/view/20"
);

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

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

Example response (401):

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

{
    "message": "Unauthenticated."
}
 

Request   

GET api/complaints/view/{userId}

URL Parameters

userId  integer  

The ID of the user.

List all the complaints for a spesefic user.

POST api/auth/update-profile

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/auth/update-profile"
);

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

let body = {
    "first_name": "cdgyiypqefcmdrgbfnzlfqdctlqcrmxotaloedndxslzruxfnoikkbcrkbbaxmxrslnonmufcocguampkxyslwyidrkzauqxyngbygiklecao",
    "last_name": "ekbsxcwsglwuznqotqmlfszlaejygpzchceowvnzozenhdgyiksukcvtuaobfbqhsl",
    "password": "",
    "country_id": "vkodchysjycwlefptvpodufbnkfhcqrydtoqrvhlzymsrtipyvrkzaplguqjdwdvadkhfwdknymezxljjbqcvbvfihygyjucramoleroajyoedccegrmjmpjugtmebinoaghh",
    "cell_phone_no": "q",
    "operator_id": "sit",
    "gender": "hi"
};

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

Request   

POST api/auth/update-profile

Body Parameters

id  string optional  

first_name  string  

Must not be greater than 255 characters.

last_name  string  

Must not be greater than 255 characters.

email  string optional  

password  string optional  

This field is required when update_password is true. Must be at least 6 characters.

country_id  string  

Must not be greater than 255 characters.

cell_phone_no  string  

Must not be greater than 10 characters. Must be at least 10 characters.

operator_id  string  

other_operator  string optional  

This field is required when operator_id is 6.

gender  string  

Must not be greater than 20 characters.

POST api/sanctum/token

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/sanctum/token"
);

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

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

Request   

POST api/sanctum/token

View a complaint

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/complaint/view/sint"
);

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

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

Example response (401):

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

{
    "message": "Unauthenticated."
}
 

Request   

GET api/complaint/view/{id}

URL Parameters

id  string  

The ID of the complaint.

Return the details of a specific complaint. It will include messages

Lookups for IDs

Note:

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/lookups"
);

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

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

Example response (200):


{
 "countries": [],
 "locations": [],
 "location_types": [],
 "tariff_codes": [],
 "ntb_types": [],
 "ntb_types_all": [],
 "cost_types": [],
 "operators": [],
 "occurrences": [],
 "lost_times": [],
 "lost_monies": []
}

The following lookups are available:
* countries
* locations
* location_types
 

Request   

GET api/lookups

Modified complaints

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/complaints/modified/sit"
);

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

let body = {
    "date": "2023-09-05"
};

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

Example response (401):

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

{
    "message": "Unauthenticated."
}
 

Request   

GET api/complaints/modified/{date}

URL Parameters

date  string  

Date format YYYY-MM-DD

Show the camplaints that have changes since the date supplied

Body Parameters

date  string  

Must be a valid date in the format Y-m-d.

Add a message to a complaint

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/complaint/20/message"
);

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

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

Request   

POST api/complaint/{id}/message

URL Parameters

id  integer  

The ID of the user.

GET api/faq

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/faq"
);

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

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

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
 

{
    "status": "Success",
    "message": null,
    "data": {
        "Do I need an email address to register?": "Yes, you are required to provide an email address during the registration process. This is necessary for verifying your account. In the event that the NTB complaint needs to be escalated to other systems, they may also require an email address for acceptance.",
        "Will my email or phone number be accessible on the internet?": "No, your email address, phone number, and other contact information will not be made available on the internet. Only the details of the NTB complaint will be accessible, without any personally identifiable information such as your name, contacts, or email address."
    }
}
 

Request   

GET api/faq

Mark a message as read

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/messages/read"
);

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

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

Request   

POST api/messages/read

URL Parameters

id  integer  

The ID of the message.

Return updated message response.

Download document

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/document/download/dicta"
);

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

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

Example response (401):

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

{
    "message": "Unauthenticated."
}
 

Request   

GET api/document/download/{id}

URL Parameters

id  string  

The ID of the download.

documentId  integer  

The ID of the document.

Delete document

Example request:
const url = new URL(
    "https://ntb-exchange.portal.africa/api/document/delete/ea"
);

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

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

Example response (401):

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

{
    "message": "Unauthenticated."
}
 

Request   

GET api/document/delete/{id}

URL Parameters

id  string  

The ID of the delete.

documentId  integer  

The ID of the document.