User service
User service provides the management functions of the user profile.
Retrieve user information
Retrieve user information of current user.
Request Header:
| Header: | Description |
|---|---|
| X-APITOKEN | API_TOKEN_HERE |
Response Body:
| Elements | Type | Descritption | |
|---|---|---|---|
| user_id | string | user_id | |
| api_token | string | API_TOKEN | |
| device_token | string | DEVICE_TOKEN | |
| email1 | string | email 1 of 2 | |
| email2 | string | enmai 2 of 2 | |
| organization | string | organization name | |
| locale | string | your locale | |
| user_alias | string | alias of user account | |
| storage | object | ||
| storage:count | number | total records of all channels | |
| storage:usage_bytes | number | usage of storage | |
| storage:maxSize | number | maxSize of storage | |
| storage:avg_obj_size | number | average of object size |
GET https://m.thingscale.io/v2/user
Parameters: NONE
Sample payload:
[
{
"user_id": "xxxxxxxxxxxx",
"api_token": "xxxxxxxxxxxx",
"device_token": "xxxxxxxxxxxx",
"email1": "[email protected]",
"email2": "[email protected]",
"organization": "Sensinics,LLC",
"locale": "Asia/Tokyo",
"user_alias": "Toru Murasawa",
"storage": {
"count": 10,
"usage_bytes": 36864,
"maxSize": 5242880000,
"avg_obj_size": 97
}
}
]
curl -X GET -H "X-APITOKEN: API_TOKEN_HERE" -k https://m.thingscale.io/v2/user
Response code:
| HTTP status: | Desc./Response body |
|---|---|
| 200 OK | Transaction OK. |
| 401 Unauthorized | {"error": "AUTH_REQUIRED"} |
Update user information
Update user information of current user.
Request Header:
| Header: | Description |
|---|---|
| X-APITOKEN | API_TOKEN_HERE |
Request Body:
| Elements | Type | Descritption |
|---|---|---|
| email1 | string | email 1 of 2 |
| email2 | string | enmai 2 of 2 |
| organization | string | organization name |
| locale | string | your locale |
| user_alias | string | alias of user account |
PUT https://m.thingscale.io/v2/user
Parameters: NONE
Sample payload:
{
"email1": "YOUR_EMAIL_ADDRESS1",
"email2": "YOUR_EMAIL_ADDRESS2",
"organization": "YOUR_ORGANIZATION",
"locale": "YOUR_LOCALE(TIMEZONE)", // e.g. Asia/Tokyo (set from Management Console recommended.)
"user_alias": "YOUR_NAME"
}
curl -X PUT -H "X-APITOKEN: API_TOKEN_HERE" -k https://m.thingscale.io/v2/user
Response code:
| HTTP status: | Desc./Response body |
|---|---|
| 200 OK | Transaction OK. |
| 400 Bad Request | { "error": "BAD_JSON_FORMAT" } // check json array. |
| 401 Unauthorized | {"error": "AUTH_REQUIRED"} |