Skip to content

User context - #6

Merged
jdemos merged 2 commits into
mainfrom
user-context
Nov 18, 2021
Merged

User context#6
jdemos merged 2 commits into
mainfrom
user-context

Conversation

@aureliaspecker

Copy link
Copy Markdown
Contributor

Problem

Accessing private metrics with the Engagement API requires user authentication. This repo didn't demonstrate how to use the 3-legged OAuth flow to enable a user to authorize the developer application and generate the required Access Tokens to make requests on behalf of the user in question.

Solution

  • Created script /Engagement-API/generate_user_access_tokens.py to allow developers to generate user Access Tokens using the 3-legged OAuth flow.
  • Added instructions in the README.md file to explain how authentication works with the Engagement API and how to use the Access Tokens.
  • I also fixed a typo in the .env.example file (unrelated to the problem described above).

Steps to test & review

  1. Read new instructions in README.md to ensure they make sense and can be followed.
  2. Use /Engagement-API/generate_user_access_tokens.py to generate Access Tokens for another Twitter account (e.g. a test account).
  3. Use the Access Tokens obtained in the previous step to populate .env file and make a request to the Engagement API to obtain private metrics on behalf of the account used in step 2.
@jdemos
jdemos merged commit 7e40acf into main Nov 18, 2021
@jdemos

jdemos commented Nov 18, 2021

Copy link
Copy Markdown
Contributor

Changes look good – merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants