title: Making Authenticated Requests keywords: [“Ads API authentication”, “authenticated requests”, “Ads API auth”, “OAuth Ads API”, “Ads API requests”, “authentication”] description: Accessing the X Ads API endpoints requires your application to send authenticated web requests securely using TLS to https://ads-api.--- Accessing the X Ads API endpoints requires your application to send authenticated web requests securely using TLS to https://ads-api.x.com. The following sections will provide an overview of making authenticated API requests, setting up Twurl to interact with the API, and extending your application to support OAuth 1.0a and make requests against your Ads account.
Requirements
Before making authenticated requests to the X Ads API, you will need: * an approved developer account * an application that has been approved for Ads API access * API key and secret obtained through the app management UI and * access tokens for a user with access to a X Ads accountUsing the API
The Advertising API is accessed on https://ads-api.x.com. The standard REST API, and the Advertising API can be used together with the same client app. The Advertising API enforces HTTPS, therefore attempts to access an endpoint with HTTP will result in an error message. The Ads API outputs JSON. All identifiers are strings and all strings are UTF-8. The Advertising API is versioned and the version is specified as the first path element of any resource URL.https://ads-api.x.com/<version>/accounts
HTTP verbs & typical response codes
There are four HTTP verbs used in the Ads API: * GET retrieves data * POST creates new data, such as campaigns * PUT updates existing data, like line items * DELETE removes data. While deletions are permanent, deleted data can still be viewed from most GET-based methods by including an explicitwith_deleted=true parameter when asking for the resource. Otherwise, deleted records will return a HTTP 404.
A successful request will return a HTTP 200-series response along with the JSON response representing the object when creating, deleting, or updating a resource.
When updating data with HTTP PUT, only the specified fields will be updated. You can un-set an optional value by specifying the parameter with an empty string. As an example, this group of parameters would unset any already specified end_time: &end_time=&paused=false.
See Error Codes & Responses for more details on error responses.
In-line parameters
Most resource URLs feature one or more in-line parameter. Many URLs also take explicitly declared parameters on the query string or, for POST or PUT requests, in the body. In-line parameters are denoted with a pre-pended colon (”:”) in the Resource Path section of each resource. For example, if the account you were working on were identified as"abc1" and you were retrieving the campaigns associated with an account, you would access that list by using the URL https://ads-api.x.com/6/accounts/abc1/campaigns. By specifying the in-line account_id parameter described in the resource URL (https://ads-api.x.com/6/accounts/:account_id/campaigns), you’ve scoped the request to objects associated only with that account.