Skip to content

SunCharts EHR API

OAuth 2.0

EHR API as of 26.11.11.41 4 operations openapi.json ↓

# Oauth metadata

GET /.well-known/oauth-authorization-server

RFC8414 metadata for this installation.

Access No credential

Responses

200 Success application/json

Body: object

400 Invalid request
401 Authentication required
403 Scope or role denied
409 Conflicting state

Example call

curl -X GET "$EHR_URL/.well-known/oauth-authorization-server"

# Authorize

GET /oauth/authorize

response_type=code, code_challenge_method=S256. Validates registered callback before redirecting to the local consent GUI. Returns 303.

Access No credential

Parameters

Name In Type Details
response_type required query string
client_id required query string
redirect_uri required query string
scope required query string
state required query string
code_challenge required query string
code_challenge_method required query string

Responses

303 Local sign-in/consent redirect
400 Invalid authorization request

# Oauth revoke

POST /oauth/revoke

Confidential client_secret_basic. No browser session substitution.

Access Client ID and secret (HTTP Basic)

Request body application/x-www-form-urlencoded · required

Fields object · 2
Field Type Details
token required string
token_type_hint string
Example request body placeholder values
{
  "token": "string",
  "token_type_hint": "string"
}

Responses

200 Revoked or unknown token; entire owned grant is revoked.
400 Invalid request
401 Authentication required
403 Scope or role denied
409 Conflicting state

# Oauth token

POST /oauth/token

Confidential client_secret_basic. No browser session substitution.

Access Client ID and secret (HTTP Basic)

Request body application/x-www-form-urlencoded · required

Fields object · 6
Field Type Details
grant_type required string
code string
code_verifier string
redirect_uri string
refresh_token string
scope string
Example request body placeholder values
{
  "grant_type": "string",
  "code": "string",
  "code_verifier": "string",
  "redirect_uri": "string",
  "refresh_token": "string",
  "scope": "string"
}

Responses

200 Success application/json

Body: object

400 Invalid request
401 Authentication required
403 Scope or role denied
409 Conflicting state