I am trying to query information from my private team and tried the following:
Registered an app
Name = stackoverflow.com/c/{team} OAuth domain = stackoverflow.com Application web site = https://stackoverflow.com/c/{team}
Got client id, client secret and a key.
- Authentication trial (explicit)
I have put into the browser the following URL:
https://stackoverflow.com/oauth/?client_id={id}&scope=no_expiry&redirect_uri=https://stackoverflow.com
Got the code.
Switched to Postman and got the access_token
based on client_id
, client_secret
, redirect_uri
and the code.
Now, I am trying to use a simple API method to check if I can access anything for my Team:
https://api.stackexchange.com/2.2/info?site={???}&access_token={token}&key={key}
This works for Stack Overflow. Tried with stackoverflow/c/{team}
, but it does not know about it (which kind of makes sense since I expected to generate some sort of key inside my private team space).
I have replaced the first step's URL with:
https://stackoverflow.com/oauth/?client_id={client_id}&scope=access_team|https://stackoverflow/c/{team}&redirect_uri=https://stackoverflow.com
Got a rather long code and switched to Postman:
GET: https://api.stackexchange.com/2.2/info?site=stackoverflow&team=https://stackoverflow.com/c/{team}&key={key}
Headers: X-API-Access-Token = {the_code_from_previous_step}
If I do not specify the key, I receive the following error:
{
"error_id": 405,
"error_message": "key is required when access_token is passed.",
"error_name": "key_required"
}
If I specify the key I got when defining the app:
{
"error_id": 403,
"error_message": "key is not valid for passed access_token, token not found.",
"error_name": "access_denied"
}
What is the correct way to retrieve information from my team?
https://
protocol prefix on theteams
query parameter, e.g.?team=stackoverflow.com/c/pickles
.