# Get a single activity

- Operation ID: `getActivityForClient`
- HTTP method: `POST`
- Path: `/activities-api/activity/by/{identifierType}`
- [Human-readable API reference](https://hub.synerise.com/api-reference/data-management#tag/Activities/operation/getActivityForClient)

## Self-contained OpenAPI method

The fenced document below contains this method's documentation and all of its local references. It is self-contained; no category or master specification fetch is required.

```yaml
openapi: 3.0.0
info:
  title: Synerise Public API
  version: 1.9.1
paths:
  /activities-api/activity/by/{identifierType}:
    post:
      deprecated: true
      tags:
        - Activities
      summary: Get a single activity
      description: |
        Retrieve the details of a single activity.

        ---

        **API consumers:** <a href="/api-reference/authorization?tag=Authorization&amp;operationId=userLogin" target="_blank" rel="noopener">Synerise User</a>, <a href="/api-reference/authorization?tag=Authorization&amp;operationId=profileLogin" target="_blank" rel="noopener">Workspace (Business Profile)</a>

        **API key permission required:** `ACTIVITIES_API_ACTIVITIES_READ`

        **User role permission required:** `client_activities: read`
      operationId: getActivityForClient
      security:
        - JWT: []
      parameters:
        - in: path
          name: identifierType
          description: Profile identifier type
          required: true
          schema:
            type: string
            enum:
              - id
              - uuid
              - email
              - custom_identify
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - identifierValue
                - additionalData
              properties:
                identifierValue:
                  type: string
                  description: Value of the selected profile identifier
                additionalData:
                  description: Identification of the event to retrieve
                  oneOf:
                    - type: object
                      title: Event storage data request
                      required:
                        - time
                        - unique
                      properties:
                        time:
                          type: string
                          description: |-
                            Unix timestamp of when the event occurred, in milliseconds. To find the value you need:
                            - from raw data responses, use the `time` property from the `params` object
                            - from event storage responses, use the `time` or `createDate` property
                          example: "1667563770404"
                        unique:
                          type: string
                          description: Unique identifier of the event
                          example: "1245924049"
                    - type: object
                      title: Raw data request (if not available, data from event storage is returned)
                      required:
                        - time
                        - eventUUID
                      properties:
                        time:
                          type: integer
                          description: |-
                            Unix timestamp of when the event occurred, in milliseconds.

                            This is the time that:
                            - is sent as `recordedAt` to **v4/transactions/** endpoints
                            - is sent as `time` to **v4/events/** endpoints
                            - is the occurrence time of system events
                            - is used (after converting to ISO string) as the event time when overwriting with eventSalt (see v4/events endpoints)

                            If the event had no time provided when sending, the time of receiving the event is used.

                            If the event had a future time when sending, it was rejected and the time of receiving the event is used.
                          example: 1667563770404
                        eventUUID:
                          type: string
                          description: UUID of the event
                          example: 482af443-7f6f-4b80-b4ac-a7db5a2f543a
      responses:
        "200":
          description: Activity
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    title: Data from event storage
                    properties:
                      action:
                        type: string
                        example: page.visit
                        description: "Action name. Can be up to 32 characters long and must match the following regular expression: `^[a-zA-Z0-9\\.\\-_]+$`"
                      eventUUID:
                        type: string
                        description: UUID of the event
                        example: 482af443-7f6f-4b80-b4ac-a7db5a2f543a
                      unique:
                        type: integer
                        description: Unique identifier of the event
                        example: 1245924049
                      createDate:
                        type: integer
                        description: |-
                          Unix timestamp of when the event occurred, in milliseconds.

                          This is the time that:
                          - is sent as `recordedAt` to **v4/transactions/** endpoints
                          - is sent as `time` to **v4/events/** endpoints
                          - is the occurrence time of system events
                          - is used (after converting to ISO string) as the event time when overwriting with eventSalt (see v4/events endpoints)

                          If the event had no time provided when sending, the time of receiving the event is used.

                          If the event had a future time when sending, it was rejected and the time of receiving the event is used.
                        example: 1667563770404
                      label:
                        type: string
                        deprecated: true
                      params:
                        type: object
                        description: Parameters of the event
                        properties:
                          eventCreateTime:
                            type: string
                            format: date-time
                            description: |-
                              Time when the event was received, as an ISO string.
                              When you overwrite an event with eventSalt, this value changes to the time of overwriting.
                            example: 2022-11-04T12:09:30.404Z
                          ip:
                            type: string
                            description: IP of the device which sent the event
                        additionalProperties:
                          description: Additional parameters required by this event type and custom parameters.
                  - type: object
                    title: Raw data
                    properties:
                      action:
                        type: string
                        example: page.visit
                        description: "Action name. Can be up to 32 characters long and must match the following regular expression: `^[a-zA-Z0-9\\.\\-_]+$`"
                      eventUUID:
                        type: string
                        description: UUID of the event
                        example: 482af443-7f6f-4b80-b4ac-a7db5a2f543a
                      unique:
                        type: integer
                        nullable: true
                        description: Not available (null) with raw data
                      label:
                        type: string
                        deprecated: true
                        description: The label that was sent with the event.
                      createDate:
                        type: integer
                        description: |-
                          Unix timestamp of when the event occurred, in milliseconds.

                          This is the time that:
                          - is sent as `recordedAt` to **v4/transactions/** endpoints
                          - is sent as `time` to **v4/events/** endpoints
                          - is the occurrence time of system events
                          - is used (after converting to ISO string) as the event time when overwriting with eventSalt (see v4/events endpoints)

                          If the event had no time provided when sending, the time of receiving the event is used.

                          If the event had a future time when sending, it was rejected and the time of receiving the event is used.
                        example: 1667563770404
                      params:
                        type: object
                        description: Parameters of the event. Some of the parameters listed here don't exist in system events.
                        additionalProperties:
                          description: Other parameters depending on event type and custom parameters
                        properties:
                          ip:
                            type: string
                            description: IP of the device which sent the event
                          clientId:
                            type: number
                            description: Profile's ID
                          uuid:
                            type: string
                            description: Profile's UUID
                          snr-original-time:
                            type: string
                            description: Original ISO string that was sent with the event. This is saved without modification even if the time was rejected (for example, because it was a future date).
                          eventUUID:
                            type: string
                            description: UUID of the event
                            example: 482af443-7f6f-4b80-b4ac-a7db5a2f543a
                          eventCreateTime:
                            type: string
                            format: date-time
                            description: |-
                              Time when the event was received, as an ISO string.
                              When you overwrite an event with eventSalt, this value changes to the time of overwriting.
                            example: 2022-11-04T12:09:30.404Z
                          time:
                            type: integer
                            description: |-
                              Unix timestamp of when the event occurred, in milliseconds.

                              This is the time that:
                              - is sent as `recordedAt` to **v4/transactions/** endpoints
                              - is sent as `time` to **v4/events/** endpoints
                              - is the occurrence time of system events
                              - is used (after converting to ISO string) as the event time when overwriting with eventSalt (see v4/events endpoints)

                              If the event had no time provided when sending, the time of receiving the event is used.

                              If the event had a future time when sending, it was rejected and the time of receiving the event is used.
                            example: 1667563770404
                          businessProfileId:
                            type: integer
                            description: Workspace ID
      x-snr-doc-urls:
        - /api-reference/data-management#tag/Activities/operation/getActivityForClient
      x-codeSamples:
        - lang: cURL
          label: cURL
          source: |-
            curl --request POST \
              --url https://api.synerise.com/activities-api/activity/by/%7BidentifierType%7D \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"identifierValue":"string","additionalData":{"time":"1667563770404","unique":"1245924049"}}'
        - lang: Python
          label: Python
          source: |-
            import http.client

            conn = http.client.HTTPSConnection("api.synerise.com")

            payload = "{\"identifierValue\":\"string\",\"additionalData\":{\"time\":\"1667563770404\",\"unique\":\"1245924049\"}}"

            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
                }

            conn.request("POST", "/activities-api/activity/by/%7BidentifierType%7D", payload, headers)

            res = conn.getresponse()
            data = res.read()

            print(data.decode("utf-8"))
        - lang: JavaScript
          label: JavaScript
          source: |-
            const data = JSON.stringify({
              "identifierValue": "string",
              "additionalData": {
                "time": "1667563770404",
                "unique": "1245924049"
              }
            });

            const xhr = new XMLHttpRequest();
            xhr.withCredentials = true;

            xhr.addEventListener("readystatechange", function () {
              if (this.readyState === this.DONE) {
                console.log(this.responseText);
              }
            });

            xhr.open("POST", "https://api.synerise.com/activities-api/activity/by/%7BidentifierType%7D");
            xhr.setRequestHeader("Authorization", "Bearer REPLACE_BEARER_TOKEN");
            xhr.setRequestHeader("content-type", "application/json");

            xhr.send(data);
        - lang: Node.js
          label: Node.js
          source: |-
            const http = require("https");

            const options = {
              "method": "POST",
              "hostname": "api.synerise.com",
              "port": null,
              "path": "/activities-api/activity/by/%7BidentifierType%7D",
              "headers": {
                "Authorization": "Bearer REPLACE_BEARER_TOKEN",
                "content-type": "application/json"
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on("data", function (chunk) {
                chunks.push(chunk);
              });

              res.on("end", function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              identifierValue: 'string',
              additionalData: {time: '1667563770404', unique: '1245924049'}
            }));
            req.end();
        - lang: PHP
          label: PHP
          source: |-
            <?php

            $request = new HttpRequest();
            $request->setUrl('https://api.synerise.com/activities-api/activity/by/%7BidentifierType%7D');
            $request->setMethod(HTTP_METH_POST);

            $request->setHeaders([
              'Authorization' => 'Bearer REPLACE_BEARER_TOKEN',
              'content-type' => 'application/json'
            ]);

            $request->setBody('{"identifierValue":"string","additionalData":{"time":"1667563770404","unique":"1245924049"}}');

            try {
              $response = $request->send();

              echo $response->getBody();
            } catch (HttpException $ex) {
              echo $ex;
            }
        - lang: Java
          label: Java
          source: |-
            HttpResponse<String> response = Unirest.post("https://api.synerise.com/activities-api/activity/by/%7BidentifierType%7D")
              .header("Authorization", "Bearer REPLACE_BEARER_TOKEN")
              .header("content-type", "application/json")
              .body("{\"identifierValue\":\"string\",\"additionalData\":{\"time\":\"1667563770404\",\"unique\":\"1245924049\"}}")
              .asString();
servers:
  - description: Microsoft Azure EU
    url: https://api.synerise.com
  - description: Microsoft Azure USA
    url: https://api.azu.synerise.com
  - description: Google Cloud Platform
    url: https://api.geb.synerise.com
tags:
  - name: Activities
components:
  securitySchemes:
    JWT:
      type: http
      scheme: bearer
      description: |-
        JWT Bearer token. The header looks like this: `Bearer {JWT}`

        Remember to include the space between 'Bearer' and the token.

        Generate a token via the **Authorization** endpoints.
```
