Note: This page was translated using automation resources with the purpose of providing content in your language more quickly. Consequently, it may have grammatical errors and similar situations. If the content is not useful in this state, in the page footer you can access the original material in Brazilian Portuguese and also give us opinions on this translation.

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:

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:

  1. 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;
  2. After uploading, confirm the file within the platform. To do so, use the BlobServiceCommitUploadedFile endpoint, informing the file identifier;
  3. 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.

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.

Este artigo ajudou você?