Get a token

Call the /token endpoint as a POST.
You need the code that Oauth adds as a response parameter in the redirect uri, client id, scopes, redirect uri, and client secret.

import requests, json

code = "XXXX"
scopes = ['user']
redirect_uri = "url"
client_id = 0000000000
client_secret = "XXXX"

url = "https://replit-oauth.coolcodersj.repl.co/token"

response = requests.post(url, data=json.dumps({
    "code": code,
		"scopes": "+".join(scopes),
		"clientid": client_id,
		"clientsecret": client_secret,
		"redirect_uri": redirect_uri
}))

token = response.text