Bitel
2.0.0
2.0.0
  • Introduction
  • Authorization
  • API Structure
  • General API Errors
  • SMS
    • Introduction
    • Template SMS
    • OTP SMS
    • Single SMS
    • Batch SMS
    • Batch P2P SMS
    • SMS Status
  • Call
    • Introduction
    • OTP Call
    • Single Call
    • Single TTS Call
    • Batch Call
    • Batch TTS Call
    • Call Status
  • Webhook
    • Sms Webhook Events
    • Voice Webhook Events
  • Files
    • Introduction
    • Upload Voice
    • Text To Speech
    • Download Voice
  • Code Samples
    • C#
    • PHP
    • Python
Powered by GitBook
On this page

Was this helpful?

  1. SMS

OTP SMS

Send high priority SMS to black listed numbers

Using OTP API you can send high priority messages that are delivered to black listed numbers.

This api provides a default template for sending messages and only appName and code can be customized.

Template format:

به {appName} خوش آمدید
 کد یکبار مصرف  شما: {code}

The appName and the code is required and must be provided when calling the api.

Send OTP

POST https://api.bitel.rest/api/v2/sms/otp

Request Body

Name
Type
Description

PhoneNumber

string

The target phone number

AppName

string

The name of application, example: Bitel

Code

string

The code that is displayed in the message, example: 1234Ma

{
  "result": {
    "id": "5c6f6f7984d440d3a02663857447205a",
    "gatewayNumber": "10009909",
    "phoneNumber": "0912*******",
    "message": "Hello from Bitel!",
    "requestDate": 1564573464,
    "status": 0,
    "statusText": "Waiting",
    "partCount": 1,
    "price": 0.0 // price is 0 because the message is waiting
  },
  "error": null
}

Sample Request

{
	"code": "1234",
	"phoneNumber": "0912*******",
	"appName": "Bitel"
}

Sample Response

{
  "result": {
    "id": "5c6f6f7984d440d3a02663857447205a",
    "gatewayNumber": "10009909",
    "phoneNumber": "0912*******",
    "message": "Hello from Bitel!",
    "requestDate": 1564573464,
    "status": 0,
    "statusText": "Waiting",
    "partCount": 1,
    "price": 0.0 // price is 0 because the message is waiting
  },
  "error": null
}

Getting SMS Status

Error Codes

Code

Description

InvalidRequest

Submitted data is invalid or missing, most likely the phone number

PreviousTemplate SMSNextSingle SMS

Last updated 5 years ago

Was this helpful?

In order to get the detail of a request, including the delivery status, price and more please refer to API.

Sms Status