Signup¶
You will have to select realm.
curl -X 'GET' 'http://localhost:8000/api/v1/realms/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
--header 'Authorization: Bearer <auth_token>'
import requests
url = "https://restfall.com/api/v1/users"
response = requests.post(url)
Within the listed realms, you will probably find “The Land of Free”.
curl -X 'POST' 'http://localhost:8000/api/v1/realms/login/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
--header 'Authorization: Bearer <auth_token>' \
-d '{
"realm": "The Land of Free"
}'
import requests
url = "https://restfall.com/api/v1/users"
response = requests.post(url)
In the response you will receive api_key. You can use it exactly the same as the previous token, but it will allow you to access only your player resources within this particular realm.
If you ever forget your tokens, you can just list them using your user token.
curl -X 'GET' 'http://localhost:8000/api/v1/realms/tokens/' -H 'accept: application/json' -H 'Content-Type: application/json' --header 'Authorization: Bearer d6ee954c894afa3f67c373e539025a9217c2cbe5' | jq
import requests
url = "https://restfall.com/api/v1/users"
response = requests.post(url)