ログインプロバイダ認証情報の一括取得
指定されたユーザに紐付いたログインプロバイダから得られた認証情報(ログインプロバイダ側のユーザID、アクセストークン、など)を取得します。
GET /api/user_attribute
アクセストークンの取り扱い
アクセストークンの取り扱いおよび漏えいには十分気をつけてください。
万が一の場合、ログインプロバイダ側から制限処置などを受ける場合があります。
リクエストパラメータ
パラメータ名 | 型 | 必須 | 説明 |
---|---|---|---|
key | string | ○ | API キー |
identifier | string | △ | 対象のソーシャルPLUS ID |
primary_key | string | △ | 対象のお客様サービス側ユーザID |
エラーコード
HTTP Status | Code | Message | 説明 |
---|---|---|---|
401 | 1 | Invalid API key or key not found. | API キーが指定されていないか、存在しないAPIキーです |
400 | 5 | Required parameter not found. | 必須のパラメーターが指定されていません |
400 | 6 | Invalid parameter. | パラメーターに間違いがあります |
404 | 7 | Entity not found. | 指定されたユーザが存在しません |
レスポンス
キー | 型 | 最大長 | 説明 |
---|---|---|---|
status | string | 15 | リクエストが成功したかどうか(ok または failed ) |
user | object | - | User オブジェクト 参照 |
providers | object | - | ログインプロバイダ ごとの認証情報。ログインプロバイダ オブジェクト 参照 |
User オブジェクト
共通: User オブジェクト を参照してください。
ログインプロバイダ オブジェクト
キー | 型 | 最大長 | 説明 |
---|---|---|---|
{ログインプロバイダ} | object | - | キーはログインプロバイダになります。オブジェクトの構造はログインプロバイダごとに以下に記載します |
注記
以降の項目説明で "常に null
" となっているものは、API の互換性のため残っているが値を返さない項目です。
LINE
キー | 型 | 最大長 | 説明 |
---|---|---|---|
line_id | string | 255 | LINE のユーザ識別子(userId) |
access_token | string | 255 | アクセストークン |
refresh_token | string | 255 | リフレッシュトークン |
expires_at | timestamp | - | アクセストークンの有効期限 |
friendship_status | boolean | - | LINE の友だち状態である場合に true |
friendship_status_updated_at | timestamp | - | LINE の友だち状態の取得日時 |
friendship_updated_at | timestamp | - | 常に null |
created_at | timestamp | - | 連携日時 |
updated_at | timestamp | - | 認証情報の更新日時 |
Yahoo! JAPAN
キー | 型 | 最大長 | 説明 |
---|---|---|---|
yahoo_id | string | 255 | Yahoo! JAPAN のユーザ識別子(GUID) |
access_token | string | 65535 | アクセストークン |
access_token_secret | string | 65535 | 常に null |
refresh_token | string | 255 | リフレッシュトークン |
session_handle | string | 255 | 常に null |
expires_at | timestamp | - | アクセストークンの有効期限 |
handle_expires_at | timestamp | - | 常に null |
client_access_token | string | 65535 | ネイティブアプリ連携 時に、アクセストークン(クライアント) |
client_refresh_token | string | 255 | ネイティブアプリ連携 時に、リフレッシュトークン(クライアント) |
client_expires_at | timestamp | - | ネイティブアプリ連携 時に、アクセストークンの有効期限(クライアント) |
friendship_updated_at | timestamp | - | 常に null |
created_at | timestamp | - | 連携日時 |
updated_at | timestamp | - | 認証情報の更新日時 |
Facebook
キー | 型 | 最大長 | 説明 |
---|---|---|---|
facebook_id | string | 255 | Facebook のユーザ識別子 |
access_token | string | 255 | アクセストークン |
expires_at | string | 255 | アクセストークンの有効期限 |
friendship_updated_at | timestamp | - | 常に null |
created_at | timestamp | - | 連携日時 |
updated_at | timestamp | - | 認証情報の更新日時 |
新 Google
キー | 型 | 最大長 | 説明 |
---|---|---|---|
gplus_id | string | 255 | 新 Google でのユーザ識別子 |
access_token | string | 65535 | アクセストークン |
refresh_token | string | 255 | リフレッシュトークン |
expires_at | string | 255 | アクセストークンの有効期限 |
friendship_updated_at | timestamp | - | 常に null |
created_at | timestamp | - | 連携日時 |
updated_at | timestamp | - | 認証情報の更新日時 |
旧 Google
キー | 型 | 最大長 | 説明 |
---|---|---|---|
google_id | string | 255 | 旧 Google でのユーザ識別子 |
access_token | string | 65535 | アクセストークン |
expires_at | string | 255 | アクセストークンの有効期限 |
friendship_updated_at | timestamp | - | 常に null |
created_at | timestamp | - | 連携日時 |
updated_at | timestamp | - | 認証情報の更新日時 |
Apple
キー | 型 | 最大長 | 説明 |
---|---|---|---|
apple_id | string | 255 | Apple のユーザ識別子 |
created_at | timestamp | - | 連携日時 |
updated_at | timestamp | - | 認証情報の更新日時 |
Twitter
キー | 型 | 最大長 | 説明 |
---|---|---|---|
twitter_id | string | 255 | Twitter のユーザ識別子 |
access_token | string | 255 | アクセストークン |
access_secret | string | 255 | アクセスシークレット |
expires_at | timestamp | - | アクセストークンの有効期限。常に null |
client_access_token | string | 255 | ネイティブアプリ連携 時に、アクセストークン(クライアント) |
client_access_secret | string | 255 | ネイティブアプリ連携 時に、アクセスシークレット(クライアント) |
client_expires_at | timestamp | - | ネイティブアプリ連携 時に、アクセストークンの有効期限(クライアント) |
friendship_updated_at | timestamp | - | 常に null |
created_at | timestamp | - | 連携日時 |
updated_at | timestamp | - | 認証情報の更新日時 |
レスポンス例
{
"status": "ok",
"user": {
"identifier": "5f8a9b18e6eafc375f756af8d75763d43175a00e",
"primary_key": "user_123",
"mapped_at": "2021-03-14T13:29:28Z",
"last_logged_in_at": "2021-04-10T09:42:41Z",
"last_logged_in_provider": "yahoo",
"login_count": 40,
"created_at": "2012-04-10T08:19:07Z",
"profile_prohibited": false,
},
"providers": {
"line": {
"line_id": "U9810e27f7b07a65c69be1219f3400000",
"access_token": "eyJhbGciOiJIUzI1N123.Fp_kDPwxh-44g6BG...3HzycRR5eidPQ.5DFZn5NqLw...aBpUajz-b456",
"refresh_token": "4izfbBr...O5ih999",
"expires_at": "2020-08-04T08:36:51Z",
"friendship_updated_at": null,
"created_at": "2020-02-22T06:02:29Z",
"updated_at": "2020-07-05T08:36:51Z",
"friendship_status": true,
"friendship_status_updated_at": "2020-07-05T08:36:51Z"
},
"yahoo": {
"yahoo_id": "TJS7X3KFJ67MICRKZGKD200000",
"access_token": "TdFj8xQH4fDUPcJP...TT6glzhqWFbsoY31YDxA--",
"access_token_secret": null,
"refresh_token": "A1fK4mABAAaTYkl...g8frHi7nkqbGJWZ6w~1",
"session_handle": null,
"expires_at": "2020-07-05T10:01:11Z",
"handle_expires_at": null,
"client_access_token": null,
"client_refresh_token": null,
"client_expires_at": null,
"friendship_updated_at": null,
"created_at": "2019-10-29T09:24:12Z",
"updated_at": "2020-07-05T09:01:11Z"
}
}
}
実行サンプル
curl -X GET https://api.socialplus.jp/api/user_attribute -G \
-d key={API Key} \
-d primary_key={Primary Key}