Documentation Index

Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

OAuth 2.0 authorization

Prev Next

Available in Classic and VPC

This API is used to issue or renew access tokens. To view the usage flow in B2B PRISM Live Studio, see Login process.

Request

The method and URI are as follows:

GET {serviceApiDomain}/prism/v1/service/oauth2/token

Request headers

The following describes the headers.

Name Type Description Required
x-prism-client-id String Client ID provided by the customer's service to B2B PRISM Live Studio for OAuth 2.0 authorization, which cannot be changed Y
x-prism-client-secret String Client secret provided by the customer's service to B2B PRISM Live Studio for OAuth 2.0 authorization, which can be changed through consultation if necessary due to security concerns or other reasons Y

Request query parameters

The following describes the parameters.

Name Type Description Required
grant_type String This is an OAuth 2.0 authorization type. Use the "authorization_code" when issuing an access token, and the "refresh_token" when renewing it. Y
redirect_uri String This is required when making a request with "grant_type = authorization_code." In B2B PRISM Live Studio, use https://global.apis.naver.com/prism/prism-auth-api/oauth/partner/{serviceId}. N
code String When issuing an access token, pass the code received in the response to the redirect URI. N
_token String Use this when making a request with "grant_type = refresh_token." N

Response

This section describes the response format.

Name Type Description Required
access_token String User's access token Y
refresh_token String User's refresh token N
expires_in Number Time remaining until the access token expires (second) N
token_type String Token type, generally "bearer" Y

Examples

Here are some example syntaxes.

When issuing access token

The following are examples of the syntax for issuing an access token.

Request example

The following is a sample syntax.

curl -X GET {serviceApiDomain}/prism/v1/service/oauth2/token
        ?grant_type=authorization_code
        &code={your_authorized_code} \
    -H "x-prism-client-id: {client-id}"
    -H "x-prism-client-secret: {client-secret}"

Response example

The following is a sample syntax.

{
    "access_token": "JXvBU54_hOok4gpOTHAOASEHbaE",
    "expires_in": 12345,
    "refresh_token": "va32t62Zsc3DVv0irdCt3yBjy_c",
    "token_type": "bearer"
}

When renewing access token

The following are examples of the syntax for renewing an access token.

Request example

The following is a sample syntax.

curl -X GET {serviceApiDomain}/prism/v1/service/oauth2/token
        ?grant_type=refresh_token
        &refresh_token={your_refresh_token} \
    -H "x-prism-client-id: {client-id}"
    -H "x-prism-client-secret: {client-secret}"

Response example

The following is a sample syntax.

{
    "access_token": "JXvBU54_hOok4gpOTHAOASEHbaE",
    "expires_in": 12345,
    "refresh_token": "va32t62Zsc3DVv0irdCt3yBjy_c",
    "token_type": "bearer"
}