Exchange a short-lived auth code for an app token
curl --request POST \
--url https://api.webstashai.com/auth/exchange \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>'})
};
fetch('https://api.webstashai.com/auth/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.webstashai.com/auth/exchange"
payload = { "code": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"token": "<string>",
"user": {
"id": "<string>",
"email": "jsmith@example.com",
"plan": "free",
"email_verified": 123,
"name": "<string>",
"avatar_url": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}Exchange a short-lived auth code for an app token
POST
https://api.webstashai.com
/
auth
/
exchange
Exchange a short-lived auth code for an app token
curl --request POST \
--url https://api.webstashai.com/auth/exchange \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>'})
};
fetch('https://api.webstashai.com/auth/exchange', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.webstashai.com/auth/exchange"
payload = { "code": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"token": "<string>",
"user": {
"id": "<string>",
"email": "jsmith@example.com",
"plan": "free",
"email_verified": 123,
"name": "<string>",
"avatar_url": "<string>"
}
}{
"error": "<string>"
}{
"error": "<string>"
}