Mediago API
en
  • en
  • zh
  1. Authentication
Mediago API
en
  • en
  • zh
  • Authentication
    • Get Access Token
      POST
  • Account Management
    • Get Authorized Account List
      GET
  • Campaign Management
    • Get Authorized Campaign List
      GET
    • Get Campaigns Detail
      GET
    • Create Campaign
      POST
    • Update Campaign
      POST
    • Batch Update Campaigns
      POST
    • Batch Active/Pause Campaigns
      POST
    • Batch Archive Campaigns
      POST
  • Ad Management
    • Get Authorized Ad List
      GET
    • Batch Active/Pause Ads
      POST
  • Sites Block Management
    • Get Account Block List
      GET
    • Block/Unblock Sites at Account
      POST
    • Get Campaign Block List
      GET
    • Block/Unblock Sites at Campaign
      POST
  • Report APIs
    • Get Daily Summary Data of All Campaign
      GET
    • Get Daily Report in Campaign Dimension
      GET
    • Get Daily Report in Ad Dimension
      GET
    • Get Hourly Realtime Data in Campaign or Ad Dimension
      GET
    • Get Account Daily Report in Site Dimension
      GET
    • Get Daily Report in Site Dimension
      GET
  1. Authentication

Get Access Token

POST
https://api.mediago.io/data/v1/authentication
Last modified:2025-09-26 08:17:07
Get Access Token using API Token. Token expires in 3600 seconds. Note: New access_token will invalidate the previous one.

Authentication#

💡Firstly, you need to get the API Token by asking your AM or email to ext_mediago_am@baidu.com.
💡Secondly, you need to call the authentication api with API Token to get the Access Token.
💡And once you get the Access Token, you need to pass this token as the bearer token in your HTTP headers to make subsequent calls before the Access Token is expired.
💡The original access_token will be invalid when a new access_token calls. If you want to send multiple requests, please apply single-threaded processes in each API request with the same access_token. Please do not call the access_token for each request. Otherwise, API may respond in error code 401
Status Codes:
CodeDescription
200Success
400Parameter is invalid
401access_token is invalid
403access_token has expired
404Request URL is error
429QPS limit exceeded
500Internal server error
502api_token is invalid
Request Parameters:
AttributeDetails
api_tokenobtain base64-encoded api token by asking your AccountManager
http_basic_authstring in the format of ${api_token} . eg: if api_token is Basic YWJjZGVmZzEyMw= = , then the Authorization header is as follow: Authorization: Basic YWJjZGVmZzEyMw= =

Request

Header Params

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.mediago.io/data/v1/authentication' \
--header 'Authorization: Basic {{api_token}}' \
--header 'Content-Type: application/x-www-form-urlencoded;charset=utf-8'

Responses

🟢200Success Response
application/json
Body

Example
{
    "access_token": "ACCESS_TOKEN",
    "token_type": "Bearer",
    "expires_in": 3599
}
🟠400Bad Request - Invalid Parameters
🟠401Unauthorized - Invalid Access Token
🟠403Forbidden - Token Expired
🟠404Not Found - Invalid URL
🟠429Too Many Requests - QPS Limit
🔴500Internal Server Error
🔴502Bad Gateway - Invalid API Token
Modified at 2025-09-26 08:17:07
Previous
Authentication
Next
Account Management
Built with