How to get the your data

To get the correct data from the API, an easy method is making a report that contains the data presented as needed. Using the developer tool that is included in Google Chrome (and other browsers), one are able to extract the correct API request.

Developer tools

A method to get what fields and values needed to get your specific data is using Google Chrome and reading the URL used to get data within the application. This can be done using the Developer tools that are part of Google Chrome.

Activate Developer tools

In Google Chrome, open the menu in the top left, go to "More tools" and here select "Developer tools"

In Moment

Log in to Moment as usual and open the report containing the required data . Edit the report to contain fields and values according to filters, e.g. tags etc.

Return the developers tools window, select to filter by XHR only (See screenshot below)

In the left panel, the URLs that where used to display the report is shown. Click on the first one, verify in the right panel that the Request URL is getting data from the API.

To get a copy of the URL, right-click the URL in the left panel. Select "Copy", then "Copy link address"

Example of URL

The example above resulted in the URL shown below.

In this case the "/companies/{company}/projects/projectRegisteredHoursReport" endpoint and the following parameters/values was used.

Based on this example it should be possible to create the API request needed.

Request examples

Last updated