Get Interaction by interaction code

Description

This service retrieves all interactions of a specific type for the currently logged-in party, identified by the interaction's code. The results can be filtered by date, sorted, and paginated.


Request

Restrictions

This service requires an authenticated user and can only be called after a successful party login.

Endpoint

GET https://<server-url>/api/v4/interaction/forParty/byInteractionCode/{interaction_code}

Path Parameters

Parameter
Type
Description

interaction_code

String

The code of the interaction type to retrieve (e.g., "comm_sent").

Parameters

Parameter
Location
Description

touchpoint

Query / Header

The identifier for the touchpoint. Use Thalamus-Touchpoint for the header.

token

Query / Header

The authentication token for the API session. Use Thalamus-Token for the header.

fired_date_from

Query

Optional. A date in yyyy-mm-dd format to filter interactions from this date forward.

fired_date_to

Query

Optional. A date in yyyy-mm-dd format to filter interactions up to this date.

order_by

Query

Optional. The name of the column to sort the results by.

order_by_direction

Query

Optional. The sort direction. Accepts asc (default) or desc.

limit

Query

Optional. An integer that limits the number of results returned.

offset

Query

Optional. An integer that specifies the number of rows to skip before returning results.

Full URL Example

# Retrieve interactions for a given type code
https://<server-url>/api/v4/interaction/forParty/byInteractionCode/comm_sent?touchpoint=REST02&token=...

# Filter by date, sort, and paginate
https://<server-url>/api/v4/interaction/forParty/byInteractionCode/comm_sent?fired_date_from=2023-01-01&order_by=creationDate&order_by_direction=desc&limit=10&offset=20&touchpoint=REST02&token=...

Request Body

This request does not have a body.


Response

✅ Successful Response: 200 OK

A JSON object is returned containing an array of interactions that match the specified criteria.

Key Interaction Fields

Field
Type
Description

id

Number

The unique ID of the interaction record.

creationDate

Timestamp

The date the interaction was created.

personId

Number

The ID of the party associated with the interaction.

interactionTypeId

Number

The ID of the interaction type.

tag01-tag25

String

Custom tags associated with the interaction.

context

Object

An object containing contextual information like activityId and touchpointId.

JSON

{
  "interactions": [
    {
      "id": 10,
      "creationDate": 1687522248000,
      "personId": 1,
      "interactionTypeId": 56,
      "tag01": null,
      "context": {
        "activityId": 1,
        "touchpointId": 1,
        "additionalInfo": null
      }
    }
  ]
}

❌ Unsuccessful Response: 400 Bad Request

Returned if the provided interaction_code is invalid or if the filter/sort parameters are malformed.

JSON

{
  "errors": {
    "interaction": "InvalidFiredDateFromLaterFiredDateTo",
    "execution.interaction": "execution.interaction: InvalidFiredDateFromLaterFiredDateTo"
  }
}

❌ Unsuccessful Response: 404 Not Found

Returned if no interaction with the specified interaction_code exists.

JSON

{
  "errors": {
    "error.message": "NOT_FOUND"
  }
}

Last updated

Was this helpful?