# 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"

![](/files/-MdQe8DkOnAkd36LGCcC)

### 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.

![](/files/-MdQi8ZOtXP1jls1049B)

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"

![](/files/-MdQiTheZ5iTVgqUF6DH)

![](/files/-MdQi_Cpv8sTPUHGfDog)

![](/files/-MdQj-7lkbelveQd634V)

### Example of URL

The example above resulted in the URL shown below.

{% embed url="<https://demo.moment.team/api/1.0/companies/demo/projects/projectRegisteredHoursReport?fromDate=2021-05-01&toDate=2021-05-31&projectTagOperator=and&timeRecordTagOperator=and&groupUserAccountOption=roles&billableRateOption=registered&subtractAbsences=countAsBillable>" %}
Click on the link to see the resulting JSON for the request
{% endembed %}

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

| Parameter              | Value                   |
| ---------------------- | ----------------------- |
| fromDate               | {start date} YYYY-MM-DD |
| toDate                 | {end date} YYYY-MM-DD   |
| projectTagOperator     | and                     |
| timeRecordTagOperator  | and                     |
| groupUserAccountOption | roles                   |
| billableRatioOption    | registered              |
| subtractAbsences       | countAsBillable         |

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

### Request examples

#### [Planned hours](/help/developers/api/how-to-get-the-your-data/timerecords-getreport.md#planned-hours)

#### [Agreed hours / expected hours](/help/developers/api/how-to-get-the-your-data/projects-projectregisteredhoursreport.md#agreed-hours-expected-hours)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.milientsoftware.com/help/developers/api/how-to-get-the-your-data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
