# Download Activity Log Entries

This operation retrieves activity log entries for a specific contract. You can filter the results by providing either of the date ranges: `startDate` or `endDate`. The number of results displayed on each page depends on the `limit` and `offset` values. While `limit` limits the number of response elements, `offset` specifies the starting point within the collection of resource results returned from the server.

## Endpoint

Use the following endpoint to retrieve the activity log entries: `https://api.ionos.com/activitylog/v1/contracts/{contractNumber}`.

## Request

{% hint style="info" %}
**Note:** Remember to update the sample values in the request with valid ones.
{% endhint %}

```bash
curl -X 'GET' \
'https://api.ionos.com/activitylog/v1/contracts/9876543218374837483?offset=0&limit=20' \
-H 'accept: application/json'
```

{% tabs %}
{% tab title="Path Parameters" %}
To make authenticated requests to the API, the following path parameter is mandatory:

| **Path Parameter** | **Required** | **Type** | **Description**                                                        |
| ------------------ | ------------ | -------- | ---------------------------------------------------------------------- |
| `contractNumber`   | yes          | integer  | Contract number for which the activity log entries must be downloaded. |
| {% endtab %}       |              |          |                                                                        |

{% tab title="Request Header Parameters" %}
To make authenticated requests to the API, the following fields are mandatory in the request header:

| **Header Parameters** | **Required** | **Type** | **Description**                                                                                                                                                         |
| --------------------- | ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Authorization`       | yes          | string   | You can use `Basic Authentication` or a `Bearer token`. For more information, see [Authentication](https://docs.ionos.com/cloud/observability/overview#authentication). |
| `Content-Type`        | yes          | string   | Set this to `application/json`.                                                                                                                                         |
| {% endtab %}          |              |          |                                                                                                                                                                         |
| {% endtabs %}         |              |          |                                                                                                                                                                         |

## Response

A **200 Successful operation** indicates that the activity logs are being downloaded for the specified contract number.

```bash
{
  "hits": {
    "total": 1,
    "hits":[
      {
        "_source": {
          "@uuid": "c1b9b1b0-7b1b-11e6-9a41-000d3a002f99",
          "meta": {
            "auditVersion": "0.1",
            "time": "2016-09-23T12:02:52.394Z"
          },
          "principal": {
            "sourceIP": "203.0.113.42",
            "identity": {
              "contractNumber": "31721060",
              "username": "user@example.com"
            },
            "sourceService": "ExampleService"
          },
          "event": {
            "param": {},
            "resources": [
              {
                "action": [
                  "sec.user.create"
                ],
                "id": "1466",
                "type": "user"
              }
            ],
            "type": "RequestAccepted"
          }
        }
      }
    ]
  }
}
```


---

# 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.ionos.com/cloud/observability/activity-logs/how-tos/download-activity-log-entries.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.
