---
title: "Returns the access token for either an authorization code or refresh token."
method: POST
path: "/OAuth/GetToken"
tags: ["OAuth"]
---

# Returns the access token for either an authorization code or refresh token.

`POST /OAuth/GetToken`

## Request

- Base URL: `https://ws.yourmembership.com`
- URL: `https://ws.yourmembership.com/OAuth/GetToken`
- Auth: none declared. Required headers: `Accept`
- TypeScript: <https://skmtc.dev/yourmembership/apis/ym-rest-services/docs/OAuth/GetToken/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns the access token for either an authorization code or refresh token.

## Request body `application/x-www-form-urlencoded`

- object
  - `grant_type` 'authorization_code' | 'refresh_token', required
  - `scope` string
  - `code` string
  - `refresh_token` string
  - `redirect_uri` string
  - `client_id` string
  - `client_secret` string

## Response `200`

Success

- Object: Object

---

[API](https://skmtc.dev/yourmembership/apis/ym-rest-services.md) - [All operations](https://skmtc.dev/yourmembership/apis/ym-rest-services/llms.txt) - [OpenAPI document](https://skmtc.dev/yourmembership/apis/ym-rest-services/revisions/8d8a2e7e7d56?raw)
