# 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/sections-test/guides/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"
          }
        }
      }
    ]
  }
}
```
