Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Arad ITC User manual

Arad SMS Hub API

www.arad-itc.com
ARAD ITC
Arad API gateway user manual
Arad ITC

Contents
Introduction ..................................................................................................................... 2
Call services .................................................................................................................... 2
Calling the Basic Authentication method ......................................................................... 2
Receive bearer token ...................................................................................................... 2
Send SMS ....................................................................................................................... 4
Receive a message ....................................................................................................... 10
Get message status ...................................................................................................... 11
Receive messages via Pull ........................................................................................... 12
Receive delivery through Pull ........................................................................................ 14
Get user information ...................................................................................................... 16
Error codes.................................................................................................................... 17

1|Page
Arad API gateway user manual
Arad ITC

Introduction
Arad's short message portal provides the possibility of providing various message-
based APIs. Developers can access the services by joining the Arad portal.

Call services
Web services can be called in two ways. The first method is called basic
authentication, which is not recommended due to security weaknesses. In the
second method, you can call other services by calling the Arad TSP service using
the received token (bearer token) from this service. Also, for the operational use
of the services, you must declare your IP to Arad so that you can access the
services.

Calling the Basic Authentication method


In this method, the user's username and password are joined together with a ":"
and it is in base64 format. Then it is placed in the Authorization header with the
keyword "Basic". For example, if the username is "AradUser" and his password is
"AradPassword", we have:

"AradUser:AradPassword"-----> convert to base64 ------>


QXJhZFVzZXI6QXJhZFBhc3N3b3Jk
So, in the Authorization header, we put the value "Basic
QXJhZFVzZXI6QXJhZFBhc3N3b3Jk".

Receive bearer token


To receive the token, do the following and send the requested scope. Each web
service has its own scope. So, you have to request a token separately. If the scope
is not specified, the system defaults to "ApiAccess".

2|Page
Arad API gateway user manual
Arad ITC

header values
Method POST
Content-type x-www-form-urlencoded
address https://baseAddress/connect/token

parameters
scope {your_scope}
username {your_username}
password {your_password}

The answer is as follows:

property type
access_token string
expires_at long
scope string

Sample answer:
{
"access_token": "Your token",
"expires_at": "2022-08-01T05:02:37Z",
"scope": "ApiAccess"
}

3|Page
Arad API gateway user manual
Arad ITC

Send SMS
To send SMS, you can send a list of messages to the web service.

header values
Method POST
Authorization Bearer {your access token} | Basic
address https://baseAddress/api/message/send

parameters
SourceAddress {Sender}
DestinationAddress {Receiver}
MessageText {Message text}
ValidityPeriod {DateTime}
ValidityPeriod date should not be less than one minute and more than 6 hours
(relative to the current time).

The answer is as follows:


property type
message string
succeeded bool
data string
resultCode int
The data parameter contains the return identifiers of the message.

Return identifiers for successful messages are UID format and string type. If the
user needs a return ID in the form of Long, he can use the send address as follows:

https://baseAddress/api/message/send?returnLongId=true

4|Page
Arad API gateway user manual
Arad ITC

Sample request body:


[{
"SourceAddress":"989000xxxx",
"MessageText":"Test 1",
"DestinationAddress":"9891xxxxxxxx"
},
{
"SourceAddress":"989000xxxx",
"MessageText":"Test 2",
"DestinationAddress":"9891xxxxxxxx"
}]

Sample answer:
{
"message": "Successfully done.",
"succeeded": true,
"data": [
"624ed1bbcd0efb1ef148e0a0",
"624ed1bbcd0efb1ef148e0a1"
],
"resultCode": 100
}

5|Page
Arad API gateway user manual
Arad ITC

Send bulk SMS

To send bulk SMS, you can send messages to the web service as follows.

header values
Method POST
Authorization Bearer {your access token} | Basic
address https://baseAddress/api/message/bulk

parameters
SourceAddress {Sender}
DestinationAddress List<{Receiver}>
MessageText {Message text}
ValidityPeriod {DateTime}
ValidityPeriod date should not be less than one minute and more than 6 hours
(relative to the current time).

The answer is as follows:


property type
message string
succeeded bool
data string
resultCode int
The data parameter contains the return identifiers of the message.

