Connect X

An X connection is one X account. Marketing uses it to post, with pictures and video, and to read the public numbers of its posts. It is your org's or a brand's. See Connections for how connecting works in general.

Ways to connect

  • Connect, through GreenMind's app, where it is open to your org.

  • Use your own app: an app in X's developer console, using OAuth 2.0. Start at the X developer console; X's OAuth 2.0 authorization code documentation explains the rest.

  • Post by hand instead, at the foot of the Use your own app dialog: you give the account's name, GreenMind prepares each post and opens X with the text filled in for you to finish it, and nothing is held for the account.

There is no key option.

Cost

X charges for API use, and bills it to the developer account the app belongs to. With your own app, that is your account: you buy credits in the developer console, and X's pricing page says what a post costs, which is more when the post holds a link. Nothing posts until the account has credits, so set a spending limit and, if you want it, automatic recharge in the console's billing.

Making your own app

X's screens change from time to time. Follow the dialog and X's documentation where this page and X's screens differ.

  1. Open the Use your own app dialog for X on the Connections page, and keep it open.
  2. In the X developer console, signed in as the account that should own the app, create a project and an app in it, and set up billing as above.
  3. Open the app's User authentication settings and set it up:
    • turn on OAuth 2.0;
    • set the type of app to Web App (a confidential client, one that has a secret);
    • set the app permissions to Read and write;
    • add the redirect URL from the dialog as a callback URI, copied exactly;
    • give your website address, and the addresses of your terms and privacy policy.
  4. Save. Copy the OAuth 2.0 client ID and client secret (not the API key and secret that X's older authentication also shows) into the dialog and press Connect. Sign in to X and allow it.

Scopes

tweet.read tweet.write users.read media.write offline.access
Use Scopes
Post tweet.read, tweet.write, users.read, media.write, offline.access
Read post insights tweet.read, users.read, offline.access

offline.access is what lets the connection keep working: X's tokens last two hours, and a refresh token is given only with it. The scopes are asked at sign-in, so they are not ticked in the console. The app's permissions (Read and write) must allow them.

If it goes wrong

  • Invalid redirect, or the sign-in page shows an error. The callback URI on the app differs from the dialog's, or the app is not set to OAuth 2.0 as a Web App.
  • Posting fails with a payment or credits message. The developer account has no credits.
  • Posting fails with a permissions message. The app's permissions are Read only. Change them to Read and write, then Reconnect, because a token keeps the permissions it was granted with.
  • Limits. X allows 100 posts every 15 minutes for an account, and 10,000 a day for an app.