Docs
On this page
task2 min readApplication: Platform Integration

Export records to a reporting database

Copy Servicely records each night into a database you own, through the REST API, so a reporting tool can trend and analyse them.

Export records to your own database when you need trend, ageing or forecast reporting that runs outside Servicely. A nightly job reads the records changed that day through the REST API and loads them into the database your reporting tool reads.

Servicely feeding a customer database through the REST API once a day, 200 records per page, with a reporting tool reading the database.

Before you begin

  • You need the administrator role to create the System API token and the user it impersonates.
  • Have a database in your own environment and a scheduler or ETL tool that can call a REST API. Setting these up, and the reporting tool, is outside Servicely.
  • Choose a Servicely user for the export with read permission on every table you export. It needs no other role.

Steps

  1. List the tables to export by their table names, not their labels. Incidents are Incident, problems Problem and requests ITSMRequest. Tables and fields added in your implementation start with C_, for example C_FleetManagement.

  2. Go to Integrations → API access → System API tokens and create a token that impersonates the export user. To limit it to the REST API, set Allowed Scopes to REST API (v1).

    The System API tokens item in the API access menu of Integrations.
  3. In Servicely, open the list of one table and filter it to the records updated today. Open the menu on the filter’s Copy button and select Criterion JSON to copy the query. REST API link copies a ready-made request URL instead.

  4. Build the request URL for each table from the query, a page size of 200 and a sort order:

    https://<instance>.servicely.ai/v1/Incident?query={"and":[{"fieldName":"UpdatedOn","operator":"=","value":"today()","displayValue":"Today"}]}&page_size=200&page=1&order_desc=CreatedOn
    
  5. In your ETL tool, request page 1, then the next page, until the X-Result-More response header is false.

  6. Insert or update each record in your database by its id, so a record changed twice is stored once.

  7. Schedule the job to run once every 24 hours, out of business hours.

  8. Connect your reporting tool to the database. Rename the field names to readable labels there, for example AssignmentGroup to “Assignment Group” and C_BackgroundInformation to “Background Information”.

Result

After each run the database holds every record changed that day, and the reporting tool reads it without querying Servicely. The REST API returns field names as they are stored, so labels you renamed in the reporting tool stay readable across runs.

Last updated 3 December 2026commit 6777698daac5Chris Jones
Back to top