Return identifiers for successful messages are UID format and string type. If the
user needs a return ID in the form of Long, he can use the send address as follows:

https://baseAddress/api/message/bulk?returnLongId=true

6|Page
Arad API gateway user manual
Arad ITC

Sample request body:


{
"SourceAddress":"989000xxxx",
"MessageText":"Test",
"DestinationAddress":["9891xxxxxxxx","9891xxxxxxxx"]
}

Sample answer:
{
"message": "Successfully done.",
"succeeded": true,
"data": [
"624ed1bbcd0efb1ef148e0a0",
"624ed1bbcd0efb1ef148e0a1"
],
"resultCode": 100
}

7|Page
Arad API gateway user manual
Arad ITC

Send a message via Get

To send a single SMS through the Get method, you can send the messages to the
web service as follows.

header values
Method GET
Authorization Bearer {your access token} | Basic
address https://baseAddress/api/message/send

parameters
SourceAddress {Sender}
DestinationAddress {Receiver}
MessageText {Message text}

The answer is as follows:


property type
message string
succeeded bool
data string
resultCode int
The data parameter contains the return identifiers of the message.

Return identifiers for successful messages are UID format and string type. If the
user needs a return ID in the form of Long, he can use the send address as follows:

https://baseAddress/api/message/send?returnLongId=true

8|Page
Arad API gateway user manual
Arad ITC

Sample request:
https://baseAddress/api/message/send?SourceAddress=989000xxxx&DestinationAddre
ss=98912xxxxxxx&MessageText=test

Sample answer:

{
"message": "Successfully done.",
"succeeded": true,
"data": [
"62e760d2393e38af65bb9e4e"
],
"resultCode": 100
}

9|Page
Arad API gateway user manual
Arad ITC

Receive a message
In order to receive MO or received messages, the subscriber must choose one of
the receiving methods through Get, Post, Push or SMPP. In Get or Post mode, the
end point of receiving should be provided to Arad. The username and password
parameters are optional and if the subscriber provides these parameters to Arad,
Arad will send these parameters as basic authentication.

In the method of receiving through Push, the subscriber must implement the
Arad.Q client service on his side.

In the method of receiving through SMPP, it is also done in the standard way of
this protocol.

The parameters sent through the Get or Post method are in the form of a list of
the following parameters:

property type
text string
from string
to string

The parameters sent through Arad.Q are as follows:

property type
MessageText string
SourceAddress string
DestinationAddress string
ReceiveDateTime string

10 | P a g e
Arad API gateway user manual
Arad ITC

Get message status


In order to receive DLR, that is, to receive the status of sent messages, the
subscriber must choose one of the receiving methods through Get, Post, Push or
SMPP. In Get or Post mode, the end point of receiving should be provided to Arad.
The username and password parameters are optional and if the subscriber
provides these parameters to Arad, Arad will send these parameters as basic
authentication. In the method of receiving through Push, the subscriber must
implement the Arad.Q client service on his side.

In the method of receiving through SMPP, it is also done in the standard way of
this protocol. The parameters sent through the Get or Post method are in the form
of a list of the following parameters:

property type
batchId string
status string
Mobile string
partNumber string

The parameters sent through Arad.Q are as follows:

property type
MessageId string
DateTime string
Mobile string
PartNumber string
Status string
FullDelivery bool

11 | P a g e
Arad API gateway user manual
Arad ITC

Receive messages via Pull


To receive messages through API or Pull, you can receive up to 1000 unread
messages by calling the following method each time .

header values
Method GET
Authorization Bearer {your access token} | Basic
address https://baseAddress/api/message/getmo

If you want to receive a unique ID for each message, you can put the optional
parameter returnId=true at the end of Address.

The answer will be a list of messages.


If the subscriber has a message, the answer is as follows. Up to 1000 unread
messages are returned:
{
"message": "Successfully done.",
"succeeded": true,
"data": [
{
"sourceAddress": "9891xxxxxxxx",
"destinationAddress": "989000xxxx",
"messageText": "1 ‫"متن‬,
"receiveDateTime": "2022-04-04T11:23:11.211Z"
},
{
"sourceAddress": "9891xxxxxxxx ",
"destinationAddress": "989000xxxx ",
"messageText": "2 ‫"متن‬,
"receiveDateTime": "2022-04-05T13:40:57.793Z"
}
],
"resultCode": 100
}

