Skip to content

Instantly share code, notes, and snippets.

@thanos
Last active August 26, 2023 16:23
Show Gist options
  • Save thanos/b2319a3267bd45a006f9b0e3fa437d7e to your computer and use it in GitHub Desktop.
Save thanos/b2319a3267bd45a006f9b0e3fa437d7e to your computer and use it in GitHub Desktop.
setting up environmental variables for XENI Trade API
export XENI_API_HOST="https://xenitravelapi-beta01.gigalixirapp.com"
export XENI_USER_EMAIL="some@email.com"
export XENI_USER_PASSWORD="some password"
export XENI_TOKEN=$(curl -X 'POST' $XENI_API_HOST/api/accounts/get_token \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-d '{"user":{"email": "'"$XENI_USER_EMAIL"'", "password": "'"$XENI_USER_PASSWORD"'"}}' \
| sed "s/{.*\"token\":\"\([^\"]*\).*}/\1/g")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment