How to setup the X API Key

In this article, we will cover:

What is changing with X (formerly) and why

X has made an API change that will impact your access to content. There’s still a lot of great content on X, and we have a solution to ensure your continued access.

What this means to you:

To continue sourcing new content from X, you will need to sign up for an X developer account and complete a few simple steps in the TINT platform before June 1, 2023. The changes only take a few minutes when you follow the step-by-step instructions here.

The X Basic Developer account has a monthly subscription cost of $175-200 per month (annual or monthly dependant) and gives you the benefit of being more in control of content because it’s your app.

Please note that the basic developer account is needed in order to ingest X content, the free tier does not include content ingestion.

How to setup the X API Key with X

In order to be able to enter API Key Credentials inside TINT, you will first need to generate the API keys.  In order to generate keys, you will need to have an X Development Account.

 

How to create an X Development Account

Visit https://developer.twitter.com/en to create an X Developer Account (if you don’t already have one).

Once, you have landed on this page, most users will only need the Basic plan, click “Subscribe” to sign up but if you need more usage than the Basic Plan offer, please look at the Pro plan or apply for Enterprise.

Once you have created an account, X will ask you to agree to its developer policy. 

Here it will ask you to describe your use case(s) for the X's data and how you will use the API 

For example: My intention is to utilize the X API for my personal account. The intended use cases would involve scheduling my tweets, responding to replies, and analyzing my tweet performance. The analysis would encompass the impressions or engagements garnered by my tweets from other users. Please note that I require this API key for my personal usage only.

We suggest you write out your own description, but can take inspiration from the example above.

Usually, you are automatically approved. Check your email to verify your developer account. Look for an email from developer-accounts@twitter.com that has the subject line: "Verify your X Developer Account". Once you’ve done this step, you’ll be taken to your X Developer account. 

How to create an app and API key 

    1. From the initial Dashboard, click the blue cog. It is located in the middle of the page, under your default product.

    2. Click the “Set Up” button found under User authentication settings.
    3. In the App permissions section, select Read and write.
    4. In the Type of App section, select “Web App, Automated App or Bot.”
    5. In the App info section, set the callback URI to https://api.tintup.com/v2/accounts/twitter and set the Website URL to your company’s website URL.
    6. The following screen will display OAuth 2.0 details.  Save this information for use in TINT
    7. You will be navigated back to the main screen, with the authentication section at the bottom now completed.
    8. Navigate to the “Keys and tokens” tab, found at the top of the page.
    9. Make sure that the environment is set as Production.  If it's not, click here to see how to change this
    10. Click on Generate/Regenerated under Consumer Keys section.
    11. The next screen will have the APIv1.1 id and secret. Save this information for use in TINT.

 

How to setup the X Integration with TINT

    1. Navigate to your name in the right-hand corner
    2. Click on Team Settings
    3. On the left-hand side, click on Integrations in the list
    4. Click on +Add
    5. Select X and click Connect
    6. Enter the previously saved Client ID and Secret for API v2 
    7. Enter the previously saved Client ID and Secret for API v1.1

Once completed, you are now ready to ingest Tweets and/or Schedule Tweets. 

How_to_add_a_Twitter_Integration_-_Twitter_Changes_-_27th_April_2023.gif

Re-authorize existing X accounts in TINT 

Prior to the switchover on May 31, 2023, we will send emails noting that existing X tokens will begin to expire. If you already have social feeds associated with an X account in TINT, it might be a good time to reauthenticate so you don’t have any lapse in content ingestion when the switchover happens.

To do this:

  1. Navigate to your name in the right-hand corner
  2. Click on Team Settings
  3. On the left-hand side, click on Social Accounts in the list
  4. Filter by X at the top of Social Account section
  5. Click on ... and click on re-authorize in the dropdown menu
  6. Once clicked an oAuth window will appear, if you are logged in, your username will be in the top right.  If not, log in with the correct details for the X account that you are re-authorizing and click Authorize App to continue.
  7. Complete this action with all your existing X accounts found in this list.

How_to_re-authorize_a_Twitter_account_-_Twitter_Changes_-_27th_April.gif

FAQs 

What happens if you don't want to continue to use X due to this change?

Any X content ingested before June 1, 2023, will remain available if you leave the feed on the TINT board. The feed will stop pulling content on June 1.   

I subscribed to the Basic plan. How many tweets can I ingest?

Up to 15,000 per month. The actual count may be less if you use X right requests as we need some make some requests to check their statuses. X actually limits apps to 60 requests of up to 100 tweets per 15 minutes so that means we support up to 60 Twitter social feeds. 

When I try to add or reauthorize an X social account, the popup opens but is blank.

This likely is happening because either the redirect URL entered is incorrect or the X Integration has the wrong information in it.

To check the redirect URL:

