ANTS API SPECIFICATION
English v1.0.0
English v1.0.0
  • INTRODUCTION
  • ACCOUNT
  • SMS
    • Send Message
    • Callback Delivery Report
    • Message Logs
    • Preview Message
    • Sender List
    • Status and Error codes
  • OTP (One Time Password)
  • SMS 2 WAY Interactive
Powered by GitBook
On this page
  • API Get Balance
  • Sequence Diagram
  • Response Status
  • HTTP Status Code

Was this helpful?

ACCOUNT

API Account is a channel to identify and checking credit balance, which will return the account type and remaining credits

PreviousINTRODUCTIONNextSMS

Last updated 5 years ago

Was this helpful?

API Get Balance

You can check the user's credits, which have 2 type of accounting; Prepaid and Postpaid

Sequence Diagram

You can start creating HTTP request as this following:

Header

description

HTTP Request (URL)

HTTP Headers

Content-Type: application/json

Authorization: (Basic Auth) Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

HTTP Methods

POST

Request example (method : Post)

HTTP Request (URL): https://api-service.ants.co.th/account/balance

Response

Parameter

type

description

type

string

Type of accounting

credit

number

Amount of credits

Response JSON format

{
    "type": "postpaid",
    "credit": 167.

Response Status

Using API; your system will get the response in return of different status. So, the system will understand what the reason on particular activity is. In order to tackle and apply different solution at the right cause.

HTTP Status Code

If successful, response header HTTP status code will be 200 OK and the message logs will be returned. If you try to send a message without authorization, you will get a response with HTTP status code 401 Unauthorized.

If you are using this method too many times in a short period, you will get status code 429 Too Many Requests. This prevents misusing logs in cases where reports would be more appropriate.

https://api-service.ants.co.th/account/balance
Sequence Diagram (API Balance)