All pages
1 of 6

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

API How-Tos

Retrieve API Information

Learn to retrieve necessary information.

List Accessible Contracts

Learn to retrieve the list of contracts that you are authorized to access.

Download Activity Log Entries

Learn how to download activity log entries from your contract.

Overview

Activity Logs allow contract owners and administrators to view the history of actions performed on your IONOS Cloud resources. You can view the following activities that occur in a specific contract within the IONOS Cloud computing environment: user logins, resource provisioning, configuration changes, data access, and more. Based on the report, you can audit the user activities or modify resources, if needed. The activity log is grouped by contract and can be refined using date ranges.

Visibility into your IONOS Cloud activity is essential for security and operational excellence. With Activity Log, you can view, download, analyze, and respond to actions across your resources. In addition, you can also track the following details to help you analyze and respond effectively:

  • the source of an action

  • resources affected by the activity

  • timeline of the events

Note: An activity log is read-only; hence, all calls to the Activity Log are handled using GET requests.

Authentication

The API uses the following two authentication methods:

  • Basic Authentication: Ensure that the string containing your username and password is base64-encoded and separated by a colon: [email protected]:password.

  • Token Authentication: Provide a header value as Bearer followed by your token.

Error Codes

The API may return different error codes depending on the issue encountered. Some common error codes include:

Error Codes
Description

Example Usage

The following example demonstrates how to download activity log entries for a contract with ID 12345678:

  1. Choose your authentication method:

    • For Basic Authentication, ensure that your username and password are base64-encoded and set the Authorization header in your request.

    • For Bearer Token Authentication, include the Authorization

header with the value
Bearer
followed by your token.
  • Make a GET request to: https://api.ionos.com/activitylog/v1/contracts/12345678.

  • Response: The response will be a JSON object containing the activity log entries for the specified contract.

  • 401 (Unauthorized)

    Indicates invalid authentication credentials.

    403 (Forbidden)

    You do not have the necessary permissions to access the requested resource.

    500 (Internal Server Error)

    An unexpected error occurred on the server side.

    Activity Logs

    With Activity Logs, you can quickly retrieve a list of activities performed in your contract within IONOS Cloud.

    Product Overview

    API How-Tos

    Activity Log

    Retrieve a list of activities performed in your contract within IONOS Cloud.

    Retrieve API Information

    Learn to retrieve necessary information.

    List Accessible Contracts

    Learn to retrieve the list of contracts that you are authorized to access.

    Download Activity Log Entries

    Learn how to download activity log entries from your contract.

    Retrieve API Information

    This operation retrieves general information about the API, such as the name and version.

    Endpoint

    Use the following endpoint to display the API information: https://api.ionos.com/activitylog/v1.

    Request

    To make authenticated requests to the API, the following fields are mandatory in the request header:

    Header Parameters
    Required
    Type
    Description

    Response

    A 200 Successful operation response displays the API details.

    List Accessible Contracts

    You can retrieve the list of contracts that your account credentials are authorized to access using either of the following:

    • a username and a password combination.

    • a token to access the API. For more information about obtaining tokens for relevant contracts, see Authentication API for Tokens.

    Endpoint

    Use the following endpoint to retrieve a list of contracts: https://api.ionos.com/activitylog/v1/contracts.

    Request

    To make authenticated requests to the API, the following fields are mandatory in the request header:

    Header Parameters
    Required
    Type
    Description

    Response

    A 200 Successful operation lists all the contracts.

    Authorization

    yes

    string

    You can use Basic Authentication or a Bearer token. For more information, see Authentication.

    Content-Type

    yes

    string

    Set this to application/json.

    Authorization

    yes

    string

    You can use Basic Authentication or a Bearer token. For more information, see Authentication.

    Content-Type

    yes

    string

    Set this to application/json.

    curl -X 'GET' \
    'https://api.ionos.com/activitylog/v1' \
    -H 'accept: application/json'
    {
      "href": "string",
      "name": "CLOUD API",
      "version": "1.0"
    }
    curl -X 'GET' \
    'https://api.ionos.com/activitylog/v1/contracts' \
    -H 'accept: application/json'
    [
      {
        "id": 12345678,
        "type": "contracts",
        "href": "https://api.ionos.com/activitylog/v1/contracts/12345678"
      },
      {
        "id": 98765432,
        "type": "contracts",
        "href": "https://api.ionos.com/activitylog/v1/contracts/98765432"
      }
    ]

    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

    Note: Remember to update the sample values in the request with valid ones.

    To make authenticated requests to the API, the following path parameter is mandatory:

    Path Parameter
    Required
    Type
    Description

    To make authenticated requests to the API, the following fields are mandatory in the request header:

    Response

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

    Header Parameters
    Required
    Type
    Description

    Authorization

    yes

    string

    You can use Basic Authentication or a Bearer token. For more information, see .

    Content-Type

    yes

    string

    Set this to application/json.

    contractNumber

    yes

    integer

    Contract number for which the activity log entries must be downloaded.

    curl -X 'GET' \
    'https://api.ionos.com/activitylog/v1/contracts/9876543218374837483?offset=0&limit=20' \
    -H 'accept: application/json'
    {
      "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": "[email protected]"
                },
                "sourceService": "ExampleService" 
              },
              "event": {
                "param": {},
                "resources": [
                  {
                    "action": [
                      "sec.user.create"
                    ],
                    "id": "1466",
                    "type": "user"
                  }
                ],
                "type": "RequestAccepted"
              }
            }
          }
        ]
      }
    }
    Authentication