If the subscriber has no message, the answer is as follows:


{
"message": "Item not found!",

12 | P a g e
Arad API gateway user manual
Arad ITC

"succeeded": false,
"resultCode": 109
}

If you want to retrieve the received messages of a specific time, you can use the
following method:

header values
Method GET
Authorization Bearer {your access token} | Basic
address https://baseAddress/api/message/getmobydate

The date parameters will be as follows:

property type
startDateTime DateTime
endDateTime DateTime

If you want to receive a unique ID for each message, you can put the optional
parameter returnId=true at the end of Address.

The sample answer will be the same as the previous method.

13 | P a g e
Arad API gateway user manual
Arad ITC

Receive delivery through Pull


In order to receive delivery via API or pull, it must be set to resend delivery based
on pull in the user settings section. The user can query the status of up to 1000
messages per request.

header values
Method POST
Authorization Bearer {your access token} | Basic
address https://baseAddress/api/message/getdlr

parameters
List<string> Message Ids

The answer is as follows:

property type
message string
succeeded bool
data string
resultCode int
The data parameter contains the status list.

If, when sending a message, the user has requested long return identifiers, he
should also use the following address when inquiring about the status:

https://baseAddress/api/message/getdlr?returnLongId=true

Sample request body:


[
"624ed1bbcd0efb1ef148e0a0",
"624ed1bbcd0efb1ef148e0a1"
]

14 | P a g e
Arad API gateway user manual
Arad ITC

Sample answer:
{
"message": "Successfully done.",
"succeeded": true,
"data": [
{
"id": "624ed1bbcd0efb1ef148e0a0",
"partStatus": [
{
"item1": 1,
"item2": 34,
"item3": "2022-04-07T11:57:50.044Z"
}
],
"deliveryStatus": 34
},
{
"id": "624ed1bbcd0efb1ef148e0a1",
"partStatus": [
{
"item1": 1,
"item2": 1,
"item3": "2022-04-07T11:57:50.043Z"
}
],
"deliveryStatus": 1
}
],
"resultCode": 100
}

The partStatus field shows the value of item1, the number of the message part, the
value of item2, the status, and item3, the time of the status. The deliveryStatus
field also shows the overall status.

15 | P a g e
Arad API gateway user manual
Arad ITC

Get user information


To get your user information such as credit, special numbers, sending limit, etc.,
use the following method.

header values
Method GET
Authorization Bearer {your access token} | Basic
address https://baseAddress/api/user/userinfo
The answer is as follows:

property type
message string
succeeded bool
data string
resultCode int
The data parameter contains a list of information.
A sample answer is as follows:
{
"message": "Successfully done.",
"succeeded": true,
"data": {
"userName": "username",
"firstName": "name",
"lastName": "family",
"credit": 5000.0,
"mps": 1000,
"senderIds": [
"989000xxxx",
"9890001xxx"
]
},
"resultCode": 100
}

16 | P a g e
Arad API gateway user manual
Arad ITC

Error codes
Explanation Error Code
Error sending Send Error 0
Insufficient inventory Not Enough Credit -1
Server error Server Error -2
Account is disabled DE ACTIVE Account -3
Account has expired Expired Account -4
The username or password is incorrect Invalid Username or Password -5
Error in authentication Authentication Failure -6
The server is busy Server Busy -7
The recipient's number is blacklisted Number At Backlist -8
Daily submission limit Limited In Send Day -9
Limitation on sending speed Limited In Volume -10
The sender number is not valid Invalid Sender Number -11
The recipient's number is not valid Invalid Receiver Number -12
The receiving operator is not valid Invalid Destination Network -13
Unreachable network Unreachable Network -14
The sender's number is inactive DE ACTIVE Sender Number -15
The sender number format is wrong Invalid Format of Sender Number -16
There is no charge for this shipment Tariff Not Found -17
The IP address of the sender is not Invalid Ip Address -18
valid
The submission template is not valid Invalid Pattern -19
The sender's number has expired Expired Sender Number -20
The content of the message contains a Message Contains Link -21
link

17 | P a g e

You might also like