Nofbox API Documentation
Base URL:
https://connect.nofbox.com/api
All endpoints:
- Use
POSTmethod - Require
Content-Type: application/json - Require
X-Api-Keyheader - Require
usernamein body parameter
Authentication
Every request must include your API key:
X-Api-Key: your_api_key
Example:
curl --header 'x-api-key: your_api_key'
Account Linking
Before sending OTP or notifications, each user must link their Nofbox account to your application.
Endpoint
POST /link-account
Request
curl --request POST \
--url https://connect.nofbox.com/api/link-account \
--header 'content-type: application/json' \
--header 'x-api-key: rmiqccbiqmse832ozwermiqccbiakjrtt13vzd' \
--data '{
"username": "johndoe"
}'
Response (User not linked)
{
"linked": false,
"message": "User not linked"
}
In this case you must provide a link to Nofbox Portal. Please add return_url so that user will be redirected to that url after accepting linking request.
https://portal.nofbox.com/linking/{your-app-id}?return_url=https://your-app.com/current-page
Response (Already linked)
{
"linked": true,
"username": "johndoe",
"email": "johndoe@gmail.com",
"phone": "54dcb9a641309112d81709ffa1da605a-9982",
}
Send OTP
Send an OTP message.
Endpoint
POST /otp
Request
curl --request POST \
--url https://connect.nofbox.com/api/otp \
--header 'content-type: application/json' \
--header 'x-api-key: r7ityaiqx5t0snzxblr7ityaiasesc5mqxho' \
--data '{
"username": "johndoe",
"reference": "login",
"message": "Use this OTP code to login to Your-App"
}'
Body Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | Nofbox username |
| reference | string | Yes | OTP identifier reference |
| message | string | Yes | OTP information |
Response
{
"success": true
}
Verify OTP
Verify OTP code sent to the user.
Endpoint
POST /otp/verify
Request
curl --request POST \
--url https://connect.nofbox.com/api/otp/verify \
--header 'content-type: application/json' \
--header 'x-api-key: r7ityaiqx5t0snzxblr7ityaiasesc5mqxho' \
--data '{
"username": "johndoe",
"reference": "login",
"code": "030628"
}'
Body Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | Nofbox username |
| reference | string | Yes | OTP reference |
| code | string | Yes | OTP code from user |
Response
{
"success": true
}
Send Notification
Send a regular notification message.
Endpoint
POST /notification
Request
curl --request POST \
--url https://connect.nofbox.com/api/notification \
--header 'content-type: application/json' \
--header 'x-api-key: r7ityaiqx5t0snzxblr7ityaiasesc5mqxho' \
--data '{
"username": "johndoe",
"message": "Deposit $1.0 received successfuly"
}'
Body Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | Nofbox username |
| message | string | Yes | Notification message |
Response
{
"success": true
}
Account Unlinking
There is a condition where user wants to stop using your app or wants to change to other Nofbox account.
You can unlink the connection.
Endpoint
POST /link-account/unlink
Request
curl --request POST \
--url https://connect.nofbox.com/api/link-account \
--header 'content-type: application/json' \
--header 'x-api-key: rmiqccbiqmse832ozwermiqccbiakjrtt13vzd' \
--data '{
"username": "johndoe"
}'
Response
{
"success": true
}
Error Response
Example error response:
{
"message": "User not linked"
}
Possible errors:
| Message | Description |
|---|---|
| Invalid API key | API key is invalid |
| User not linked | User has not linked Nofbox account |
| Invalid OTP code | OTP verification failed |
| OTP expired | OTP is no longer valid |
| Missing required field | Required parameter is missing |
Flow Overview
Initial Setup
- Provide link to Nofbox portal with
return_url - User creates account and finish the verification
- User will be redirected to the return URL
- User inputs their nofbox username
- Call
/link-accountwith user provided username - Use the data in the response payload to update a user or create a new one
- Your app can now send OTP and notifications
OTP Flow
- Call
/otp - User receives OTP in Nofbox
- User enters code in your app
- Call
/otp/verify - Your app can now execute any action
Notification Flow
- Call
/notification - User receives message instantly in Nofbox