Skip to main content

User Endpoints

In the context of our API, a user represents a fundamental entity that interacts with the system. This user can be an authenticated individual who performs specific actions within the platform.

Common User Characteristics​

  1. Unique Identification: Each user has a unique identifier id that distinguishes them from other users in the system.

  2. Personal Data: Typically, a user has associated information such as name, email address, and other contact details.

  3. Permissions and Roles: Users may have assigned roles and permissions that dictate what actions they can perform within the system.

  4. Status and Activity: There may be states indicating whether the user is active, inactive, or temporarily suspended, depending on business rules and platform policies.

  5. Activities and Logging: Activities performed by a user within the system, such as creation, modification, or deletion of resources, may be logged.

  • Authentication and Security: Users often need to authenticate using valid credentials to access certain functions or protected resources.

  • Profile Management: Functionality may exist for users to manage their own profiles, update personal information, or account settings.

  • Interaction with Resources: Users can interact with other system resources, such as creating, reading, updating, and deleting data, based on their permissions and roles.

Importance in the API​

Our API provides specific endpoints to manage and manipulate users within the system. These endpoints enable operations such as creation, updating, retrieval, and deletion of user information in a structured and secure manner.

Access to B2B Platform​

These users will have access to the B2B (Business-to-Business) platform, facilitating transactions and interactions between businesses.

Endpoints​

GET/User/getUser​

Retrieve a paginated list of users from the system.

Description​

This endpoint retrieves a paginated list of users from the system. It allows clients to fetch user data based on pagination parameters such as page number (page) and items per page (pageSize). The response includes detailed information about each user, including their ID, username, full name, email address, status, last update timestamp, associated language details, and business partner information.

