Skip to content

Teskann/x-client-transaction-id-generator

Repository files navigation

Test workflow

X Client transaction server

Wrapper of XClientTransaction in a Flask server. 🐦

🔧 Setup

python3 -mvenv .venv
source ./.venv/bin/activate
pip install -r requirements.txt
python generate_secret_token.py

Launch:

python app.py

📚 API Reference

/generate-x-client-transaction-id

Type: GET

Get a x-client-transaction-id header value.

Parameters:

  • path: Path to the x API.
    • Required
    • Example value: /i/api/graphql/1VOOyvKkiI3FMmkeDNxM9A/UserByScreenName

Returned value

Type: JSON

{"x-client-transaction-id": "<transaction_id>"}

Caution

If path is missing, returns code 400 with response:

{"error": "Missing required parameter 'path'"}

Example

/generate-x-client-transaction-id?path=/i/api/graphql/1VOOyvKkiI3FMmkeDNxM9A/UserByScreenName

/reset-session

Type: GET

Reset the session managing the creation of transaction IDs.

It might be useful to call this once, if the generated x-client-transaction-id don't work anymore

Parameters:

Returned value

Type: JSON

{"message": "Session reinitialized successfully"}

Caution

If token is missing, or invalid, returns 401 error with the following body:

{"error": "Invalid token"}

Example

/reset-session?token=64nHYRvXaWElVBMHPp6xTedpGuzelTgrhOft4ESrzvTQ4whuQKeUO_i

About

Server that generates x-client-transaction-id for x.com requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages