Search code examples
twitter-oauthtwitter-rest-api

Twitter REST API - how to check if an app has certain permission?


Before attempting to write to a user's timeline, I would want to check if an app has write access. How do I check this?


Solution

  • The response to API requests with a valid access token will have a header named X-Access-Level. You can look for the value read-write there. Ideally, you will make an API request toaccount/verify_credentials node for this purpose.