Setting Custom Fields upon the User Registration
You can set custom fields when you register a new user. In the following example, three custom fields followers
, friends
, and status
are set along with the predefined fields:
curl -v -X POST \
-H "Authorization: Basic {BASE64_ENCODED_APPID_AND_APPKEY}" \
-H "Content-Type: application/json" \
"https://api-jp.kii.com/api/apps/{APP_ID}/users" \
-d '{
"loginName": "test004",
"displayName": "person test004",
"country": "JP",
"password": "hogehoge",
"emailAddress": "test004@testkii.com",
"phoneNumber": "+819098439216",
"locale": "ja",
"followers": 5,
"friends": 400,
"status": "available"
}'
You sign up with Basic Authentication. Replace {BASE64_ENCODED_APPID_AND_APPKEY}
with a Base64-encoded string of concatenated AppID and an arbitrary value with a colon (:) in between the two values.
Kii Cloud will respond with the user ID as follows:
< HTTP/1.1 201 Created
< Server: Apache-Coyote/1.1
< Access-Control-Allow-Origin: *
< Location: https://api-jp.kii.com/api/apps/{API_ID}/users/{USER_ID}
< Content-Type: application/vnd.kii.RegistrationResponse+json
< Content-Length: 55
< Date: Tue, 26 Jun 2012 14:47:02 GMT
<
{
"userID" : {USER_ID}
}