Base URL

AdManage’s API is built on REST principles and is served over HTTPS. To ensure data privacy, unencrypted HTTP is not supported.

The Base URL for all API endpoints is:

Terminal
https://admanage.ai/api/

Authentication

Authentication to AdManage’s API is performed via the Authorization header with a Bearer token. To authenticate, you need to include the Authorization header with the word Bearer followed by your API key in your requests like so:

Terminal
Authorization: Bearer ak_xxxxxx

Here are examples of how to authenticate with AdManage’s API in different programming languages:

curl --request GET \
  --url https://admanage.ai/api/ad-copy-templates \
  --header 'Authorization: Bearer ak_xxxxxx'

Learn more about how to get your API key.

Error Handling

AdManage API returns machine readable error codes, human readable error messages and a link to the docs for more information.

Here is how an error response looks like:

{
  "error": {
    "code": "not_found",
    "message": "The requested resource was not found.",
    "doc_url": "https://docs.admanage.ai/api-references/errors#not-found"
  }
}

Here is a list of all error codes AdManage API returns:

Pagination

AdManage’s API supports pagination. This is useful when you have a large number of resources and you want to retrieve them in smaller chunks.

These list API methods share a common set of parameters that allow you to control the number of items returned and the page number. For example, you can:

Parameters

page
string
default:"1"

The page number to retrieve. By default, the first page is returned.

pageSize
string

The number of items to retrieve per page. The default value varies by endpoint. Maximum value is 100.

sortBy
string

The field to sort the results by.

sortOrder
string

The order to sort the results by. Can be asc or desc.

Example

The following example demonstrates how to retrieve the first page of 10 ad copy templates:

curl --request GET \
  --url https://admanage.ai/api/ad-copy-templates?page=1&pageSize=10 \
  --header 'Authorization: Bearer <token>'