User
This page provides an overview of the APIs related to users in the Withnox & Addnox projects.
Introduction
The Withnox & Addnox User APIs allow for operations related to user accounts, such as retrieving and updating user information. We recommend reviewing the authentication section before making API calls.
Authentication
All User APIs require an authentication token. Please include the token in the Authorization
header to authenticate the API calls.
Authorization: Bearer your_token_here
Replace your_token_here
with the access_token obtained during the authentication process.
Endpoints
Retrieve User Information
Fetches information about the logged-in user. The response includes Boolean values indicating whether a password update is required if more than three months have passed since the last password change, and whether personal information needs to be updated.
Headers
Name | Type | description |
---|---|---|
Authorization required | Bearer | access_token |
Request Example
GET /api/v1/addnox/user/me HTTPS
Authorization: Bearer your_token_here
Response Example
{
"root_user_id": 1,
"first_name": "test",
"last_name": "kim",
"birthdate": "20240722",
"gender": "M",
"phone": "+821012345678",
"is_phone_number_checked": true,
"register_type": "E",
"national_code": "KR",
"need_personal_info_update": false,
"need_to_pwd_change": true
}
Error Responses
Refer to the table below for the API status codes and messages associated with each HTTP status code.
HTTP status code | detail | description |
---|---|---|
401 | User is None | No user information found |
401 | User is Deleted | User has been deleted |
{
"detail": "User is None"
}
Update User Information
Updates information for the logged-in user.
Headers
Name | Type | description |
---|---|---|
Authorization required | Bearer | access_token |
Body Parameters
Name | Type | description |
---|---|---|
first_name optional | string | User’s first name (excluding surname) |
last_name optional | string | User’s surname |
birthdate optional | string | User’s birthdate (yyyymmdd) - ex : 19970101 |
gender optional | string | User’s gender - M : Male - F : Female - N : Non Binary - P : Prefer Not to Say |
Request Example
PATCH /api/v1/addnox/user/root-user HTTPS
Authorization: Bearer your_token_here
Content-Type: application/json
{
"first_name": "james",
"last_name": "kim",
"birthdate": "19970101",
"gender": "M"
}
Response Example
{
"id": 1,
"first_name": "james",
"last_name": "kim",
"birthdate": "19970101",
"gender": "M",
"phone": "+821012345678",
"is_phone_number_checked": true,
"register_type": "E"
}
Error Responses
Refer to the table below for the API status codes and messages associated with each HTTP status code.
HTTP status code | detail | description |
---|---|---|
401 | User is None | No user information found |
401 | User is Deleted | User has been deleted |
{
"detail": "Real user not found"
}
Update User Push and Marketing Notifications
Updates the user's preferences for push and marketing notifications.
Headers
Name | Type | description |
---|---|---|
Authorization required | Bearer | access_token |
Body Parameters
Name | Type | description |
---|---|---|
is_push_agree optional | boolean | User's consent for push notifications |
is_marketing_agree optional | boolean | User's consent for marketing communications |
Request Example
PATCH /api/v1/addnox/user/policy HTTPS
Authorization: Bearer your_token_here
Content-Type: application/json
{
"is_push_agree": true,
"is_marketing_agree": true
}
Response Example
{
"is_push_agree": true,
"is_marketing_agree": true,
"push_agree_date": "2024-10-28T07:47:53.563Z",
"marketing_agree_date": "2024-10-28T07:47:53.563Z"
}
Error Responses
Refer to the table below for the API status codes and messages associated with each HTTP status code.
HTTP status code | detail | description |
---|---|---|
404 | User not found | No user information found |
404 | User policy not found | No user policy found. |
{
"detail": "User policy not found"
}
Set User Push Token
Stores the user's FCM token on the server to enable push notifications.
Headers
Name | Type | description |
---|---|---|
Authorization required | Bearer | access_token |
Body Parameters
Name | Type | description |
---|---|---|
token required | string | FCM token for push notifications |
Request Example
POST /api/v1/addnox/user/push/set-token HTTPS
Authorization: Bearer your_token_here
Content-Type: application/json
{
"token": string
}
Response Example
string
Error Responses
Refer to the table below for the API status codes and messages associated with each HTTP status code.
HTTP status code | detail | description |
---|---|---|
400 | Push permisson denied | User disagreed the push permisson |
409 | User push token update failed | invalid token type |
{
"detail": "Push permisson denied"
}
Delete User Account
Deletes the user account, deactivating the user's profile.
Headers
Name | Type | description |
---|---|---|
Authorization required | Bearer | access_token |
Request Example
DELETE /api/v1/addnox/user/root-user HTTPS
Authorization: Bearer your_token_here
Response Example
{
"statusCode": 200,
"message": "Root user deleted"
}
Error Responses
Refer to the table below for the API status codes and messages associated with each HTTP status code.
HTTP status code | detail | description |
---|---|---|
404 | Sign in type is not found | Could not find the user type (email, social) |
{
"detail": "Sign in type is not found"
}
Create User Child Account and Register Device
Creates a child (sub-user) account and registers a device under this account. This endpoint combines the account creation and device registration processes for convenience.
Headers
Name | Type | description |
---|---|---|
Authorization required | Bearer | access_token |
Body Parameters
Name | Type | description |
---|---|---|
first_name required | string | First name of the child account |
last_name required | string | Last name of the child account |
birthdate required | string | Birthdate of the child account (yyyymmdd) - ex : 19970101 |
gender required | string | Gender of the child account - M : Male - F : Female - N : Non Binary - P : Prefer Not to Say |
serial_code required | string | Serial code of the device to be registered |
mac_id required | string | MAC address of the device to be registered |
Request Example
POST /api/v1/addnox/user/create-real-user HTTPS
Authorization: Bearer your_token_here
Content-Type: application/json
{
"first_name": "test",
"last_name": "kim",
"birthdate": "19970101",
"gender": "F",
"serial_code": "SL20401000",
"mac_id": "00:80:E1:27:4C:84"
}
Response Example
{
"real_user_id": 1,
"first_name": "test",
"last_name": "kim",
"birthdate": "19970101",
"gender": "F",
"device_id": 1,
"now_firmware_id": 1,
"unique_id": "string",
"serial_code": "SL20401000",
"device_alias": "string",
"mac_id": "00:80:E1:27:4C:84",
"last_log_file_id": 0,
"created_at": "2024-10-28T08:09:47.889Z"
}
Error Responses
Refer to the table below for the API status codes and messages associated with each HTTP status code.
HTTP status code | detail | description |
---|---|---|
409 | Real user create failed | Real user creation failed |
401 | Not authorized user | No authorization to delete |
404 | Not Found Device | Could not find the device |
409 | Already Connected Device | Device already connected to other user |
{
"detail": "Already Connected Device"
}
Retrieve User Child Account Information
Fetches information about a child (sub-user) account associated with the user. The real_user_id
value can be obtained via /api/v1/addnox/device/get-all-device
.
Headers
Name | Type | description |
---|---|---|
Authorization required | Bearer | access_token |
Parameters
Name | Type | description |
---|---|---|
real_user_id required | integer | ID of the child account to retrieve |
Request Example
GET https://app.nueyne.dev/api/v1/addnox/user/real-user/1 HTTPS
Authorization: Bearer your_token_here
Response Example
{
"id": 0,
"root_user_id": 0,
"first_name": "string",
"last_name": "string",
"birthdate": "string",
"gender": "string"
}
Error Responses
Refer to the table below for the API status codes and messages associated with each HTTP status code.
HTTP status code | detail | description |
---|---|---|
401 | Not authorized user | No authorization |
404 | Real user is not found | Could not find the real user |
{
"detail": "User is None"
}
Update User Child Account Information
Updates the information of a child (sub-user) account associated with the user.
Headers
Name | Type | description |
---|---|---|
Authorization required | Bearer | access_token |
Body Parameters
Name | Type | description |
---|---|---|
id required | integer | real_user_id of the child account to update |
first_name optional | string | First name of the child account |
last_name optional | string | Last name of the child account |
birthdate optional | string | Birthdate of the child account (yyyymmdd) - ex : 19970101 |
gender optional | string | Gender of the child account - M : Male - F : Female - N : Non Binary - P : Prefer Not to Say |
Request Example
GET https://app.nueyne.dev/api/v1/addnox/user/real-user/1 HTTPS
Authorization: Bearer your_token_here
Content-Type: application/json
{
"id": 1,
"first_name": "tester",
"last_name": "john",
"birthdate": "20010608",
"gender": "P"
}
Response Example
{
"id": 1,
"root_user_id": 1,
"first_name": "tester",
"last_name": "john",
"birthdate": "20010608",
"gender": "P"
}
Error Responses
Refer to the table below for the API status codes and messages associated with each HTTP status code.
HTTP status code | detail | description |
---|---|---|
401 | Not authorized user | No authorization |
404 | Real user is not found | Could not find the real user |
{
"detail": "Not authorized user"
}
Delete User Child Account and Unregister Device
Deletes a child (sub-user) account and unregisters the associated device.
Headers
Name | Type | description |
---|---|---|
Authorization required | Bearer | access_token |
Parameters
Name | Type | description |
---|---|---|
real_user_id required | integer | ID of the child account to delete |
unique_id required | string | Unique ID of the device to unregister |
Request Example
DELETE /api/v1/addnox/user/delete-real-user HTTPS
Authorization: Bearer your_token_here
Content-Type: application/json
{
"real_user_id": 1,
"unique_id": "string",
}
Response Example
{
"statusCode": 200,
"message": "Real user deleted successfully",
}
Error Responses
Refer to the table below for the API status codes and messages associated with each HTTP status code.
HTTP status code | detail | description |
---|---|---|
401 | Not authorized user | No authorization |
404 | Real user is not found | Could not find the real user |
409 | Real user delete failed | Real user delete failed |
{
"detail": "Real user is not found"
}
Common Error Handling
The following error codes apply across all endpoints.
Error Response Example
400 Bad Request
: The request is invalid or missing required parameters.{ "detail": "Invalid request or missing parameters" }
401 Unauthorized
: Authentication failed or the token is invalid.{ "detail": "Could not validate credentials" // Token is incorrect or expired }
404 Not Found
: The specified resource could not be found.{ "detail": "Resource not found" }
500 Internal Server Error
: An error occurred on the server.{ "detail": "Internal server error. Please try again later." }