Get OAuth2 applications.
GET
CoderSessionTokenheader
Coder-Session-Token<token>user_id?stringFilter by applications authorized for a user
OK
application/json- response
[index: integer]?The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X GET \ "$CODER_URL/api/v2/oauth2-provider/apps" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN"const { CODER_URL, CODER_SESSION_TOKEN } = process.env;const url = `${CODER_URL}/api/v2/oauth2-provider/apps`;const response = await fetch(url, { method: "GET", headers: { "Coder-Session-Token": CODER_SESSION_TOKEN, },});console.log(response.status, await response.text());import osimport requestsurl = os.environ["CODER_URL"] + "/api/v2/oauth2-provider/apps"token = os.environ["CODER_SESSION_TOKEN"]response = requests.get( url, headers={ "Coder-Session-Token": token, },)print(response.status_code, response.text)package mainimport ( "fmt" "io" "net/http" "os")func main() { url := os.Getenv("CODER_URL") + "/api/v2/oauth2-provider/apps" token := os.Getenv("CODER_SESSION_TOKEN") req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { panic(err) } req.Header.Set("Coder-Session-Token", token) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, err := io.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Println(resp.Status, string(out))}Example Response200
[ { "callback_url": "string", "client_type": "confidential", "dynamically_registered": true, "endpoints": { "authorization": "string", "device_authorization": "string", "token": "string", "token_revoke": "string" }, "icon": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "redirect_uris": [ "string" ], "scope": "string" }]