このセクションには、now.gg ユーザーアカウントサービスの APIリファレンスが含まれています。
このドキュメントでは、Verify Token APIの詳細と使用法について説明します。
https://now.gg
このAPIは、生成されたトークンを検証するために使用されます。
POST
/accounts/oauth2/v1/verify-token
Content-Type: application/json
Verify APIでは、リクエストボディ内で以下のパラメータを使用する必要があります。
{
token_type: <token_type>,
token: <token>,
client_id: <client_id>,
client_secret: <client_secret>
}
| パラメータ | タイプ | 必須 | 許容値 | 説明文 |
|---|---|---|---|---|
| token_type | string | True | id_token, token | リクエストされたトークンのタイプ |
| token | string | True | id_token, token | Valid id_tokenまたはnow.ggによって生成されたトークン |
| client_id | string | True | Oauth client_id | now.ggアカウントマネージャーで生成された固有のclient_id |
| client_secret | string | True, If token type is token False, If token type is id_token |
Oauth client_secret | now.ggアカウントマネージャーで生成された固有のclient_secret |
client_idおよびclient_secret)はこのセクションからリクエストできます。id_tokenは基本ログインフローに使用されます。tokenは高度なログイン統合フローに使用されます。{
"success": true,
"code": "VERIFICATION_SUCCESS",
"decodedData": {},
"msg": "Token Verification success"
}
{
"success": false,
"code": "EXPIRED_TOKEN",
"msg": "Token Expired!"
}
{
"success": false,
"code": "INVALID_TOKEN",
"msg": "Token Invalid for given ClientId/ClientSecret"
}
| パラメータ | タイプ | 可能値 | 説明文 |
|---|---|---|---|
| success | boolean | True, False | TrueまたはFalseとして結果を返す |
| code | string | VERIFICATION_SUCCESS INVALID_TOKEN EXPIRED_TOKEN |
VERIFICATION_SUCCESS: client_id/client_secretに対するトークン検証成功 INVALID_TOKEN: トークンが不正であるか「aud」がclient_idと一致しない EXPIRED_TOKEN: 期限切れのトークン |
| msg | string | Token Verification Success Token Expired Token Invalid for given ClientId/ClientSecret |
成功/失敗を示すユーザーフレンドリーなメッセージ – 返されたコードに関連付けられます |
| decodedData | dict/obj | 成功後に返されるデコードされたデータ |
{
"iss": 'https://now.gg', // issuer of id_token,
"sub": <>, <sub>,
"aud": client_id,// of App for which token is generated
"exp": <>,// time at which token expires
"iat": <>, // token issued epoch timestamp
"auth_time": <>, // time at which authentication was done
"email": <>, // user email id
"mobile": <> // user mobile with country code prefix
"userId": <> // unique user identifier
"name": <>, // user full name
"picture": <>, // profile picture url
"countryCode":<>, // country code of the user
}
{
"iss": "https://now.gg", // issuer of token
"tokenId": "token_id", // token_id
"aud": "client_id", // client_id
"sessionId": "sessionId", // session Id
"userId": "userId" , // user Id
"scope": "email", // scope of authorization: email/profile/authorization
"iat": 1636779002,
"exp": 1636782602
}
| パラメータ | タイプ | 利用可能 | 説明文 |
|---|---|---|---|
| Iss | string | id_token, token | トークンの発行者 |
| sub | string | id_token | uuid/ulidを反映したランダムな固有文字列 |
| aud | string | id_token, token | トークンが生成される固有のclient_id |
| picture | string | id_token | ユーザーのプロフィール画像のURL |
| exp | int | id_token, token | リクエストの有効期限 – トークンの有効期限 |
| iat | int | id_token, token | トークン発行のEpochタイムスタンプ |
| auth_time | int | id_token | 認証が行われた時刻 |
| string | id_token | アカウントに関連付けられたユーザーのメールアドレス | |
| mobile | string | id_token | プレフィックス(国名)を付加したユーザーの携帯電話番号 |
| userId | string | id_token, token | ユーザー固有の識別子 |
| name | string | id_token | ユーザーのフルネーム |
| countryCode | string | id_token | ユーザーの国コード |
| tokenId | string | token | 返されたトークンのトークンId |
| sessionId | string | token | 認証のセッションID |
| scope | string | token | 承認の範囲:メールアドレス/プロフィール/承認 |
このドキュメントでは、Generate Tokens APIの詳細と使用方法を中心に説明します。
https://now.gg
このAPIは、認証コードを使用してtokenとrefresh_tokenを生成するために使用されます。
POST
/accounts/oauth2/v1/token
Content-Type: application/json
tokenおよびrefresh_tokenを生成するには、Generate Tokens APIで以下のリクエストボディを使用します。
注意: refresh_tokenを使用してtokenを生成する場合は、このセクションを使用してください。
{
client_secret: '<your_oauth_client_secret>',
client_id: '<your_oauth_client_id>',
grant_type: 'code',
code: '<authorization_code received via account manager>',
token_type: '<refresh_token token>',
}
| パラメータ | タイプ | 必須 | 許容値 | 説明文 |
|---|---|---|---|---|
| token_type | string | True | refresh_token, token | リクエストされたトークンのタイプ |
| grant_type | string | True | code | グラント(コード)のタイプ |
| code | string | True | Auth Code | アカウントマネージャー経由で受け取ったauthorization_code |
| client_id | string | True | OAuth client_id | 固有のOAuth client_id |
| client_secret | string | True | OAuth client_secret | 固有のOAuth client_secret |
注意: OAuth 資格情報(client_idとclient_secret)はこのセクションからリクエストできます。
{
"success": true,
"code": "REFRESH_TOKEN TOKEN",
"token": "<token>", // token to be used in the Authorization Header.
"refresh_token": "<refresh_token>", // to generate new token, when token expires.
"token_expiry": "<token_expiry_time>", // token expiry time
"refresh_token_expiry": "<refresh_token_expiry>" // refresh_token expiry time
}
| Params | Type | Description |
|---|---|---|
| success | boolean | True – 操作の成功 False – 操作の失敗 |
| code | string | REFRESH_TOKEN TOKEN |
| token | string | Authorizationヘッダーで使用されるトークン |
| refresh_token | string | トークンの有効期限が切れた際に新しいトークンを生成するために使用する |
| token_expiry | string | 返されたトークンの有効期限 |
| refresh_token_expiry | string | 返されたrefresh_tokenの有効期限 |
tokenの有効期限が切れている場合は、refresh_tokenを使用してトークンを生成してください。
{
client_secret: '<your_oauth_client_secret>',
client_id: '<your_oauth_client_id>',
grant_type: 'refresh_token',
refresh_token: '<refresh_token>',
token_type: '<token>',
}
| パラメータ | タイプ | 必須 | 許容値 | 説明文 |
|---|---|---|---|---|
| token_type | string | True | token | リクエストされたtokenのタイプ |
| grant_type | string | True | refresh_token | グラント(refresh_token)のタイプ |
| refresh_token | string | True | refresh_token | 以前に生成したrefresh_token |
| client_id | string | True | OAuth client_id | 固有のOAuth client_id |
| client_secret | string | True | OAuth client_secret | 固有のOAuth client_secret |
{
"success": true,
"code": "<REFRESH_TOKEN TOKEN>",
"token": "<token>", // token to be used in the Authorization Header.
"token_expiry": "<token_expiry>", // token expiry time
}
| パラメータ | タイプ | 説明文 |
|---|---|---|
| success | boolean | True – 操作の成功 False – 操作の失敗 |
| code | string | REFRESH_TOKEN TOKEN |
| token | string | Authorizationヘッダーで使用されるトークン |
| token_expiry | string | 返されたトークンの有効期限 |
このドキュメントでは、User Info APIの詳細と使用方法について説明します。
https://now.gg
このAPIは、ユーザーに関連付けられているユーザー情報を取得するために使用されます。
GET
/accounts/users/v1/userinfo
ヘッダー内に認証用のBearer Tokenを含める必要があります。
{ Authorization: 'Bearer Token'}
User Info APIを使用してユーザーデータを取得する場合、以下のようなレスポンスが予想されます。
{
success: true,
code: 'USERDATA',
userData: {
email: '', // email address of the user
mobile: '', // mobile number of the user
userId: '', // userId of the user
profilePicture: '', // Profile picture URL
name: '', // name of the user
countryCode: 'IN', // country code of the user
country: '', // country of the user
countryRegionCode: '', // country region code of the user
countryRegion: '', // country region of the user
city: '', // city name of the user
postalCode: '', // postal code of the user
},
}
| パラメータ | タイプ | 説明文 |
|---|---|---|
| success | boolean | True – 操作の成功 False – 操作の失敗 |
| string | ユーザーのメールアドレス | |
| mobile | string | CountryCodeをプレフィックスとして追加したユーザーの携帯電話番号 |
| userId | string | ユーザーアカウントの固有の識別子 |
| profilePicture | string | ユーザーのプロフィール画像のURL |
| name | string | ユーザーのフルネーム |
| countryCode | string | ユーザーの国コード |
| country | string | ユーザーの国 |
| countryRegionCode | string | ユーザーの国地域(州)コード |
| countryRegion | string | ユーザーの国地域(州) |
| city | string | ユーザーの都市 |
| postalCode | string | ユーザーの郵便番号 |
| code | string | USERDATA – ユーザー情報 |
このドキュメントでは、Session Info APIの詳細と使用方法を説明します。
https://now.gg
このAPIは、ユーザーのセッション情報を取得するために使用します。
GET
/accounts/users/v1/sessioninfo
ヘッダー内に認証用のBearer Tokenを含める必要があります。
{ Authorization: 'Bearer Token'}
セッション情報APIを使用してセッションデータを取得する場合、以下のレスポンスが予想されます。
{
success: true,
code: 'USERDATA',
sessionData: {
userAgent: '', // user agent information
ip: '', // ip address of the user
locale: 'en-GB', // locale of the user
deviceData: {
os: {
version: '', // OS version
name: '', // OS name
platform: '', // OS platform
},
device: {
brand: '', // Device brand information
model: '', // Device model information
type: 'desktop', // Type of Device
},
client: {
version: '', // Client version
engine: '', // Client engine
name: '', // Client name
type: '', // Type of client
engineVersion: '', // Engine version of the client
},
},
geoData: {
countryCode: '', // Country code of the user
country: '', // Country of the user
countryRegionCode: '', // Country region of the user
countryRegion: '', // Region of the user
city: '', // City of the user
postalCode: '', // Postal code of the user
},
lastSessionTimestamp: '', // Session timestamp
packageName: '', // Name of the package
},
}
| パラメータ | タイプ | 説明文 |
|---|---|---|
| success | boolean | True – 操作の成功 False – 操作の失敗 |
| code | string | USERDATA – セッション情報 |
| lastSessionTimestamp | string | 最後のセッションのタイムスタンプ |
| packageName | string | パッケージ名 |
| パラメータ | タイプ | 説明文 |
|---|---|---|
| userAgent | string | ユーザーエージェント情報 |
| ip | string | ユーザーのIPアドレス |
| locale | string | ユーザーのロケール |
デバイスデータパラメータ
| パラメータ | タイプ | 説明文 |
|---|---|---|
| OS | ||
| version | string | ユーザーのOSのバージョン |
| name | string | ユーザーのOS名 |
| platform | string | ユーザーのOSのプラットフォーム |
| Device | ||
| brand | int | ユーザーのデバイスのブランド |
| model | int | ユーザーのデバイスのモデル |
| type | string | デバイスのタイプ |
| Client | ||
| version | string | クライアントバージョン |
| engine | string | クライアントエンジン |
| name | string | クライアント名 |
| type | string | クライアントのタイプ |
| engineVersion | string | クライアントのエンジンバージョン |
| Params | Type | Description |
|---|---|---|
| countryCode | string | ユーザーの国コード |
| country | string | ユーザーの国 |
| countryRegionCode | string | ユーザーの国地域(州)コード |
| countryRegion | string | ユーザーの国地域(州) |
| city | string | ユーザーの都市 |
| postalCode | string | ユーザーの郵便番号 |
ユーザーアカウントサービス
ユーザーアカウントサービス
ドキュメント改訂版 1.0