Retrieving Other User's Data

You can access other user's attributes by specifying their username, email address or phone number.

Retrievable user attributes

You can only read other user's attributes. The amount of user attributes retrievable depends on the application setting (the "Expose Full User Data To Others" option). See User Attributes for the further discussion.

To learn how you can change the application setting, see Configuring User Attribute Disclosure Level

Retrieve user attributes with username

The following sample shows you how to retrieve user data by username.

curl -v -X GET \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  "https://api-jp.kii.com/api/apps/{APP_ID}/users/LOGIN_NAME:{USERNAME}"

Retrieve user attributes with email address

The following sample shows you how to retrieve user data by email address. Note that you must specify the verified email address.

curl -v -X GET \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  "https://api-jp.kii.com/api/apps/{APP_ID}/users/EMAIL:{EMAIL_ADDRESS}"

Retrieve user attributes with phone number

The following sample shows how you can retrieve a user data by his/her phone number. You must specify the verified phone number. Also, please specify the phone number in an international phone number format (starting with + and your country code).

curl -v -X GET \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  "https://api-jp.kii.com/api/apps/{APP_ID}/users/PHONE:{PHONE_NUMBER}"

Retrieve user attributes with userID

The following sample shows how you can retrieve a user data by his/her User ID.

curl -v -X GET \
  -H "Authorization: Bearer {ACCESS_TOKEN}" \
  "https://api-jp.kii.com/api/apps/{APP_ID}/users/{USER_ID}"

Response from Kii Cloud

In all cases, Kii Cloud will return the requested user data as follows:

< Content-Type: application/vnd.kii.UserDataRetrievalResponse+json
<
{
  "userID" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "loginName" : "Test003",
  "displayName" : "Person Test003",
  "_disabled": false
}

If the application parameter exposeFullUserDataToOthers is true, Kii Cloud will return a full set of user data.