ANT
  • Introduction
    • Authentication
    • Number
    • Errors
    • Rate Limits
  • ANT API
    • Balance
      • Retrieve balance
    • Sms
      • Marketing SMS
        • Send Marketing SMS
        • Send Bulk Marketing SMS
        • Scheduled Marketing SMS
        • Marketing SMS CallBack
      • 🔥OTP SMS
        • Send OTP SMS
        • OTP SMS CallBack
        • ⭐OTP Backfill Interface
      • Notification SMS
        • Send Notification SMS
        • Send Bulk Notification SMS
        • Scheduled Notification SMS
        • Notification SMS CallBack
    • Voip
      • IVR
        • IVR File Upload
        • IVR Task
        • IVR Callback
      • Call
        • Call the phone
        • Call record callback
    • Phone Number Validation
      • HLR Sever
      • Check Number Status
  • Webhooks
    • Test Webhooks
  • Demo
    • Java Demo
Powered by GitBook
On this page
  • 📘How do I get my API Key?
  • Test with cURL
  1. Introduction

Authentication

PreviousIntroductionNextNumber

Last updated 11 days ago

API Key

ANT APIs use API keys for authentication. An API key is a token that a client provides when making API calls. The key should be sent as a request body named authSecret

POST /user/account/balance HTTP/1.1
Host: api.antgst.com
Content-Type: application/json
{
    "authSecret": "YOUR_API_KEY"
}

📘How do I get my API Key?

Log in to ANT Dashboard > SecurityCenter>AccessKeyManage and you will find it on that page.

Test with cURL

curl --location --request POST 'https://api.antgst.com/user/account/balance' 
--header 'Content-Type: application/json' 
--data '{"authSecret": "YOUR_API_KEY"}'

It returns a response with HTTP status 200 if succeeded. Here is an example of the response body:

{
    "msg": "SUCCESS",
    "code": 200,
    "result": {
        "smsBalance": -18.383,
        "voipBalance": 0.0,
        "currency": "CNY"
    }
}

Otherwise, if the API key is invalid. Here is an example of the response body:

{
    "msg": "auth secret error!",
    "code": -22
}

is a command-line tool and library for transferring data with URLs. Here is an example of how to retrieve your account balance authenticated with your API key:

cURL
click