API reference

OTP API

Add trusted one-time-password verification to any flow. Confirm a subscriber's number before subscription or sign-up with generation, delivery and validation handled for you.

Base URL
https://api.applink.com.bd
Content type
application/json;charset=utf-8
Endpoints
2
POST

Request OTP

https://api.applink.com.bd/otp/request

This service is used by the developer to request an OTP for a subscriber's MSISDN. Upon the request, an OTP will be generated and sent to the subscriber's MSISDN. This OTP must be entered by the subscriber into the mobile/web application to activate a subscription.

Request body

application/json;charset=utf-8

applicationId
stringRequired
Used to identify the application. This is a unique identifier generated while provisioning an application. Only a single value can be sent per request.
ExampleAPP_000375
password
stringRequired
This API key will be sent to your registered email address on the platform upon application approval.
Examplea07118cda5215fc6d01db5b2ab848edd
subscriberId
stringRequired
Mobile number of the subscriber In the format: "tel:8801416177301"
Exampletel:8801416177301
applicationHash
stringOptional
Hash string to determine which verification messages to send to your app.
Exampleabcdefgh
applicationMetaData
objectOptional
·
applicationMetaData.client
ENUMOptional
Client type. values will be web browser or mobile app
ExampleMOBILEAPP
applicationMetaData.device
stringOptional
Type/OS of device iPhone 6,Galaxy S5,PC, etc.
ExampleSamsung S10
applicationMetaData.os
stringOptional
OS/Device version Android 6, iOS 5, Windows 10 etc.
Exampleandroid 8
applicationMetaData.appCode
stringOptional
If you use app in store, your app identifier. If you use the web browser, web link
Examplehttps://play.google.com/store/apps/details?id=lk
curl -X POST https://api.applink.com.bd/otp/request \
  -H "Content-Type: application/json;charset=utf-8" \
  -d '{
    "applicationId": "APP_000375",
    "password": "a07118cda5215fc6d01db5b2ab848edd",
    "subscriberId": "tel:8801416177301",
    "applicationHash": "abcdefgh",
    "applicationMetaData": {
      "client": "MOBILEAPP",
      "device": "Samsung S10",
      "os": "android 8",
      "appCode": "https://play.google.com/store/apps/details?id=lk"
    }
  }'

Response

version
stringRequired
API version shall be numbered as 1.0, 2.0 etc. If version is specified in the request, same version must be sent in the response. If version is not specified in the request, the latest version will be specified in the response.
Example1.0
statusCode
stringRequired
Status code for the request. S = success, E = error, P = partial. See the status code table.
ExampleS1000
referenceNo
stringRequired
Reference key to uniquely Identify the request
Example213561321321613
statusDetail
stringRequired
Human-readable description of the status. See the status code table.
ExampleSuccess
JSON
{
  "version": "1.0",
  "statusCode": "S1000",
  "referenceNo": "213561321321613",
  "statusDetail": "Success"
}
Status codes this endpoint returns6
Status codes for /otp/request
S1000Successfully sent the OTP challenge to [msisdn/sender ID].
E1301Requested ApplicationID is not allowed within the System for operator.
E1312Invalid request - Missing mandatory field.
E1313Authentication failure. There is no active application, or no active service provider or given password in the request is invalid.
E1603Temporary system error occurred while delivering your request.
E1856Invalid Request.
POST

Verify OTP

https://api.applink.com.bd/otp/verify

This service is used by the developer to verify an OTP entered by a subscriber into the application. Upon a successful verification the subscription process of AppLink will be activated. Note: The OTP dispatched to the subscriber by triggering this API is only valid for 5 minutes

Request body

application/json;charset=utf-8

applicationId
stringRequired
Used to identify the application. This is a unique identifier generated while provisioning an application. Only a single value can be sent per request.
ExampleAPP_000375
password
stringRequired
This API key will be sent to your registered email address on the platform upon application approval.
Examplea07118cda5215fc6d01db5b2ab848edd
referenceNo
stringRequired
Reference number returned with request OTP API See request OTP API response for more information
Example213561321321613
otp
stringRequired
One time password (OTP) to be used for MSISDN verification for the application
Example123564
curl -X POST https://api.applink.com.bd/otp/verify \
  -H "Content-Type: application/json;charset=utf-8" \
  -d '{
    "applicationId": "APP_000375",
    "password": "a07118cda5215fc6d01db5b2ab848edd",
    "referenceNo": "213561321321613",
    "otp": "123564"
  }'

Response

version
stringRequired
API version shall be numbered as 1.0, 2.0 etc. If version is specified in the request, same version must be sent in the response. If version is not specified in the request, the latest version will be specified in the response.
Example1.0
statusCode
stringRequired
Status code for the request. S = success, E = error, P = partial. See the status code table.
ExampleS1000
subscriptionStatus
stringRequired
Subscription status of the user Status of the subscription as INITIAL, and REGISTERED
ExampleREGISTERED
statusDetail
stringRequired
Human-readable description of the status. See the status code table.
ExampleSuccess
subscriberId
stringRequired
Mobile number of the subscriber, either plain (in the format "tel:8801416177301") or masked (tel: followed by an opaque identifier). Whether a plain or a masked number is used depends on whether your application is enabled for plain number usage or masked number usage.
Exampletel:8801416177301
JSON
{
  "version": "1.0",
  "statusCode": "S1000",
  "subscriptionStatus": "REGISTERED",
  "statusDetail": "Success",
  "subscriberId": "tel:8801416177301"
}
Status codes this endpoint returns6
Status codes for /otp/verify
S1000Successfully validated OTP for [msisdn/sender ID].
E1850Invalid OTP.
E1851OTP request has been expired.
E1855Invalid reference number.
E1603Temporary system error occurred while delivering your request.
E1856Invalid Request.