VTAP APIs: Empowering Developers to Simplify, Retrieve, and Innovate Seamlessly
VTAP APIs provide powerful functions that enable developers to efficiently retrieve, update, and manage data, as well as perform a variety of operations seamlessly.
In this edition, we give you the following examples:
Refresh a record using
Reload List View
Retrieve the user role details of the currently logged-in user
Retrieve the role details of specific users
Refresh a record using VTAP API for automatic data reload
The changes will not automatically appear on the front end when record details are updated using the POST or PUT methods. This is because these methods update the data on the server side, but the front end does not automatically fetch the latest data unless explicitly instructed to do so. To ensure the updated details are reflected on the front end, the page needs to be reloaded.
We can dynamically refresh the record using the VTAP API without the need for manual page reloads.
When a new record is created via the VTAP API from a list view interface, the list view does not automatically refresh to show the newly added record. Instead, the user has to manually reload the page to see the latest data.
The VTAP API refreshes List View dynamically without requiring a manual page reload.
Retrieve the user role details of the currently logged-in user using the VTAP API
A VTAP API is available that retrieves the details of the currently logged-in user. This API retrieves user details such as personal details, preferences, or system-related data.
Among the information returned by this API, there is a specific focus on the user's role details.
By using this API, developers can seamlessly integrate user-specific functionalities and ensure proper authorization and personalized experiences based on the user's role.
API URL: “me”
Example:
VTAP.Api.Get('me', {
'module': 'Users'
}, (error, response) => {
If (response) {
const roleInfo = response.roleid;
console.log(roleInfo.id); // Logs the role ID
console.log(roleInfo.label); // Logs the role name
}
});
VTAP.Api.Get('me', {
'module': 'Users'
}, (error, response) => {
If (response) {
const roleInfo = response.roleid;
console.log(roleInfo.id); // Logs the role ID
console.log(roleInfo.label); // Logs the role name
}
});
Retrieve the role details of specific users using the VTAP API
You can retrieve role information for a specific user using the VTAP API by providing the user ID as a parameter.
Example:
VTAP.Api.Get('records', {
'module': 'Users',
‘Id’: ‘user_id’
}, (error, response) => {
If (response) {
const roleInfo = response.roleid;
console.log(roleInfo.id); // Logs the role ID
console.log(roleInfo.label); // Logs the role name
}
});
VTAP.Api.Get('records', {
'module': 'Users',
‘Id’: ‘user_id’
}, (error, response) => {
If (response) {
const roleInfo = response.roleid;
console.log(roleInfo.id); // Logs the role ID
console.log(roleInfo.label); // Logs the role name
}
});
Sign up to receive the latest updates!
Your welcome email is on the way to your inbox. If you cannot find it, be sure to look in the Promotions and Spam folder.