Tag Archives: Twitter

Twitter Ads Api

I. Introduction About Twitter API

1. Twitter API have three level access to Ads API.

  • Standard Access : Standard access allows successful ‘Basic’ partners accessing the Twitter Ads API to scale by increasing OAuth tokens and rate limits. Form request access ads standard https://dev.twitter.com/form/ads-api-access-standard.
  • Basic Access : Basic access level provides increased Twitter Ads API access to ‘Developer’ partners in order to prove the efficacy of their solution. Form request access ads basic https://dev.twitter.com/form/ads-api-access-basic.
  • Developer Access : Developer allows companies to begin creating a tool without any active advertisers. This level gives developers the ability to build out workflows using the Twitter Ads API before receiving full access. This access level will enable up to 5 oAuth Tokens and will restrict various API functionality and may be subject to additional limitations. Form request access ads developer https://dev.twitter.com/form/ads-api-access-developer.

2. API v1.1’s Authentication Model.

  • There are two forms of authentication in the new model, both still leveraging OAuth 1.0A.
    • Application +user authentication :
      • This is the most common form of resource authentication in Twitter’s OAuth 1.0A implementation to date.
      • Your signed request both identifies your application’s identity in addition to the identity accompanying granted permissions of the end +user
      • You’re making API calls on behalf of, represented by the user’s access token.
    • Application +only authentication (https://dev.twitter.com/oauth/application-only)
      • Not all API methods support application +only authentication.

3. Access Token.

  • Twitter have limit about number access token.
  • Twitter do not currently expire access tokens. Your access token will be invalid if a user explicitly rejects your application from their settings or if a Twitter admin suspends your application.
  • You should plan that a user’s access token may become invalid at any time and you will need to re-authorize for that user in the case that it does.

4. Sandbox Enviroment.

5. Ads Enumerations.

6. Rate Limit of Twitter API.

  • We can check rate-limit on response header each request of Per-endpoint.
  • Example:

12

II. Information required in Adrepo.

1. Format of report downloaded : JSON

2. Twitter Advertising Structure

  • Advertiser -> Campaign -> Adgroup -> Tweet

123

3. Information nessecsary to download report.

  • Go to link https://apps.twitter.com/app/[app-id]/keys, we can create new key or regenerate new key.
  • CONSUMER_KEY
  • CONSUMER_SECRET
  • ACCESS_TOKEN
  • ACCESS_SECRET

III. Access Advertiser Twitter Ads

1. Create your application.

2. Request access your application become Ads API Application.

  • We have three level access to Twitter Ads API (Part I).

3. Start Advertising

IV. Report

1. Campaign Management

2. Analytics (New Update)

3. Creative.

4. Measurement.

5. Tailored Audiences.

IV. Sample Code

  • Twitter recommend partner using the 3-legged approach but we will using PIN-based authorization (https://dev.twitter.com/oauth/pin-based).
  • Required your application must be access twitter Ads Api and your customer must be start advertiser.

1. CreateIfNotExistAccessToken

  • Required Library Twiiter4j version 4.0.3 or higher

2. Get Report For Per-Endpoint

  • Required Library signpost-commonshttp4 version 1.2.1.2 or higher

 

TwitterAPI | Sample Code