esmDevelopers
JSプラグイン
esm API
JSプラグイン
esm API
  • アクセストークン

アクセストークン

アクセストークンは、認証済みのユーザーがシステムにアクセスする際に使用する一時的な認証情報です。

有効期限

アクセストークンの有効期限は1時間(3,600 秒)です。
有効期限が過ぎた場合は、新たなトークンを発行するか、リフレッシュトークンを使って更新を行う必要があります。

実行ユーザーと権限範囲

実行ユーザーと権限範囲は、アクセストークンの発行ユーザーと同一となります。

Warning

発行したアクセストークンは、第三者に知られないように注意してください。

アクセストークン発行

Request

URL

https://gateway-esm.softbrain.com/auth/token

HTTP Method

POST

Request Body

No.プロパティ名必須項目名タイプ備考
1grantType○認可方式stringアクセストークン発行を行う際は"password"と指定してください。
2userId○ユーザーIDstringesmのログインID
3password○パスワードstringesmのログインパスワード
4tenantId○テナントIDstring

Example

{
    "grantType": "password",
    "userId": "userId",
    "password": "password",
    "tenantId": "tenantId"
}

Response

No.プロパティ名項目名タイプ備考
1accessTokenアクセストークンstring
2tokenTypeトークンタイプstring
3expireIn有効期限(秒)number
4refreshTokenリフレッシュトークンstring

Example

{
    "accessToken": "ey....",
    "tokenType": "BEARER",
    "expireIn": 3600,
    "refreshToken": "125b25b231b9412997371a30bcff15cb"
}

アクセストークン更新

Request

URL

https://gateway-esm.softbrain.com/auth/token

HTTP Method

POST

Request Body

No.プロパティ名必須項目名タイプ備考
1grantType○認可方式stringアクセストークン更新を行う際は"refresh"と指定してください。
2refreshToken○リフレッシュトークンstring更新対象のアクセストークン発行時に取得したリフレッシュトークンを指定してください。
3tenantId○テナントIDstring

Example

{
    "grantType": "refresh",
    "refreshToken": "125b25b231b9412997371a30bcff15cb",
    "tenantId": "tenantId"
}

Response

No.プロパティ名項目名タイプ備考
1accessTokenアクセストークンstring
2tokenTypeトークンタイプstring
3expireIn有効期限(秒)number
4refreshTokenリフレッシュトークンstring

Example

{
    "accessToken": "ey....",
    "tokenType": "BEARER",
    "expireIn": 3600,
    "refreshToken": "0dc9b8aeec31480d8ad64af6dc337715"
}