Search.../
  1. REST
Generate a test token to explore our APIs

Request an Access Token

Once a user has completed the installation process and given your app permission to access their data, use the authorization code we sent you, together with your secret key, to request an access token and a refresh token. (The access token is only valid for 5 minutes.) You can find your secret key in the Wix Developers Center.

Syntax

function AccessToken Request(grant_type: string, client_id: string, client_secret: string, code: string): AccessTokenResponse<AccessTokenResponse>

Request an Access Token Parameters

NAME
TYPE
DESCRIPTION
grant_type
string

Value must be set to "authorization_code"

client_id
string

The App ID as defined in the Wix Developers Center

client_secret
string

The Secret Key for your app as defined in your Wix Developers Center

code
string

The authorization code received from us.

Returns

Return Type:

object
NAME
TYPE
DESCRIPTION
refresh_token
string

The Refresh Token in order to request a new Access Token

access_token
string

The requested Access token

Was this helpful?

Request

Copy Code
1curl -X POST \
2 https://www.wixapis.com/oauth/access \
3 -H 'Content-Type: application/json' \
4 -d '{
5 "grant_type": "authorization_code",
6 "client_id": <APP_ID>,
7 "client_secret": <APP_SECRET>,
8 "code": <AUTH_CODE>
9}'