{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/dexcom/refs/heads/main/json-structure/dexcom-api-token-request-structure.json",
  "name": "TokenRequest",
  "description": "Form-encoded request body for the token endpoint.",
  "type": "object",
  "properties": {
    "client_id": {
      "type": "string",
      "description": "Application's registered client identifier."
    },
    "client_secret": {
      "type": "string",
      "description": "Application's client secret."
    },
    "code": {
      "type": "string",
      "description": "Single-use authorization code (required when `grant_type=authorization_code`)."
    },
    "refresh_token": {
      "type": "string",
      "description": "Refresh token (required when `grant_type=refresh_token`)."
    },
    "grant_type": {
      "type": "string",
      "enum": [
        "authorization_code",
        "refresh_token"
      ]
    },
    "redirect_uri": {
      "type": "uri",
      "description": "Registered redirect URI (required for `authorization_code`)."
    }
  },
  "required": [
    "client_id",
    "client_secret",
    "grant_type"
  ]
}
