APIs for importing data
The public APIs for importing and exporting data used on the Marking Time 2.0 | HCM are available at the Dev.Senior Portal, along with the tutorial on how to use them to import data.
Main APIs used:
- BlobServiceRequestUploadFile
- BlobServiceCommitUploadedFile
- EmployeesImportByFileId
- EmployeesImportByCsv
- employeesSync
- ClockingEventExport
- ClockingEventExportByPeriod
Observation
BlobServiceRequestUploadFile and BlobServiceCommitUploadedFile are not used to import data on People Management | HCM and Ronda Senior.
Data import
Initially, for its application, creating a .TMP file is required to store the necessary information of the employees that will be imported into the application. The file will be sent to senior X Platform, which will process the employees without impacting other functionalities. To do so:
- Request the file upload through the BlobServiceRequestUploadFile endpoint, which will return the address to upload the file and the file identifier. This identifier will be needed in the next import steps;
- After uploading, confirm the file within the platform. To do so, use the BlobServiceCommitUploadedFile endpoint, informing the file identifier;
- Use the EmployeesImportByFileId endpoint to send the identifier of the file that the solution must process, and it will synchronously persist this information.
If you use the EmployeesImportByCsv endpoint, you will need to perform the BlobServiceRequestUploadFile and BlobServiceCommitUploadedFile steps. This processing occurs asynchronously and at the end a message is sent to the user who made the import request, being visible in senior X Platform. With the EmployeesImportByCsv endpoint, the generated file must be a .CSV following the suggested patterns. In both ways, the solution will already have inserted data regarding: employees, managers, business units and platform users.
Note
The EmployeesImportByCsv endpoint also allows creating users on the platform if they don't exist. The .CSV file can be validated with the ValidateEmpoyeesImportByCsv endpoint.
{
"employee": {
{
"pis" : "75475147563" , // PIS without special characters
"mail" : "email@domain.com.br" ,
"name" : "Collaborator name" ,
"company": {
"cnpj" : "17474540000100" , // CNPJ without special characters.
"name" : "Business Unit Name"
},
"managers" : [
{
"mail" : "gestor@domain.com.br" ,
"name" : "Business Unit Name"
"platformUsers" :[
{
"username" : "manager" //Platform user
}
]
}
],
"externalId" : "1-1-0" , //External source system identifier
"registrationNumber" : "1"
"employeeType" : "COMPANY_EMPLOYEE"
"platformUsers" :[
{
"username" : "employee" //Platform user
}
]
}
]
}
Data export
The data to be exported by the application are the clocking events performed by employees. And to export the data, it will be necessary to consume the ClockingEventExport API to receive all the clocking events that have not been previously consumed.
After exporting, all tags that were exported this way are flagged as synchronized and will not be sent in a next API call. If it is necessary to consume tags already flagged as synchronized, the ClockingEventExportByPeriod API must be consumed.
In addition to the clocking events data, it is possible to export information about the activations of devices and employees using, respectively, the APIs ActivationsExport and EmployeesExport . To export overnight logs, use the overnightExport API. See the Consuming an API article from the Dev Portal. Senior, for more information.

English
Español