Parameters​
NameDescriptionTypeDefault Value
idUser idString optionalid
pagePage numberInteger1
pageSizeNumber of items per pageInteger10
Responses​
JSON​
{
"data": [
{
"id": "string",
"idRemote": "string",
"username": "string",
"name": "string",
"email": "string",
"status": "string",
"updatedAt": "string",
"dateValid": "string",
"active": true,
"language": {
"id": "string",
"code": "string",
"iso": "string",
"name": "string"
},
"businessPartner": {
"id": "string",
"idRemote": "string",
"contactName": "string",
"commercialName": "string",
"tin": "string"
}
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<username>string</username>
<name>string</name>
<email>string</email>
<status>string</status>
<updatedAt>string</updatedAt>
<dateValid>string</dateValid>
<active>true</active>
<language>
<id>string</id>
<code>string</code>
<iso>string</iso>
<name>string</name>
</language>
<businessPartner>
<id>string</id>
<idRemote>string</idRemote>
<contactName>string</contactName>
<commercialName>string</commercialName>
<tin>string</tin>
</businessPartner>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

GET/User/updateFrom​

Retrieve a paginated list of updated users, in a specific date, from the system.

Description​

This endpoint retrieves a paginated list of users from the system who where update in some specific date. It allows clients to fetch user data based on pagination parameters such as page number (page) and items per page (pageSize). The response includes detailed information about each user, including their ID, username, full name, email address, status, last update timestamp, associated language details, and business partner information.

Parameters​
NameDescriptionTypeDefault Value
dateUpdated DateString required1999-01-01
pagePage numberInteger1
pageSizeNumber of items per pageInteger10
Responses​
JSON​
{
"data": [
{
"id": "string",
"idRemote": "string",
"username": "string",
"name": "string",
"email": "string",
"status": "string",
"updatedAt": "string",
"dateValid": "string",
"active": true,
"language": {
"id": "string",
"code": "string",
"iso": "string",
"name": "string"
},
"businessPartner": {
"id": "string",
"idRemote": "string",
"contactName": "string",
"commercialName": "string",
"tin": "string"
}
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML​
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<username>string</username>
<name>string</name>
<email>string</email>
<status>string</status>
<updatedAt>string</updatedAt>
<dateValid>string</dateValid>
<active>true</active>
<language>
<id>string</id>
<code>string</code>
<iso>string</iso>
<name>string</name>
</language>
<businessPartner>
<id>string</id>
<idRemote>string</idRemote>
<contactName>string</contactName>
<commercialName>string</commercialName>
<tin>string</tin>
</businessPartner>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>

πŸ‘‰Try it out🌱

POST/User/create​

User Registration in the API: Using the POST Method​

Currently, our POST method in the API exclusively handles JSON format. To effectively register users, it is crucial to follow a process that ensures data integrity and proper system functionality.

Registration Process:​
  1. Creation of Business Partner: Before registering a user, it is necessary to ensure that a Business Partner is created and associated. This step is fundamental as many of our services and functionalities depend on the existence of this entity. πŸ‘‰Register Business Partner🌱

  2. Assignment of Default Language: Every registered user must be assigned a default language. This ensures effective communication and interaction within the platform right from the start. πŸ‘‰Obtain Language🌱

Details of the POST Method:​

When using the POST method to register users, structured data in JSON format must be provided, including crucial information such as full name, email address, and additional details as required. The process ensures that each user has a unique identity and is correctly configured to interact with the platform securely and efficiently. The idRemote field provided when creating a new entity corresponds to the idRemote that the user wants to give it. The system will automatically create a local id.

[
{
"idRemote": "string",
"username": "string",
"name": "string",
"languageId": "string",
"email": "string",
"businessPartnerId": "string",
"dateValid": "string",
"active": true
}
]

It is possible to add multiple users through the same request by separating them with commas within the array in the body of the request.

πŸ‘‰Try it out🌱

PUT/User/update/{id}​

Updating users

Description​

This endpoint allows clients to update user data using the id parameter. This id field can be either the identifier generated by the B2B database or the idRemote you provide when registering users. This flexibility ensures you can easily integrate and synchronize existing data in your system with our platform, guaranteeing efficient and accurate user information management.

Parameters​
NameDescriptionType
idUser identifierString required
Request Body​

The request body must follow the following schema in JSON format:

{
"username": "string",
"name": "string",
"languageId": "string",
"email": "string",
"businessPartnerId": "string",
"dateValid": "string",
"active": true
}

πŸ‘‰Try it out🌱

DELETE/User/delete/{id}​

Removing Users

Description​

This endpoint allows the deletion of users using their unique identifier. This id field can be either the identifier generated by the B2B database or the idRemote you provide when registering users. It is important to note that when a user is deleted, they are not completely removed from the database to prevent possible data inconsistencies related to associated orders or invoices.


Instead of being completely deleted, the user enters a state where they are not available for active use. Their user data and email will be released, which means that although they cannot be used again immediately, the user can be reactivated if needed in the future. This approach ensures safe and flexible user management within our platform, maintaining data integrity and allowing for easy and controlled recovery of previously deleted users. Once deleted, the User is recorded in the Deleted History.

Parameters​
NameDescriptionType
idUser identifierString required

πŸ‘‰Try it out🌱

Possible Response Errors​

ErrorResponse StatusResponse Body
This error occurs when a connection to the database cannot be established. It is an internal server problem.500{"code": 500,"error": "Database connection failed."}
This error occurs when you cannot insert or update items into the database.500{"code": 500,"error": "Invalid connection name, you cannot insert in default"}
This error occurs when a parameter is missing.400{"code": 400,"error": "Parameter $parameter is required"}
This error occurs when you are not authorized.401{"code": 401,"error": "Unauthorized."}
This error occurs when the User could not be found.404{"code": 404,"error": "No entity found for User with $id."}
This error occurs when you try to insert an User that already exists.409{"code": 409,"error": "Duplicate entry => Care with email and username"}
This error occurs when you try to send too many requests in a short period of time.429{"code": 429,"error": "Too Many Requests"}