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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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."
}
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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."
}
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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."
}
Received response:
Request failed with error:
Lookups for IDs
Note:
ntb_types_all
will return all NTB catagoriesntb_types
is the main catagories which must have pictures in the app
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
Received response:
Request failed with error:
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."
}
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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."
}
}
Received response:
Request failed with error:
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());
Received response:
Request failed with error:
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."
}
Received response:
Request failed with error:
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."
}
Received response:
Request failed with error: