MENU navbar-image

Introduction

Welcome to the API documentation for the NGR app, powered by Laravel PHP.

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

Authenticating requests

To authenticate requests, include an Authorization header with the value "Bearer {SECRET_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve a token by sending a login request via postman and copying the generated API token.

Authentication

The Auth API allows you to authenticate all types of users on your integration. This include the regular users (buyers), the business users (sellers) and the admin account when it is implemented.

Login

Log a user in by social auth (0AUTH 2) or default form data.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/auth/login"
);

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

let body = {
    "email": "test@ngr.ltd",
    "password": "password",
    "mode": "default"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "https://api.ngr.ltd/api/v1/auth/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"test@ngr.ltd\",
    \"password\": \"password\",
    \"mode\": \"default\"
}"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/auth/login'
payload = {
    "email": "test@ngr.ltd",
    "password": "password",
    "mode": "default"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/auth/login';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'test@ngr.ltd',
            'password' => 'password',
            'mode' => 'default',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "business",
        "id": "a9531032-ff42-4fa6-881d-8cfed283c032",
        "attributes": {
            "email": "rowan.gulgowski@example.com",
            "firstName": "Nick",
            "lastName": "Cruickshank",
            "otherName": null,
            "emailVerifiedAt": "2024-11-08T20:40:49.000000Z",
            "accountType": "business",
            "phone1": "+1.323.526.6748",
            "phone2": null,
            "greet": "Hello Rowan.gulgowski",
            "gender": null,
            "avatar": "https://source.boringavatars.com/beam/120/rowan.gulgowski?colors=264653,2a9d8f,e9c46a,f4a261,e76f51,FD6C6B,2CFF6D8C,2CFF3A80,2C3E2E6D,2C2A1D5D",
            "lastLogin": null,
            "createdAt": "2024-11-08T20:40:49.000000Z"
        },
        "relationships": [],
        "links": {
            "self": "http://api.ngr.ltd/api/v1/users/a9531032-ff42-4fa6-881d-8cfed283c032"
        }
    },
    "success": "true",
    "message": "Welcome back to NGR!"
}
 

Example response (401, Account does not exist):


{
    "success": false,
    "message": "You do not have an account, please sign up instead.",
    "data": []
}
 

Example response (401, Invalid credentials):


{
    "success": true,
    "message": "Invalid credentials.",
    "data": []
}
 

Request      

POST api/v1/auth/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Email address of the user. Must be a valid email address. Example: test@ngr.ltd

password   string  optional  

Password of the user if mode is default. Example: password

mode   string   

The mode of the authentication. Example: default

Must be one of:
  • default
  • social

Sign up

Create an account for a user by social auth (0AUTH 2) or default form data.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/auth/register"
);

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

let body = {
    "name": "3d7 Technologies",
    "description": "This business is my escape from poverty.",
    "category": 1,
    "location": 1,
    "phone": "+2348123267184",
    "mode": "default",
    "type": "business",
    "email": "test@ngr.ltd",
    "password": "password"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "https://api.ngr.ltd/api/v1/auth/register" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"3d7 Technologies\",
    \"description\": \"This business is my escape from poverty.\",
    \"category\": 1,
    \"location\": 1,
    \"phone\": \"+2348123267184\",
    \"mode\": \"default\",
    \"type\": \"business\",
    \"email\": \"test@ngr.ltd\",
    \"password\": \"password\"
}"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/auth/register'
payload = {
    "name": "3d7 Technologies",
    "description": "This business is my escape from poverty.",
    "category": 1,
    "location": 1,
    "phone": "+2348123267184",
    "mode": "default",
    "type": "business",
    "email": "test@ngr.ltd",
    "password": "password"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/auth/register';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '3d7 Technologies',
            'description' => 'This business is my escape from poverty.',
            'category' => 1,
            'location' => 1,
            'phone' => '+2348123267184',
            'mode' => 'default',
            'type' => 'business',
            'email' => 'test@ngr.ltd',
            'password' => 'password',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "business",
        "id": "c3c50e2f-aa40-4828-bde2-ae57e1d1417c",
        "attributes": {
            "email": "ashly64@example.com",
            "firstName": "Adriel",
            "lastName": "Romaguera",
            "otherName": null,
            "emailVerifiedAt": "2024-11-08T20:40:49.000000Z",
            "accountType": "business",
            "phone1": "918.832.7196",
            "phone2": null,
            "greet": "Hello Ashly64",
            "gender": null,
            "avatar": "https://source.boringavatars.com/beam/120/ashly64?colors=264653,2a9d8f,e9c46a,f4a261,e76f51,FD6C6B,2CFF6D8C,2CFF3A80,2C3E2E6D,2C2A1D5D",
            "lastLogin": null,
            "createdAt": "2024-11-08T20:40:49.000000Z"
        },
        "relationships": [],
        "links": {
            "self": "http://api.ngr.ltd/api/v1/users/c3c50e2f-aa40-4828-bde2-ae57e1d1417c"
        }
    },
    "success": "true",
    "message": "Welcome to NGR!"
}
 

Example response (409, Account already exist):


{
    "success": false,
    "message": "You already have an account, please log in instead.",
    "data": []
}
 

Request      

POST api/v1/auth/register

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string  optional  

The name of the business if its a business account. This field is required when type is business. Must not be greater than 100 characters. Example: 3d7 Technologies

description   string  optional  

The business description. This field is required when type is business. Must be at least 5 characters. Must not be greater than 100 characters. Example: This business is my escape from poverty.

category   integer  optional  

The category of the business if its a business account. This field is required when type is business. Example: 1

location   integer  optional  

LGA of the business if its a business account. This field is required when type is business. Example: 1

phone   string  optional  

Phone number of the business if its a business account. This field is required when type is business. Must be at least 5 characters. Must not be greater than 16 characters. Example: +2348123267184

mode   string   

The mode of the authentication. Example: default

Must be one of:
  • default
  • social
type   string   

The type of the account to create. Example: business

Must be one of:
  • business
  • regular
  • superadmin
email   string   

Email address of the new user. Must be a valid email address. Example: test@ngr.ltd

password   string  optional  

The password of the user if mode is default. This field is required when mode is default. Example: password

Recover account

Recover a user's account whose password, they have forgotten.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/auth/forgot-password"
);

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

let body = {
    "email": "test@ngr.ltd"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "https://api.ngr.ltd/api/v1/auth/forgot-password" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"test@ngr.ltd\"
}"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/auth/forgot-password'
payload = {
    "email": "test@ngr.ltd"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/auth/forgot-password';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'email' => 'test@ngr.ltd',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, Reset email sent):


{
    "success": true,
    "message": "We have emailed your password reset link!",
    "data": []
}
 

Example response (422, Invalid email):


{
    "success": false,
    "message": "Problems encountered with the data provided. Please contact support if issue persists.",
    "data": [
        "We can't find a user with that email address."
    ]
}
 

Request      

POST api/v1/auth/forgot-password

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

Email address of the user account to recover. Must be a valid email address. Example: test@ngr.ltd

Reset password

Reset a user's password.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/auth/reset-password/architecto"
);

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

let body = {
    "token": "91d592b62e94e6cae3919b237731143721d62f565f533413a39410fddbf40639",
    "email": "test@ngr.ltd",
    "password": "secret"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request POST \
    "https://api.ngr.ltd/api/v1/auth/reset-password/architecto" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"token\": \"91d592b62e94e6cae3919b237731143721d62f565f533413a39410fddbf40639\",
    \"email\": \"test@ngr.ltd\",
    \"password\": \"secret\"
}"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/auth/reset-password/architecto'
payload = {
    "token": "91d592b62e94e6cae3919b237731143721d62f565f533413a39410fddbf40639",
    "email": "test@ngr.ltd",
    "password": "secret"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/auth/reset-password/architecto';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'token' => '91d592b62e94e6cae3919b237731143721d62f565f533413a39410fddbf40639',
            'email' => 'test@ngr.ltd',
            'password' => 'secret',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, Password reset):


{
    "success": true,
    "message": "We have reset your password. Go ahead to login with your new password.",
    "data": []
}
 

Example response (500, Invalid password token):


{
    "success": false,
    "message": "We could not reset your password. Please contact support if issue persists.",
    "data": [
        "This password reset token is invalid."
    ]
}
 

Request      

POST api/v1/auth/reset-password/{token}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

token   string   

Example: architecto

Body Parameters

token   string   

The request token. Example: 91d592b62e94e6cae3919b237731143721d62f565f533413a39410fddbf40639

email   string   

The user email. Must be a valid email address. Example: test@ngr.ltd

password   string   

The new, validated password. Example: secret

Verify account

Verify a new user account - This route is public to the API. You do not need it for anything on your integration.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/auth/email/verify/10"
);

const params = {
    "expires": "1717860802",
    "hash": "1945cf792d5e32083db670cbba718af3384c8f06",
    "signature": "da248ac0c9dc522dd49e4cfaf10ff662b1c770dcf2a22f7fd8f6023cae573a81",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/auth/email/verify/10?expires=1717860802&hash=1945cf792d5e32083db670cbba718af3384c8f06&signature=da248ac0c9dc522dd49e4cfaf10ff662b1c770dcf2a22f7fd8f6023cae573a81" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/auth/email/verify/10'
params = {
  'expires': '1717860802',
  'hash': '1945cf792d5e32083db670cbba718af3384c8f06',
  'signature': 'da248ac0c9dc522dd49e4cfaf10ff662b1c770dcf2a22f7fd8f6023cae573a81',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/auth/email/verify/10';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'expires' => '1717860802',
            'hash' => '1945cf792d5e32083db670cbba718af3384c8f06',
            'signature' => 'da248ac0c9dc522dd49e4cfaf10ff662b1c770dcf2a22f7fd8f6023cae573a81',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (302):

Show headers
cache-control: no-cache, private
location: https://ngr.ltd/verification?verified=false
content-type: text/html; charset=utf-8
access-control-allow-origin: *
 

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="0;url='https://ngr.ltd/verification?verified=false'" />

        <title>Redirecting to https://ngr.ltd/verification?verified=false</title>
    </head>
    <body>
        Redirecting to <a href="https://ngr.ltd/verification?verified=false">https://ngr.ltd/verification?verified=false</a>.
    </body>
</html>
 

Request      

GET api/v1/auth/email/verify/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

id   integer   

ID of the user. Example: 10

Query Parameters

expires   string   

The expiry timestamp of the link. Example: 1717860802

hash   string   

The unique hash for the link. Example: 1945cf792d5e32083db670cbba718af3384c8f06

signature   string   

The unique signature of the link. Example: da248ac0c9dc522dd49e4cfaf10ff662b1c770dcf2a22f7fd8f6023cae573a81

Resend verification email

requires authentication

Resend the email to verify a new user account.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/auth/email/resend"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/auth/email/resend" \
    --header "Authorization: Bearer {SECRET_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/auth/email/resend'
headers = {
  'Authorization': 'Bearer {SECRET_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/auth/email/resend';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {SECRET_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, Sorry, your account is already verified):


{
    "success": true,
    "message": "Sorry, your account is already verified.",
    "data": []
}
 

Example response (200, Verification link sent):


{
    "success": true,
    "message": "A new verification link has been sent to your email address.",
    "data": []
}
 

Request      

GET api/v1/auth/email/resend

Headers

Authorization      

Example: Bearer {SECRET_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Logout

requires authentication

Log a user out of the application.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/auth/logout"
);

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

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());
curl --request POST \
    "https://api.ngr.ltd/api/v1/auth/logout" \
    --header "Authorization: Bearer {SECRET_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/auth/logout'
headers = {
  'Authorization': 'Bearer {SECRET_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/auth/logout';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {SECRET_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, Logout successful):


{
    "success": true,
    "message": "Logout successful.",
    "data": []
}
 

Request      

POST api/v1/auth/logout

Headers

Authorization      

Example: Bearer {SECRET_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Businesses

The Businesses API allows you create and manage businesses on your integration.

List businesses

Gets a list of all businesses.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/businesses"
);

const params = {
    "page": "1",
    "filters[name]": "3d7",
    "filters[category]": "1",
    "filters[lga]": "1",
    "filters[state]": "1",
    "filters[country]": "161",
    "filters[createdAt]": "15-06-2024",
    "filters[updatedAt]": "15-06-2024",
    "include": "owner",
    "sort": "-businessName",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/businesses?page=1&filters[name]=3d7&filters[category]=1&filters[lga]=1&filters[state]=1&filters[country]=161&filters[createdAt]=15-06-2024&filters[updatedAt]=15-06-2024&include=owner&sort=-businessName" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/businesses'
params = {
  'page': '1',
  'filters[name]': '3d7',
  'filters[category]': '1',
  'filters[lga]': '1',
  'filters[state]': '1',
  'filters[country]': '161',
  'filters[createdAt]': '15-06-2024',
  'filters[updatedAt]': '15-06-2024',
  'include': 'owner',
  'sort': '-businessName',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/businesses';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page' => '1',
            'filters[name]' => '3d7',
            'filters[category]' => '1',
            'filters[lga]' => '1',
            'filters[state]' => '1',
            'filters[country]' => '161',
            'filters[createdAt]' => '15-06-2024',
            'filters[updatedAt]' => '15-06-2024',
            'include' => 'owner',
            'sort' => '-businessName',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "business",
        "id": "4a7b65d8-0755-4f66-9b13-30bb608ed61b",
        "attributes": {
            "businessName": "Rempel, Gulgowski and O'Kon",
            "category": "Construction",
            "location": "Agatu, Benue State",
            "description": null,
            "logo": null
        },
        "includes": [],
        "links": {
            "self": "http://api.ngr.ltd/api/v1/businesses/4a7b65d8-0755-4f66-9b13-30bb608ed61b"
        }
    }
}
 

Request      

GET api/v1/businesses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

The page to view. Example: 1

filters   object  optional  

Fields to filter by

filters.name   string  optional  

Filter by business name. Example: 3d7

filters.category   string  optional  

Filter by the category of the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 1

filters.lga   string  optional  

Filter by the lga of the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 1

filters.state   string  optional  

Filter by the state to filter the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 1

filters.country   integer  optional  

Filter by the country of the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 161

filters.createdAt   string  optional  

Filter by date created (can be comma-separated for multiple values. eg 12-06-2024,15-06-2024). Example: 15-06-2024

filters.updatedAt   string  optional  

Filter by date created (can be comma-separated for multiple values. eg 12-06-2024,15-06-2024). Example: 15-06-2024

include   string  optional  

The optional parameters to load optional data (owner and socials. eg owner,socials). Example: owner

sort   string  optional  

The property to sort the businesses by (can be comma-separated for multiple values. (- means descending) eg -businessName,createdAt). Example: -businessName

Fetch business

Gets the details of a specified business.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/businesses/85573106-63da-46fa-9434-3bd87e3cd7f4"
);

const params = {
    "include": "owner,socials",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/businesses/85573106-63da-46fa-9434-3bd87e3cd7f4?include=owner%2Csocials" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/businesses/85573106-63da-46fa-9434-3bd87e3cd7f4'
params = {
  'include': 'owner,socials',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/businesses/85573106-63da-46fa-9434-3bd87e3cd7f4';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'include' => 'owner,socials',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "business",
        "id": "52ccd444-5b20-4a98-8d48-900f86dd9a86",
        "attributes": {
            "businessName": "Haag and Sons",
            "category": "Construction",
            "location": "Esit Eket, Akwa Ibom State",
            "description": null,
            "logo": null,
            "country": "Nigeria",
            "state": "Akwa Ibom State",
            "lga": "Esit Eket",
            "createdAt": "2024-11-08T20:40:49.000000Z",
            "updatedAt": "2024-11-08T20:40:49.000000Z"
        },
        "includes": [],
        "links": {
            "self": "http://api.ngr.ltd/api/v1/businesses/52ccd444-5b20-4a98-8d48-900f86dd9a86"
        }
    }
}
 

Request      

GET api/v1/businesses/{business_uuid}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

business_uuid   string   

The UUID of the business. Example: 85573106-63da-46fa-9434-3bd87e3cd7f4

Query Parameters

include   string  optional  

The optional parameters to load optional data (owner and socials). Example: owner,socials

Categories

The Categories API allows you create and manage categories on your integration.

List categories

Gets a list of all categories.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/categories"
);

const params = {
    "page": "1",
    "paginate": "130",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/categories?page=1&paginate=130" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/categories'
params = {
  'page': '1',
  'paginate': '130',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/categories';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page' => '1',
            'paginate' => '130',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "category",
        "id": 25,
        "attributes": {
            "name": "Adipisci quidem nostrum qui commodi incidunt iure.",
            "slug": "adipisci-quidem-nostrum-qui-commodi-incidunt-iure",
            "parent": null,
            "icon": null
        },
        "relationships": {
            "businesses": {
                "data": []
            }
        },
        "includes": [],
        "links": [
            {
                "self": "http://api.ngr.ltd/api/v1/categories/916348d4-3c13-4e15-b66e-6363b01cc906"
            }
        ]
    }
}
 

Request      

GET api/v1/categories

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

The page to view. Example: 1

paginate   integer  optional  

The total to show per page (use a high number to get all). Example: 130

Fetch category

Gets the details of a specified category.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/categories/85573106-63da-46fa-9434-3bd87e3cd7f4"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/categories/85573106-63da-46fa-9434-3bd87e3cd7f4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/categories/85573106-63da-46fa-9434-3bd87e3cd7f4'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/categories/85573106-63da-46fa-9434-3bd87e3cd7f4';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "category",
        "id": 26,
        "attributes": {
            "name": "Modi ipsum nostrum omnis autem et.",
            "slug": "modi-ipsum-nostrum-omnis-autem-et",
            "parent": null,
            "icon": null
        },
        "relationships": {
            "businesses": {
                "data": [
                    {
                        "type": "business",
                        "id": "e98ace9e-d374-478b-a91c-fd993ea12141",
                        "attributes": {
                            "businessName": "Feeney, Leffler and Glover",
                            "category": "Modi ipsum nostrum omnis autem et.",
                            "location": "Kibiya, Kano State",
                            "description": null,
                            "logo": null
                        },
                        "includes": [],
                        "links": {
                            "self": "http://api.ngr.ltd/api/v1/businesses/e98ace9e-d374-478b-a91c-fd993ea12141"
                        }
                    }
                ]
            }
        },
        "includes": [],
        "links": [
            {
                "self": "http://api.ngr.ltd/api/v1/categories/e7d3aef1-19d8-42da-b4ef-36c2ec747364"
            }
        ]
    }
}
 

Request      

GET api/v1/categories/{category_uuid}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

category_uuid   string   

The UUID of the category. Example: 85573106-63da-46fa-9434-3bd87e3cd7f4

Location

The Location API allows you to get location data on your integration.

Get all locations

Gets a list of all locations.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/location"
);

const params = {
    "page": "1",
    "paginate": "775",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/location?page=1&paginate=775" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/location'
params = {
  'page': '1',
  'paginate': '775',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/location';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page' => '1',
            'paginate' => '775',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "state",
        "id": 1,
        "attributes": {
            "name": "Abia State",
            "country": "Nigeria"
        },
        "relationships": {
            "localGovernmentAreas": [
                {
                    "type": "lga",
                    "id": 1,
                    "attributes": {
                        "name": "Aba North",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 2,
                    "attributes": {
                        "name": "Aba South",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 3,
                    "attributes": {
                        "name": "Arochukwu",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 4,
                    "attributes": {
                        "name": "Bende",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 5,
                    "attributes": {
                        "name": "Ikwuano",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 6,
                    "attributes": {
                        "name": "Isiala Ngwa North",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 7,
                    "attributes": {
                        "name": "Isiala Ngwa South",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 8,
                    "attributes": {
                        "name": "Isuikwuato",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 9,
                    "attributes": {
                        "name": "Obi Ngwa",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 10,
                    "attributes": {
                        "name": "Ohafia",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 11,
                    "attributes": {
                        "name": "Osisioma",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 12,
                    "attributes": {
                        "name": "Ugwunagbo",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 13,
                    "attributes": {
                        "name": "Ukwa East",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 14,
                    "attributes": {
                        "name": "Ukwa West",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 15,
                    "attributes": {
                        "name": "Umu-Nneochi",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 16,
                    "attributes": {
                        "name": "Umuahia North",
                        "state": "Abia State"
                    },
                    "links": []
                },
                {
                    "type": "lga",
                    "id": 17,
                    "attributes": {
                        "name": "Umuahia South",
                        "state": "Abia State"
                    },
                    "links": []
                }
            ]
        },
        "links": []
    }
}
 

Request      

GET api/v1/location

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

The page to view. Example: 1

paginate   integer  optional  

The total to show per page (use a high number to get all). Example: 775

Templates

The Templates API allows you create and manage templates on your integration.

List templates

Gets a list of all templates.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/templates"
);

const params = {
    "page": "1",
    "paginate": "130",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/templates?page=1&paginate=130" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/templates'
params = {
  'page': '1',
  'paginate': '130',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/templates';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page' => '1',
            'paginate' => '130',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "template",
        "id": "0c3528b1-423d-436b-b239-7f90619dab0d",
        "attributes": {
            "name": "Aron Ledner",
            "thumbnail": "C:\\Users\\victo\\AppData\\Local\\Temp\\fak466A.tmp"
        },
        "relationships": {
            "build": {
                "data": {
                    "type": "website",
                    "id": "b16b34c1-cfee-45ff-84f4-3019445e574b",
                    "attributes": {
                        "meta": {
                            "id": "b16b34c1-cfee-45ff-84f4-3019445e574b",
                            "template": "0c3528b1-423d-436b-b239-7f90619dab0d",
                            "status": "draft",
                            "domainUrl": "-OCYEd.ngr.ltd",
                            "thumbnail": ""
                        }
                    },
                    "includes": [],
                    "relationships": []
                }
            },
            "categories": {
                "data": []
            }
        },
        "includes": [],
        "links": [
            {
                "self": "http://api.ngr.ltd/api/v1/templates/83"
            }
        ]
    }
}
 

Request      

GET api/v1/templates

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

The page to view. Example: 1

paginate   integer  optional  

The total to show per page (use a high number to get all). Example: 130

Fetch template

Gets the details of a specified template.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/templates/1"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/templates/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/templates/1'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/templates/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "template",
        "id": "09d683e2-a437-4e4e-ab0f-b442864a4a69",
        "attributes": {
            "name": "Mrs. Donna Kessler DDS",
            "thumbnail": "C:\\Users\\victo\\AppData\\Local\\Temp\\fak46B9.tmp"
        },
        "relationships": {
            "build": {
                "data": {
                    "type": "website",
                    "id": "94f2e0e5-0292-4177-acac-eb764d13493e",
                    "attributes": {
                        "meta": {
                            "id": "94f2e0e5-0292-4177-acac-eb764d13493e",
                            "template": "09d683e2-a437-4e4e-ab0f-b442864a4a69",
                            "status": "draft",
                            "domainUrl": "-JvQtc.ngr.ltd",
                            "thumbnail": ""
                        }
                    },
                    "includes": [],
                    "relationships": []
                }
            },
            "categories": {
                "data": [
                    {
                        "type": "category",
                        "id": 27,
                        "attributes": {
                            "name": "Rerum voluptas ab maxime qui rerum sed.",
                            "slug": "rerum-voluptas-ab-maxime-qui-rerum-sed",
                            "parent": null,
                            "icon": null
                        },
                        "relationships": {
                            "businesses": {
                                "data": []
                            }
                        },
                        "includes": [],
                        "links": [
                            {
                                "self": "http://api.ngr.ltd/api/v1/categories/2c1d0366-c70a-4213-9037-34f91c3c4d1c"
                            }
                        ]
                    }
                ]
            }
        },
        "includes": [],
        "links": [
            {
                "self": "http://api.ngr.ltd/api/v1/templates/84"
            }
        ]
    }
}
 

Request      

GET api/v1/templates/{template_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

template_id   integer   

The ID of the template. Example: 1

id   integer   

The ID of the template. Example: 1

Users

The Users API allows you create and manage users on your integration.

List users

Gets a list of all users.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/users"
);

const params = {
    "page": "1",
    "paginate": "130",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/users?page=1&paginate=130" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/users'
params = {
  'page': '1',
  'paginate': '130',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/users';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page' => '1',
            'paginate' => '130',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "business",
        "id": "f8ea59a1-1485-4508-aba5-7405e08ae5aa",
        "attributes": {
            "email": "modesta58@example.net",
            "firstName": "Manuel",
            "lastName": "Hamill",
            "otherName": null,
            "emailVerifiedAt": "2024-11-08T20:40:49.000000Z"
        },
        "relationships": [],
        "links": {
            "self": "http://api.ngr.ltd/api/v1/users/f8ea59a1-1485-4508-aba5-7405e08ae5aa"
        }
    }
}
 

Request      

GET api/v1/users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

The page to view. Example: 1

paginate   integer  optional  

The total to show per page (use a high number to get all). Example: 130

Fetch user

Gets the details of a specified user.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/users/85573106-63da-46fa-9434-3bd87e3cd7f4"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/users/85573106-63da-46fa-9434-3bd87e3cd7f4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/users/85573106-63da-46fa-9434-3bd87e3cd7f4'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/users/85573106-63da-46fa-9434-3bd87e3cd7f4';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "business",
        "id": "0684f3d9-d38f-4163-a35c-ef53c96e2ab4",
        "attributes": {
            "email": "carter.raleigh@example.com",
            "firstName": "Carolina",
            "lastName": "Balistreri",
            "otherName": null,
            "emailVerifiedAt": "2024-11-08T20:40:49.000000Z",
            "accountType": "business",
            "phone1": "+14198676281",
            "phone2": null,
            "greet": "Hello Carter.raleigh",
            "gender": null,
            "avatar": "https://source.boringavatars.com/beam/120/carter.raleigh?colors=264653,2a9d8f,e9c46a,f4a261,e76f51,FD6C6B,2CFF6D8C,2CFF3A80,2C3E2E6D,2C2A1D5D",
            "lastLogin": null,
            "createdAt": "2024-11-08T20:40:49.000000Z"
        },
        "relationships": {
            "businesses": {
                "data": [
                    {
                        "type": "business",
                        "id": "d5ec3f52-5a41-4a18-bd54-f1d05e996437",
                        "attributes": {
                            "businessName": "Homenick, Schimmel and Glover",
                            "category": "Arts and Entertainment",
                            "location": "Agatu, Benue State",
                            "description": null,
                            "logo": null
                        },
                        "includes": [],
                        "links": {
                            "self": "http://api.ngr.ltd/api/v1/businesses/d5ec3f52-5a41-4a18-bd54-f1d05e996437"
                        }
                    }
                ]
            }
        },
        "links": {
            "self": "http://api.ngr.ltd/api/v1/users/0684f3d9-d38f-4163-a35c-ef53c96e2ab4"
        }
    }
}
 

Request      

GET api/v1/users/{user_uuid}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

user_uuid   string   

The UUID of the user. Example: 85573106-63da-46fa-9434-3bd87e3cd7f4

Update profile

requires authentication

Updates the currently logged in user's profile.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/users/profile"
);

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

const body = new FormData();
body.append('firstName', 'John');
body.append('lastName', 'Olu');
body.append('otherName', 'Doe');
body.append('gender', 'Male');
body.append('phone1', '+2348123156783');
body.append('phone2', '+2348123156783');
body.append('address1', '56, Mike street, Lekki, Lagos');
body.append('address2', 'Nigeria');
body.append('avatar', document.querySelector('input[name="avatar"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
curl --request POST \
    "https://api.ngr.ltd/api/v1/users/profile" \
    --header "Authorization: Bearer {SECRET_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "firstName=John"\
    --form "lastName=Olu"\
    --form "otherName=Doe"\
    --form "gender=Male"\
    --form "phone1=+2348123156783"\
    --form "phone2=+2348123156783"\
    --form "address1=56, Mike street, Lekki, Lagos"\
    --form "address2=Nigeria"\
    --form "avatar=@C:\Users\victo\AppData\Local\Temp\php462A.tmp" 
import requests
import json

url = 'https://api.ngr.ltd/api/v1/users/profile'
files = {
  'firstName': (None, 'John'),
  'lastName': (None, 'Olu'),
  'otherName': (None, 'Doe'),
  'gender': (None, 'Male'),
  'phone1': (None, '+2348123156783'),
  'phone2': (None, '+2348123156783'),
  'address1': (None, '56, Mike street, Lekki, Lagos'),
  'address2': (None, 'Nigeria'),
  'avatar': open('C:\Users\victo\AppData\Local\Temp\php462A.tmp', 'rb')}
payload = {
    "firstName": "John",
    "lastName": "Olu",
    "otherName": "Doe",
    "gender": "Male",
    "phone1": "+2348123156783",
    "phone2": "+2348123156783",
    "address1": "56, Mike street, Lekki, Lagos",
    "address2": "Nigeria"
}
headers = {
  'Authorization': 'Bearer {SECRET_KEY}',
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, files=files)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/users/profile';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {SECRET_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'firstName',
                'contents' => 'John'
            ],
            [
                'name' => 'lastName',
                'contents' => 'Olu'
            ],
            [
                'name' => 'otherName',
                'contents' => 'Doe'
            ],
            [
                'name' => 'gender',
                'contents' => 'Male'
            ],
            [
                'name' => 'phone1',
                'contents' => '+2348123156783'
            ],
            [
                'name' => 'phone2',
                'contents' => '+2348123156783'
            ],
            [
                'name' => 'address1',
                'contents' => '56, Mike street, Lekki, Lagos'
            ],
            [
                'name' => 'address2',
                'contents' => 'Nigeria'
            ],
            [
                'name' => 'avatar',
                'contents' => fopen('C:\Users\victo\AppData\Local\Temp\php462A.tmp', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, Profile updated):


{
    "success": true,
    "message": "Profile updated.",
    "data": []
}
 

Request      

POST api/v1/users/profile

Headers

Authorization      

Example: Bearer {SECRET_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

firstName   string  optional  

First name of the user. Must not be greater than 50 characters. Example: John

lastName   string  optional  

Last name of the user. Must not be greater than 50 characters. Example: Olu

otherName   string  optional  

Other name of the user. Must not be greater than 50 characters. Example: Doe

gender   string  optional  

Gender of the user. Must not be greater than 50 characters. Example: Male

phone1   string  optional  

Primary phone number of the user. Must not be greater than 50 characters. Example: +2348123156783

phone2   string  optional  

Alternative phone number of the user. Must not be greater than 50 characters. Example: +2348123156783

address1   string  optional  

Address of the user. Must not be greater than 50 characters. Example: 56, Mike street, Lekki, Lagos

address2   string  optional  

Country of the user. Must not be greater than 50 characters. Example: Nigeria

avatar   file  optional  

Their profile picture. Must be an image. Must not be greater than 10000 kilobytes. Example: C:\Users\victo\AppData\Local\Temp\php462A.tmp

Change password

requires authentication

Updates the currently logged in user's password.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/users/password"
);

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

let body = {
    "currentPassword": "password",
    "newPassword": "passwOrd"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
curl --request PUT \
    "https://api.ngr.ltd/api/v1/users/password" \
    --header "Authorization: Bearer {SECRET_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"currentPassword\": \"password\",
    \"newPassword\": \"passwOrd\"
}"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/users/password'
payload = {
    "currentPassword": "password",
    "newPassword": "passwOrd"
}
headers = {
  'Authorization': 'Bearer {SECRET_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/users/password';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {SECRET_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'currentPassword' => 'password',
            'newPassword' => 'passwOrd',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200, Password changed):


{
    "success": true,
    "message": "Password changed.",
    "data": []
}
 

Example response (409, Invalid current password):


{
    "success": false,
    "message": "Invalid current password.",
    "data": []
}
 

Request      

PUT api/v1/users/password

Headers

Authorization      

Example: Bearer {SECRET_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

currentPassword   string  optional  

Current password of the user. Example: password

newPassword   string  optional  

New password of the user. Example: passwOrd

Website Management

The Websites API allows you create and manage websites on your integration.

Like a website

requires authentication

Adds a website to the currently logged in user's favorites.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/website/like/85573106-63da-46fa-9434-3bd87e3cd7f4"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/website/like/85573106-63da-46fa-9434-3bd87e3cd7f4" \
    --header "Authorization: Bearer {SECRET_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/website/like/85573106-63da-46fa-9434-3bd87e3cd7f4'
headers = {
  'Authorization': 'Bearer {SECRET_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/website/like/85573106-63da-46fa-9434-3bd87e3cd7f4';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {SECRET_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

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

{
    "success": false,
    "message": "Unauthenticated, Please login.",
    "data": []
}
 

Request      

GET api/v1/website/like/{website_uuid}

Headers

Authorization      

Example: Bearer {SECRET_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

website_uuid   string   

The UUID of the website to be liked. Example: 85573106-63da-46fa-9434-3bd87e3cd7f4

Unlike a website

requires authentication

Removes a website from the currently logged in user's favorites.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/website/unlike/85573106-63da-46fa-9434-3bd87e3cd7f4"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/website/unlike/85573106-63da-46fa-9434-3bd87e3cd7f4" \
    --header "Authorization: Bearer {SECRET_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/website/unlike/85573106-63da-46fa-9434-3bd87e3cd7f4'
headers = {
  'Authorization': 'Bearer {SECRET_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/website/unlike/85573106-63da-46fa-9434-3bd87e3cd7f4';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {SECRET_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (401):

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

{
    "success": false,
    "message": "Unauthenticated, Please login.",
    "data": []
}
 

Request      

GET api/v1/website/unlike/{website_uuid}

Headers

Authorization      

Example: Bearer {SECRET_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

website_uuid   string   

The UUID of the website to be unliked. Example: 85573106-63da-46fa-9434-3bd87e3cd7f4

Get liked websites

requires authentication

Gets a list of all websites liked by the currently logged in user.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/website/my-favorites"
);

const params = {
    "page": "1",
    "filters[business]": "d311b28a-17d6-45f8-a05c-032a978d8ca0",
    "filters[lga]": "1",
    "filters[state]": "1",
    "filters[country]": "161",
    "filters[createdAt]": "15-06-2024",
    "filters[updatedAt]": "15-06-2024",
    "include": "business",
    "sort": "-domainName",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/website/my-favorites?page=1&filters[business]=d311b28a-17d6-45f8-a05c-032a978d8ca0&filters[lga]=1&filters[state]=1&filters[country]=161&filters[createdAt]=15-06-2024&filters[updatedAt]=15-06-2024&include=business&sort=-domainName" \
    --header "Authorization: Bearer {SECRET_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/website/my-favorites'
params = {
  'page': '1',
  'filters[business]': 'd311b28a-17d6-45f8-a05c-032a978d8ca0',
  'filters[lga]': '1',
  'filters[state]': '1',
  'filters[country]': '161',
  'filters[createdAt]': '15-06-2024',
  'filters[updatedAt]': '15-06-2024',
  'include': 'business',
  'sort': '-domainName',
}
headers = {
  'Authorization': 'Bearer {SECRET_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/website/my-favorites';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {SECRET_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page' => '1',
            'filters[business]' => 'd311b28a-17d6-45f8-a05c-032a978d8ca0',
            'filters[lga]' => '1',
            'filters[state]' => '1',
            'filters[country]' => '161',
            'filters[createdAt]' => '15-06-2024',
            'filters[updatedAt]' => '15-06-2024',
            'include' => 'business',
            'sort' => '-domainName',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "website",
        "id": "3751b90c-710e-4961-a4c6-1293f5d012ab",
        "attributes": {
            "meta": {
                "id": "3751b90c-710e-4961-a4c6-1293f5d012ab",
                "template": null,
                "status": "draft",
                "domainUrl": "-8MDdB.ngr.ltd",
                "thumbnail": ""
            },
            "navigation": {
                "logo": {
                    "src": "https://via.placeholder.com/640x480.png/00dd33?text=architecto",
                    "alt": "et animi quos"
                },
                "links": [],
                "cta": {
                    "label": "Et fugiat.",
                    "url": "http://www.dach.com/mollitia-modi-deserunt-aut-ab-provident-perspiciatis-quo.html"
                }
            },
            "hero": {
                "title": "omnis nostrum aut",
                "subtitle": "adipisci quidem nostrum",
                "image": {
                    "src": "https://via.placeholder.com/640x480.png/0077ff?text=qui",
                    "alt": "incidunt iure odit"
                },
                "cta": {
                    "label": "Et modi ipsum.",
                    "url": "http://www.predovic.biz/consequatur-aut-dolores-enim-non-facere-tempora.html"
                }
            },
            "services": {
                "title": "Voluptatem laboriosam praesentium.",
                "imageSrc": "",
                "imageAlt": null,
                "description": "Adipisci molestias fugit deleniti distinctio eum doloremque id.",
                "items": []
            },
            "testimonials": {
                "title": "Libero aliquam veniam corporis.",
                "imageSrc": "",
                "imageAlt": null,
                "description": "Mollitia deleniti nemo.",
                "items": []
            },
            "footer": {
                "address": "633 Ward Dale\nNorth Eileen, AL 06985",
                "primaryPhone": "234-623-5439",
                "secondaryPhone": "+1 (432) 789-7092",
                "email": "garett.runolfsson@yahoo.com",
                "columns": [],
                "social": {
                    "facebook": null,
                    "instagram": null,
                    "linkedin": null,
                    "threads": null,
                    "tiktok": null,
                    "x": null
                }
            }
        },
        "includes": {
            "business": null
        },
        "relationships": []
    }
}
 

Request      

GET api/v1/website/my-favorites

Headers

Authorization      

Example: Bearer {SECRET_KEY}

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

The page to view. Example: 1

filters   object  optional  

Fields to filter by

filters.business   string  optional  

Filter by the owners of the websites (can be comma-separated for multiple values. eg 1,2,3). Example: d311b28a-17d6-45f8-a05c-032a978d8ca0

filters.lga   string  optional  

Filter by the lga of the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 1

filters.state   string  optional  

Filter by the state to filter the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 1

filters.country   integer  optional  

Filter by the country of the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 161

filters.createdAt   string  optional  

Filter by date created (can be comma-separated for multiple values. eg 12-06-2024,15-06-2024). Example: 15-06-2024

filters.updatedAt   string  optional  

Filter by date created (can be comma-separated for multiple values. eg 12-06-2024,15-06-2024). Example: 15-06-2024

include   string  optional  

The optional parameters to load optional data (business and owner. eg business,owner). Example: business

sort   string  optional  

The property to sort the websites by (can be comma-separated for multiple values. (- means descending) eg -domainName,createdAt,publishedAt). Example: -domainName

Update a website

requires authentication

Update the specified website in storage.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/website/1"
);

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

const body = new FormData();
body.append('templateId', 'bcde9570-e2e1-4153-b78c-8e37a112a0f8');
body.append('status', 'draft');
body.append('navigation[logoAlt]', 'Company Logo');
body.append('navigation[ctaLabel]', 'Get Started');
body.append('navigation[ctaUrl]', '/get-started');
body.append('hero[title]', 'Welcome to Our Website');
body.append('hero[subtitle]', 'We provide the best services');
body.append('hero[imageAlt]', 'b');
body.append('hero[ctaLabel]', 'n');
body.append('hero[ctaUrl]', 'http://crooks.biz/et-fugiat-sunt-nihil-accusantium');
body.append('service[title]', 'Our Services');
body.append('service[description]', 'We offer a wide range of services.');
body.append('service[imageAlt]', 'Services section');
body.append('service[items][][id]', '16');
body.append('service[items][][title]', 'n');
body.append('service[items][][description]', 'Eius et animi quos velit et.');
body.append('service[items][][imageAlt]', 'architecto');
body.append('service[items][][ctaLabel]', 'n');
body.append('service[items][][ctaUrl]', 'http://crooks.biz/et-fugiat-sunt-nihil-accusantium');
body.append('testimonial[title]', 'What Our Clients Say');
body.append('testimonial[description]', 'We offer a wide range of testimonials.');
body.append('testimonial[imageAlt]', 'architecto');
body.append('testimonial[items][][id]', '1');
body.append('testimonial[items][][title]', 'John Doe');
body.append('testimonial[items][][description]', 'This company is amazing!');
body.append('testimonial[items][][position]', 'CEO, Example Corp');
body.append('testimonial[items][][imageSrc]', 'public\img\logo.png');
body.append('testimonial[items][][imageAlt]', 'Expert advice in your field');
body.append('footer[address]', '133, Agege motor road, Mushin, Lagos.');
body.append('footer[phonePrimary]', '+23407557560481');
body.append('footer[phoneSecondary]', '+2348097745547');
body.append('footer[email]', 'business@gmail.com');
body.append('footer[social][]', 'http://bailey.com/');
body.append('regenerate[section]', 'footer');
body.append('thumbnail', document.querySelector('input[name="thumbnail"]').files[0]);
body.append('navigation[logoSrc]', document.querySelector('input[name="navigation[logoSrc]"]').files[0]);
body.append('hero[imageSrc]', document.querySelector('input[name="hero[imageSrc]"]').files[0]);
body.append('service[imageSrc]', document.querySelector('input[name="service[imageSrc]"]').files[0]);
body.append('service[items][][imageSrc]', document.querySelector('input[name="service[items][][imageSrc]"]').files[0]);
body.append('testimonial[imageSrc]', document.querySelector('input[name="testimonial[imageSrc]"]').files[0]);

fetch(url, {
    method: "PUT",
    headers,
    body,
}).then(response => response.json());
curl --request PUT \
    "https://api.ngr.ltd/api/v1/website/1" \
    --header "Authorization: Bearer {SECRET_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "templateId=bcde9570-e2e1-4153-b78c-8e37a112a0f8"\
    --form "status=draft"\
    --form "navigation[logoAlt]=Company Logo"\
    --form "navigation[ctaLabel]=Get Started"\
    --form "navigation[ctaUrl]=/get-started"\
    --form "hero[title]=Welcome to Our Website"\
    --form "hero[subtitle]=We provide the best services"\
    --form "hero[imageAlt]=b"\
    --form "hero[ctaLabel]=n"\
    --form "hero[ctaUrl]=http://crooks.biz/et-fugiat-sunt-nihil-accusantium"\
    --form "service[title]=Our Services"\
    --form "service[description]=We offer a wide range of services."\
    --form "service[imageAlt]=Services section"\
    --form "service[items][][id]=16"\
    --form "service[items][][title]=n"\
    --form "service[items][][description]=Eius et animi quos velit et."\
    --form "service[items][][imageAlt]=architecto"\
    --form "service[items][][ctaLabel]=n"\
    --form "service[items][][ctaUrl]=http://crooks.biz/et-fugiat-sunt-nihil-accusantium"\
    --form "testimonial[title]=What Our Clients Say"\
    --form "testimonial[description]=We offer a wide range of testimonials."\
    --form "testimonial[imageAlt]=architecto"\
    --form "testimonial[items][][id]=1"\
    --form "testimonial[items][][title]=John Doe"\
    --form "testimonial[items][][description]=This company is amazing!"\
    --form "testimonial[items][][position]=CEO, Example Corp"\
    --form "testimonial[items][][imageSrc]=public\img\logo.png"\
    --form "testimonial[items][][imageAlt]=Expert advice in your field"\
    --form "footer[address]=133, Agege motor road, Mushin, Lagos."\
    --form "footer[phonePrimary]=+23407557560481"\
    --form "footer[phoneSecondary]=+2348097745547"\
    --form "footer[email]=business@gmail.com"\
    --form "footer[social][]=http://bailey.com/"\
    --form "regenerate[section]=footer"\
    --form "thumbnail=@C:\laragon\www\ngrBE\public\img\logo.png" \
    --form "navigation[logoSrc]=@C:\laragon\www\ngrBE\public\img\logo.png" \
    --form "hero[imageSrc]=@C:\laragon\www\ngrBE\public\img\logo.png" \
    --form "service[imageSrc]=@C:\laragon\www\ngrBE\public\img\logo.png" \
    --form "service[items][][imageSrc]=@C:\Users\victo\AppData\Local\Temp\php4786.tmp" \
    --form "testimonial[imageSrc]=@C:\Users\victo\AppData\Local\Temp\php4785.tmp" 
import requests
import json

url = 'https://api.ngr.ltd/api/v1/website/1'
files = {
  'templateId': (None, 'bcde9570-e2e1-4153-b78c-8e37a112a0f8'),
  'status': (None, 'draft'),
  'navigation[logoAlt]': (None, 'Company Logo'),
  'navigation[ctaLabel]': (None, 'Get Started'),
  'navigation[ctaUrl]': (None, '/get-started'),
  'hero[title]': (None, 'Welcome to Our Website'),
  'hero[subtitle]': (None, 'We provide the best services'),
  'hero[imageAlt]': (None, 'b'),
  'hero[ctaLabel]': (None, 'n'),
  'hero[ctaUrl]': (None, 'http://crooks.biz/et-fugiat-sunt-nihil-accusantium'),
  'service[title]': (None, 'Our Services'),
  'service[description]': (None, 'We offer a wide range of services.'),
  'service[imageAlt]': (None, 'Services section'),
  'service[items][][id]': (None, '16'),
  'service[items][][title]': (None, 'n'),
  'service[items][][description]': (None, 'Eius et animi quos velit et.'),
  'service[items][][imageAlt]': (None, 'architecto'),
  'service[items][][ctaLabel]': (None, 'n'),
  'service[items][][ctaUrl]': (None, 'http://crooks.biz/et-fugiat-sunt-nihil-accusantium'),
  'testimonial[title]': (None, 'What Our Clients Say'),
  'testimonial[description]': (None, 'We offer a wide range of testimonials.'),
  'testimonial[imageAlt]': (None, 'architecto'),
  'testimonial[items][][id]': (None, '1'),
  'testimonial[items][][title]': (None, 'John Doe'),
  'testimonial[items][][description]': (None, 'This company is amazing!'),
  'testimonial[items][][position]': (None, 'CEO, Example Corp'),
  'testimonial[items][][imageSrc]': (None, 'public\img\logo.png'),
  'testimonial[items][][imageAlt]': (None, 'Expert advice in your field'),
  'footer[address]': (None, '133, Agege motor road, Mushin, Lagos.'),
  'footer[phonePrimary]': (None, '+23407557560481'),
  'footer[phoneSecondary]': (None, '+2348097745547'),
  'footer[email]': (None, 'business@gmail.com'),
  'footer[social][]': (None, 'http://bailey.com/'),
  'regenerate[section]': (None, 'footer'),
  'thumbnail': open('C:\laragon\www\ngrBE\public\img\logo.png', 'rb'),
  'navigation[logoSrc]': open('C:\laragon\www\ngrBE\public\img\logo.png', 'rb'),
  'hero[imageSrc]': open('C:\laragon\www\ngrBE\public\img\logo.png', 'rb'),
  'service[imageSrc]': open('C:\laragon\www\ngrBE\public\img\logo.png', 'rb'),
  'service[items][][imageSrc]': open('C:\Users\victo\AppData\Local\Temp\php4786.tmp', 'rb'),
  'testimonial[imageSrc]': open('C:\Users\victo\AppData\Local\Temp\php4785.tmp', 'rb')}
payload = {
    "templateId": "bcde9570-e2e1-4153-b78c-8e37a112a0f8",
    "status": "draft",
    "navigation": {
        "logoAlt": "Company Logo",
        "ctaLabel": "Get Started",
        "ctaUrl": "\/get-started"
    },
    "hero": {
        "title": "Welcome to Our Website",
        "subtitle": "We provide the best services",
        "imageAlt": "b",
        "ctaLabel": "n",
        "ctaUrl": "http:\/\/crooks.biz\/et-fugiat-sunt-nihil-accusantium"
    },
    "service": {
        "title": "Our Services",
        "description": "We offer a wide range of services.",
        "imageAlt": "Services section",
        "items": [
            {
                "id": 16,
                "title": "n",
                "description": "Eius et animi quos velit et.",
                "imageAlt": "architecto",
                "ctaLabel": "n",
                "ctaUrl": "http:\/\/crooks.biz\/et-fugiat-sunt-nihil-accusantium"
            }
        ]
    },
    "testimonial": {
        "title": "What Our Clients Say",
        "description": "We offer a wide range of testimonials.",
        "imageAlt": "architecto",
        "items": [
            {
                "id": 1,
                "title": "John Doe",
                "description": "This company is amazing!",
                "position": "CEO, Example Corp",
                "imageSrc": "public\\img\\logo.png",
                "imageAlt": "Expert advice in your field"
            },
            {
                "id": 2,
                "title": "Jane Smith",
                "description": "Highly recommend their services.",
                "position": "CTO, Tech Inc",
                "imageSrc": "public\\img\\logo.png",
                "imageAlt": "Expert advice in your field"
            }
        ]
    },
    "footer": {
        "address": "133, Agege motor road, Mushin, Lagos.",
        "phonePrimary": "+23407557560481",
        "phoneSecondary": "+2348097745547",
        "email": "business@gmail.com",
        "social": [
            "http:\/\/bailey.com\/"
        ]
    },
    "regenerate": {
        "section": "footer"
    }
}
headers = {
  'Authorization': 'Bearer {SECRET_KEY}',
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

response = requests.request('PUT', url, headers=headers, files=files)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/website/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Authorization' => 'Bearer {SECRET_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'templateId',
                'contents' => 'bcde9570-e2e1-4153-b78c-8e37a112a0f8'
            ],
            [
                'name' => 'status',
                'contents' => 'draft'
            ],
            [
                'name' => 'navigation[logoAlt]',
                'contents' => 'Company Logo'
            ],
            [
                'name' => 'navigation[ctaLabel]',
                'contents' => 'Get Started'
            ],
            [
                'name' => 'navigation[ctaUrl]',
                'contents' => '/get-started'
            ],
            [
                'name' => 'hero[title]',
                'contents' => 'Welcome to Our Website'
            ],
            [
                'name' => 'hero[subtitle]',
                'contents' => 'We provide the best services'
            ],
            [
                'name' => 'hero[imageAlt]',
                'contents' => 'b'
            ],
            [
                'name' => 'hero[ctaLabel]',
                'contents' => 'n'
            ],
            [
                'name' => 'hero[ctaUrl]',
                'contents' => 'http://crooks.biz/et-fugiat-sunt-nihil-accusantium'
            ],
            [
                'name' => 'service[title]',
                'contents' => 'Our Services'
            ],
            [
                'name' => 'service[description]',
                'contents' => 'We offer a wide range of services.'
            ],
            [
                'name' => 'service[imageAlt]',
                'contents' => 'Services section'
            ],
            [
                'name' => 'service[items][][id]',
                'contents' => '16'
            ],
            [
                'name' => 'service[items][][title]',
                'contents' => 'n'
            ],
            [
                'name' => 'service[items][][description]',
                'contents' => 'Eius et animi quos velit et.'
            ],
            [
                'name' => 'service[items][][imageAlt]',
                'contents' => 'architecto'
            ],
            [
                'name' => 'service[items][][ctaLabel]',
                'contents' => 'n'
            ],
            [
                'name' => 'service[items][][ctaUrl]',
                'contents' => 'http://crooks.biz/et-fugiat-sunt-nihil-accusantium'
            ],
            [
                'name' => 'testimonial[title]',
                'contents' => 'What Our Clients Say'
            ],
            [
                'name' => 'testimonial[description]',
                'contents' => 'We offer a wide range of testimonials.'
            ],
            [
                'name' => 'testimonial[imageAlt]',
                'contents' => 'architecto'
            ],
            [
                'name' => 'testimonial[items][][id]',
                'contents' => '1'
            ],
            [
                'name' => 'testimonial[items][][title]',
                'contents' => 'John Doe'
            ],
            [
                'name' => 'testimonial[items][][description]',
                'contents' => 'This company is amazing!'
            ],
            [
                'name' => 'testimonial[items][][position]',
                'contents' => 'CEO, Example Corp'
            ],
            [
                'name' => 'testimonial[items][][imageSrc]',
                'contents' => 'public\img\logo.png'
            ],
            [
                'name' => 'testimonial[items][][imageAlt]',
                'contents' => 'Expert advice in your field'
            ],
            [
                'name' => 'footer[address]',
                'contents' => '133, Agege motor road, Mushin, Lagos.'
            ],
            [
                'name' => 'footer[phonePrimary]',
                'contents' => '+23407557560481'
            ],
            [
                'name' => 'footer[phoneSecondary]',
                'contents' => '+2348097745547'
            ],
            [
                'name' => 'footer[email]',
                'contents' => 'business@gmail.com'
            ],
            [
                'name' => 'footer[social][]',
                'contents' => 'http://bailey.com/'
            ],
            [
                'name' => 'regenerate[section]',
                'contents' => 'footer'
            ],
            [
                'name' => 'thumbnail',
                'contents' => fopen('C:\laragon\www\ngrBE\public\img\logo.png', 'r')
            ],
            [
                'name' => 'navigation[logoSrc]',
                'contents' => fopen('C:\laragon\www\ngrBE\public\img\logo.png', 'r')
            ],
            [
                'name' => 'hero[imageSrc]',
                'contents' => fopen('C:\laragon\www\ngrBE\public\img\logo.png', 'r')
            ],
            [
                'name' => 'service[imageSrc]',
                'contents' => fopen('C:\laragon\www\ngrBE\public\img\logo.png', 'r')
            ],
            [
                'name' => 'service[items][][imageSrc]',
                'contents' => fopen('C:\Users\victo\AppData\Local\Temp\php4786.tmp', 'r')
            ],
            [
                'name' => 'testimonial[imageSrc]',
                'contents' => fopen('C:\Users\victo\AppData\Local\Temp\php4785.tmp', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "website",
        "id": "a6deea3e-0993-420c-a687-f8c596c3ca0d",
        "attributes": {
            "meta": {
                "id": "a6deea3e-0993-420c-a687-f8c596c3ca0d",
                "template": null,
                "status": "draft",
                "domainUrl": "-VYa3P.ngr.ltd",
                "thumbnail": ""
            },
            "navigation": {
                "logo": {
                    "src": "https://via.placeholder.com/640x480.png/003355?text=et",
                    "alt": "quos velit et"
                },
                "links": [],
                "cta": {
                    "label": "Sunt nihil.",
                    "url": "http://www.dickens.com/deserunt-aut-ab-provident-perspiciatis-quo-omnis-nostrum"
                }
            },
            "hero": {
                "title": "aut adipisci quidem",
                "subtitle": "nostrum qui commodi",
                "image": {
                    "src": "https://via.placeholder.com/640x480.png/00ffee?text=incidunt",
                    "alt": "odit et et"
                },
                "cta": {
                    "label": "Ipsum nostrum omnis.",
                    "url": "http://mclaughlin.info/dolores-enim-non-facere-tempora"
                }
            },
            "services": {
                "title": "Voluptatem laboriosam praesentium.",
                "imageSrc": "",
                "imageAlt": null,
                "description": "Adipisci molestias fugit deleniti distinctio eum doloremque id.",
                "items": []
            },
            "testimonials": {
                "title": "Libero aliquam veniam corporis.",
                "imageSrc": "",
                "imageAlt": null,
                "description": "Mollitia deleniti nemo.",
                "items": []
            },
            "footer": {
                "address": "633 Ward Dale\nNorth Eileen, AL 06985",
                "primaryPhone": "234-623-5439",
                "secondaryPhone": "+1 (432) 789-7092",
                "email": "garett.runolfsson@yahoo.com",
                "columns": [],
                "social": {
                    "facebook": null,
                    "instagram": null,
                    "linkedin": null,
                    "threads": null,
                    "tiktok": null,
                    "x": null
                }
            }
        },
        "includes": {
            "business": null
        },
        "relationships": []
    }
}
 

Request      

PUT api/v1/website/{uuid}

Headers

Authorization      

Example: Bearer {SECRET_KEY}

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

URL Parameters

uuid   integer   

Example: 1

website_uuid   string   

The UUID of the website. Example: 85573106-63da-46fa-9434-3bd87e3cd7f4

Body Parameters

templateId   string  optional  

The ID of the template to use for the website. Example: bcde9570-e2e1-4153-b78c-8e37a112a0f8

status   string  optional  

Publish or unpublish the website. Example: draft

Must be one of:
  • draft
  • published
thumbnail   file  optional  

Thumbnail of the website. Must be an image. Must not be greater than 5000 kilobytes. Example: public\img\logo.png

navigation   object  optional  
logoSrc   file  optional  

URL of the logo image. Must be an image. Must not be greater than 5000 kilobytes. Example: public\img\logo.png

logoAlt   string  optional  

Alt text for the logo image. Must not be greater than 255 characters. Example: Company Logo

ctaLabel   string  optional  

Label for the Call-To-Action button. Must not be greater than 50 characters. Example: Get Started

ctaUrl   string  optional  

URL that the Call-To-Action button points to. Example: /get-started

hero   object  optional  
title   string  optional  

The main title text for the hero section. Must not be greater than 255 characters. Example: Welcome to Our Website

subtitle   string  optional  

The subtitle text for the hero section. Must not be greater than 255 characters. Example: We provide the best services

imageSrc   file  optional  

Hero section background image. Must be an image. Must not be greater than 5000 kilobytes. Example: public\img\logo.png

imageAlt   string  optional  

Must not be greater than 255 characters. Example: b

ctaLabel   string  optional  

Must not be greater than 50 characters. Example: n

ctaUrl   string  optional  

Must be a valid URL. Example: http://crooks.biz/et-fugiat-sunt-nihil-accusantium

service   object  optional  
title   string  optional  

Title text for the services section. Must not be greater than 255 characters. Example: Our Services

description   string  optional  

Description text for the services section. Example: We offer a wide range of services.

imageSrc   file  optional  

Service section background image. Must be an image. Must not be greater than 5000 kilobytes. Example: public\img\logo.png

imageAlt   string  optional  

Alt text for the logo image. Example: Services section

items   object[]  optional  
id   integer  optional  

Example: 16

title   string  optional  

This field is required when service.items is present. Must not be greater than 255 characters. Example: n

description   string  optional  

This field is required when service.items is present. Example: Eius et animi quos velit et.

imageSrc   file  optional  

Must be an image. Must not be greater than 5000 kilobytes. Example: C:\Users\victo\AppData\Local\Temp\php4786.tmp

imageAlt   string  optional  

Example: architecto

ctaLabel   string  optional  

Must not be greater than 50 characters. Example: n

ctaUrl   string  optional  

Must be a valid URL. Example: http://crooks.biz/et-fugiat-sunt-nihil-accusantium

testimonial   object  optional  
title   string  optional  

Title text for the testimonials section. Must not be greater than 255 characters. Example: What Our Clients Say

description   string  optional  

Description text for the testimonials section. Example: We offer a wide range of testimonials.

imageSrc   file  optional  

Must be an image. Must not be greater than 5000 kilobytes. Example: C:\Users\victo\AppData\Local\Temp\php4785.tmp

imageAlt   string  optional  

Example: architecto

items   object[]  optional  

An array of testimonial items. To update, pass a value to id. Otherwise, it creates a new testimonial item for this item.

id   integer  optional  

Example: 16

title   string  optional  

This field is required when testimonials.items is present. Must not be greater than 255 characters. Example: n

description   string  optional  

This field is required when testimonials.items is present. Example: Eius et animi quos velit et.

imageSrc   file  optional  

Must be an image. Must not be greater than 5000 kilobytes. Example: C:\Users\victo\AppData\Local\Temp\php4787.tmp

imageAlt   string  optional  

Example: architecto

position   string  optional  

Must not be greater than 255 characters. Example: n

footer   object  optional  
address   string  optional  

The Business address. Must not be greater than 255 characters. Example: 133, Agege motor road, Mushin, Lagos.

phonePrimary   string   

The Business phone number. Must not be greater than 15 characters. Example: +23407557560481

phoneSecondary   string   

The Business alternative phone number. Must not be greater than 15 characters. Example: +2348097745547

email   string  optional  

The email address of the Business. Must be a valid email address. Example: business@gmail.com

social   string[]  optional  

Must be a valid URL.

regenerate   object  optional  
section   string  optional  

The section of the website to regenerate with AI. This field is required when regenerate is present. Example: footer

Must be one of:
  • navigation
  • hero
  • service
  • testimonial
  • footer

Get websites

Gets a list of all published websites.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/website"
);

const params = {
    "page": "1",
    "filters[business]": "d311b28a-17d6-45f8-a05c-032a978d8ca0",
    "filters[lga]": "1",
    "filters[state]": "1",
    "filters[country]": "161",
    "filters[createdAt]": "15-06-2024",
    "filters[updatedAt]": "15-06-2024",
    "include": "business",
    "sort": "-domainName",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/website?page=1&filters[business]=d311b28a-17d6-45f8-a05c-032a978d8ca0&filters[lga]=1&filters[state]=1&filters[country]=161&filters[createdAt]=15-06-2024&filters[updatedAt]=15-06-2024&include=business&sort=-domainName" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/website'
params = {
  'page': '1',
  'filters[business]': 'd311b28a-17d6-45f8-a05c-032a978d8ca0',
  'filters[lga]': '1',
  'filters[state]': '1',
  'filters[country]': '161',
  'filters[createdAt]': '15-06-2024',
  'filters[updatedAt]': '15-06-2024',
  'include': 'business',
  'sort': '-domainName',
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/website';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'page' => '1',
            'filters[business]' => 'd311b28a-17d6-45f8-a05c-032a978d8ca0',
            'filters[lga]' => '1',
            'filters[state]' => '1',
            'filters[country]' => '161',
            'filters[createdAt]' => '15-06-2024',
            'filters[updatedAt]' => '15-06-2024',
            'include' => 'business',
            'sort' => '-domainName',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "website",
        "id": "2abbce56-cdc3-4ef9-8df1-200939387db5",
        "attributes": {
            "meta": {
                "id": "2abbce56-cdc3-4ef9-8df1-200939387db5",
                "template": null,
                "status": "draft",
                "domainUrl": "-qNbNw.ngr.ltd",
                "thumbnail": ""
            }
        },
        "includes": {
            "business": null
        },
        "relationships": []
    }
}
 

Request      

GET api/v1/website

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

page   integer  optional  

The page to view. Example: 1

filters   object  optional  

Fields to filter by

filters.business   string  optional  

Filter by the owners of the websites (can be comma-separated for multiple values. eg 1,2,3). Example: d311b28a-17d6-45f8-a05c-032a978d8ca0

filters.lga   string  optional  

Filter by the lga of the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 1

filters.state   string  optional  

Filter by the state to filter the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 1

filters.country   integer  optional  

Filter by the country of the businesses (can be comma-separated for multiple values. eg 1,2,3). Example: 161

filters.createdAt   string  optional  

Filter by date created (can be comma-separated for multiple values. eg 12-06-2024,15-06-2024). Example: 15-06-2024

filters.updatedAt   string  optional  

Filter by date created (can be comma-separated for multiple values. eg 12-06-2024,15-06-2024). Example: 15-06-2024

include   string  optional  

The optional parameters to load optional data (business and owner. eg business,owner). Example: business

sort   string  optional  

The property to sort the websites by (can be comma-separated for multiple values. (- means descending) eg -domainName,createdAt,publishedAt). Example: -domainName

Fetch website

Gets the details of a specified website by passing it's id or domain.

Example request:
const url = new URL(
    "https://api.ngr.ltd/api/v1/website/85573106-63da-46fa-9434-3bd87e3cd7f4 or 3d7tech or 3d7tech.ngr.ltd"
);

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

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
curl --request GET \
    --get "https://api.ngr.ltd/api/v1/website/85573106-63da-46fa-9434-3bd87e3cd7f4 or 3d7tech or 3d7tech.ngr.ltd" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
import requests
import json

url = 'https://api.ngr.ltd/api/v1/website/85573106-63da-46fa-9434-3bd87e3cd7f4 or 3d7tech or 3d7tech.ngr.ltd'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()
$client = new \GuzzleHttp\Client();
$url = 'https://api.ngr.ltd/api/v1/website/85573106-63da-46fa-9434-3bd87e3cd7f4 or 3d7tech or 3d7tech.ngr.ltd';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "type": "website",
        "id": "011dbaf2-1ba9-45dd-a4c5-385821bf0ddc",
        "attributes": {
            "meta": {
                "id": "011dbaf2-1ba9-45dd-a4c5-385821bf0ddc",
                "template": null,
                "status": "draft",
                "domainUrl": "-db9gD.ngr.ltd",
                "thumbnail": ""
            },
            "navigation": {
                "logo": {
                    "src": "https://via.placeholder.com/640x480.png/00aaff?text=dolores",
                    "alt": "maiores assumenda odit"
                },
                "links": [],
                "cta": {
                    "label": "Repellat officiis.",
                    "url": "http://kreiger.info/"
                }
            },
            "hero": {
                "title": "ratione iure impedit",
                "subtitle": "molestiae ut rem",
                "image": {
                    "src": "https://via.placeholder.com/640x480.png/005544?text=est",
                    "alt": "sint aut molestiae"
                },
                "cta": {
                    "label": "Suscipit doloribus fugiat.",
                    "url": "http://bogan.com/error-neque-recusandae-et-ipsam-dolorem-et-ut-dicta"
                }
            },
            "services": {
                "title": "Assumenda consequatur ut.",
                "imageSrc": "",
                "imageAlt": null,
                "description": "Sunt quisquam sit repellendus.",
                "items": []
            },
            "testimonials": {
                "title": "Eaque alias ratione dolores.",
                "imageSrc": "",
                "imageAlt": null,
                "description": "Rem ea ut.",
                "items": []
            },
            "footer": {
                "address": "168 Cordia Landing\nLake Dominic, IA 73644-9666",
                "primaryPhone": "+1.925.928.0065",
                "secondaryPhone": "406.562.4053",
                "email": "wilmer.kilback@yahoo.com",
                "columns": [],
                "social": {
                    "facebook": null,
                    "instagram": null,
                    "linkedin": null,
                    "threads": null,
                    "tiktok": null,
                    "x": null
                }
            }
        },
        "includes": {
            "business": null
        },
        "relationships": []
    }
}
 

Request      

GET api/v1/website/{identifier}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

identifier   string   

The identifier of the website. Example: 85573106-63da-46fa-9434-3bd87e3cd7f4 or 3d7tech or 3d7tech.ngr.ltd