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
Request OTP
https://api.applink.com.bd/otp/requestThis 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
applicationIdstringRequired- Used to identify the application. This is a unique identifier generated while provisioning an application. Only a single value can be sent per request.Example
APP_000375 passwordstringRequired- This API key will be sent to your registered email address on the platform upon application approval.Example
a07118cda5215fc6d01db5b2ab848edd subscriberIdstringRequired- Mobile number of the subscriber In the format: "tel:8801416177301"Example
tel:8801416177301 applicationHashstringOptional- Hash string to determine which verification messages to send to your app.Example
abcdefgh applicationMetaDataobjectOptional- ·
applicationMetaData.clientENUMOptional- Client type. values will be web browser or mobile appExample
MOBILEAPP applicationMetaData.devicestringOptional- Type/OS of device iPhone 6,Galaxy S5,PC, etc.Example
Samsung S10 applicationMetaData.osstringOptional- OS/Device version Android 6, iOS 5, Windows 10 etc.Example
android 8 applicationMetaData.appCodestringOptional- If you use app in store, your app identifier. If you use the web browser, web linkExample
https://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
versionstringRequired- 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.Example
1.0 statusCodestringRequired- Status code for the request. S = success, E = error, P = partial. See the status code table.Example
S1000 referenceNostringRequired- Reference key to uniquely Identify the requestExample
213561321321613 statusDetailstringRequired- Human-readable description of the status. See the status code table.Example
Success
{
"version": "1.0",
"statusCode": "S1000",
"referenceNo": "213561321321613",
"statusDetail": "Success"
}Status codes this endpoint returns6
S1000 | Successfully sent the OTP challenge to [msisdn/sender ID]. |
|---|---|
E1301 | Requested ApplicationID is not allowed within the System for operator. |
E1312 | Invalid request - Missing mandatory field. |
E1313 | Authentication failure. There is no active application, or no active service provider or given password in the request is invalid. |
E1603 | Temporary system error occurred while delivering your request. |
E1856 | Invalid Request. |
Verify OTP
https://api.applink.com.bd/otp/verifyThis 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
applicationIdstringRequired- Used to identify the application. This is a unique identifier generated while provisioning an application. Only a single value can be sent per request.Example
APP_000375 passwordstringRequired- This API key will be sent to your registered email address on the platform upon application approval.Example
a07118cda5215fc6d01db5b2ab848edd referenceNostringRequired- Reference number returned with request OTP API See request OTP API response for more informationExample
213561321321613 otpstringRequired- One time password (OTP) to be used for MSISDN verification for the applicationExample
123564
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
versionstringRequired- 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.Example
1.0 statusCodestringRequired- Status code for the request. S = success, E = error, P = partial. See the status code table.Example
S1000 subscriptionStatusstringRequired- Subscription status of the user Status of the subscription as INITIAL, and REGISTEREDExample
REGISTERED statusDetailstringRequired- Human-readable description of the status. See the status code table.Example
Success subscriberIdstringRequired- 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.Example
tel:8801416177301
{
"version": "1.0",
"statusCode": "S1000",
"subscriptionStatus": "REGISTERED",
"statusDetail": "Success",
"subscriberId": "tel:8801416177301"
}Status codes this endpoint returns6
S1000 | Successfully validated OTP for [msisdn/sender ID]. |
|---|---|
E1850 | Invalid OTP. |
E1851 | OTP request has been expired. |
E1855 | Invalid reference number. |
E1603 | Temporary system error occurred while delivering your request. |
E1856 | Invalid Request. |