Go into X's Developer Portal by clicking on your app under Products & Apps and clicking on the Edit button under User authentication settings. The redirect URL should be https://api.tintup.com/v2/accounts/twitter.

How

For the wrong information on the X Integration:

There are a few indicators, some of which you can see for yourself on the Integration page on TINT once you have added your Integration.

This is what a working X integration looks like on TINT:

This shows the API v2 ID and API v1.1 ID which is what you put in box 1 and box 3 on the connection popup. 

  • The API v2 normally ends in pjaQ

  • The API v2 is always longer than the API v1.1

If you see the following - you have put the API v2 twice by accident

If you see the following - you have swapped the API v1.1 and API v2 around:

If you see the following - you have entered the secret key in the ID boxes:

If you see the following - you have the app but it's not configured correctly inside Twitter:

To configure the app from this point:

Go back to the section on - How to create an app and API key

How

Though even if the integration looks correct on TINT, we are unable to see your secret keys as they are like passwords so if you have entered these incorrectly, the integration will not work.

When in doubt, delete the integration and start again.

When trying to resolve my X account, I get the following error:
{"errors":[{"status":"403","code":"403","title":"Forbidden","detail":"Nil JSON web token"}]}

Standalone App instead of in a Project

One of the reasons why this occurs is that the app has been made as a standalone app instead of an app under a project.  It would see it under the section of Standalone Apps.  

It would look like this: 

Standalone

If they already have a Project above your standalone App:
  1. Go to the X's Developer Portal: Use Cases, Tutorials, & Documentation .
  2. Sign in to your account.
  3. Click on the Projects & Apps tab.
  4. Click on the Projects tab.
  5. Click on the name of the project that you want to add the standalone app to.
  6. Click on the Add App button.
  7. Select Add an Existing App
  8. Pick an App out of the list that you want to add to the project.  It says that you will gain access to v2.
  9. Click on the Next button

If it says to create a Project above your standalone App:
  1. Go to the X's Developer Portal: Use Cases, Tutorials, & Documentation .
  2. Sign in to your account.
  3. Click on + Add Project
  4. Fill in the information for the Project.  Project Name, what your use case is, what you are you going to use the Project for - description
  5. Select Add an Existing App
  6. Pick an App out of the list that you want to add to the project.  It says that you will gain access to v2.
  7. Click on the Next button

There’s no need to delete the X Integration if it’s correct as it will auto-update and you should be able to resolve the X account with no error popping up or this will resolve the feed.  

Regenerated API keys

Another reason why this error occurs if someone regenerates the API v1.1 keys on the X Developer App.  The API keys on TINT would be no longer valid and you would have to delete the integration and re-add the X Integration with the newly generated API keys.

When I try to publish, the post is accepted by publishing doesn't work.

This could be happening because the app is configured as a read-only app. From X's Developer Portal, you can fix this by clicking on your app under Products & App and the Edit button under User authentication settings. From there, you will want to ensure that Read and Write is selected in App permissions.

I have an existing Twitter app, can I re-use it?

Yes. However, you should be aware that the limits (e.g. 10,000 tweets per month) are at the X's app level so it will be shared with the other tools that you use this for. Our recommendation is you create a new app for TINT specifically.

I have Twitter Enterprise, can we provide those credentials to you?

Yes! Follow the steps above and give us these credentials via the Integration.

How can I limit the number of tweets X sends so that I can maximize the 10,000 tweets I have access to?

Most of our X social feeds now have the ability not to ingest text-only posts. You'll find an option for this under the ... and Settings for each of your supported X social feeds (Hashtag and Advanced) and that is the new default when creating X social feeds. 

Existing Feed New Feed
How to ingest Media only - X - 30th November 2023.gif mceclip0.png

 

We also recommend you use our X Advanced social feed. You can write queries that are up to 480 characters in length to search more specifically, filter out keywords, etc. that you definitely don't want to see, limit tweets to a particular geographic area, etc. To learn more about this feed and how to structure the advanced search parameters, click here


I didn't save or I have lost the API v2 and/or API v1.1 information and the integration doesn't work, how do I get back to it?

  1. Go to the developer portal: https://developer.twitter.com/en/portal/dashboard
  2. Click on the key icon on the project that you are using for TINT
  3. Click Regenerate under Consumer Keys - this will give you the v1.1 version keys.  
  4. If you need the V2 version as well, scroll down to OAuth 2.0 Client ID and Client Secret and click regenerate for the Secret ID for v2 and you will find the Client ID in the box above the regenerate option.
  5. Go to TINT and delete your original Integration and re-add with the new information

Twitter

How to move your App from Staging or Development to Production?

  1. Click on the app inside the project so you see the app details as the picture
  2. Click Edit
  3. Go to the bottom to Environment and change it to Production
  4. Click Save

If you run into any issues or have questions regarding X, please don't hesitate to contact Technical Support at support@tintup.com.

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.