Contents

Calling the Apple Ads API

Pass your access token in the authorization header of HTTP requests.

Overview

Before you can call the API, you need to perform the implementation steps in Implementing OAuth for the Apple Ads API.

To call the Apple Ads Campaign Management API, pass your access token as Bearer in the authorization header of HTTP requests. The Bearer value informs the API that the bearer of the token has authorization to access the API and perform specified actions. The following is an example call to the API:

curl "https://api.searchads.apple.com/api/v5/campaigns" \
-H "Authorization: Bearer {access_token}" \
-H "X-AP-Context: orgId={orgId}"

Header

Description

Authorization

Required. The authorization value is always Bearer.

X-AP-Context

Required. The value is your orgId. [Image] Note: This isn’t a requirement when calling Get User Acl and Get Me Details.

To return the userId and parentOrgId of an API caller, use Get Me Details.

Handle Errors

HTTP status code

Error message

Description

401

unauthorized

The token is invalid or expired.

403

forbidden

The request requires higher privileges than the access token provides.

Rate Limits

Rate limits exist in the Apple Ads Campaign Management API to avoid latency and other system problems from too many API calls within a limited time. For API users that are using automated retry logic in their environments, Apple’s solution is to require the retry logic to increase retry attempts exponentially by seconds. For example, if your default minimum wait time between retries is 2 seconds, the next retry wait time is 4 seconds, and so forth.

Set a maximum exponential backoff time, such as 16 seconds. After reaching the maximum time, don’t increase the wait period between retries.

  • If the request fails, wait 2 seconds and retry the request.

  • If the request fails, wait 4 seconds and retry the request.

  • If the request fails, wait 8 seconds and retry the request.

  • If the request fails, wait 16 seconds and retry the request.

Topics

Access Control List

Error Responses

See Also

Essentials