Activities

The Activities API is an important part of OpenTransact. Anytime any data in the system is created, or modified in any way, an event is created for each object that changes. This allows you to track changes to your data over time, and also allows the Rules Engine to trigger rules based on changes to your data.

In this way you can automate your entire payments orchestration layer to do things like automatically update the status of a payment based on the rules you define, check a third-party API prior to processing a payment, or even route payments to different systems based on your own custom logic.

Data Types

ActivityResponse

KeyValueNotes
typeactivities
idUUID
Attributes
actioncreated or updated or deleted
previousObjectThe serialized subject value prior to the activity ocurring (if new will be {})
currentObjectThe serialized subject value after the event completed
diffObjectThe diff between previous and current
metadataMetadata
created-atTimestamp
updated-atTimestamp
Relationships
profileProfileRelathionship
authorAuthorRelationship
applicationApplicationRelationship
subjectSubjectRelationship

ActivityResponse Example

{
  "type": "activities",
  "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
  "attributes": {
    "action": "created",
    "previous": {},
    "current": {},
    "diff": {},
    "metadata": {},
    "created-at": "2022-06-21T23:34:04Z",
    "updated-at": "2022-06-21T23:34:04Z"
  },
  "relationships": {
    "profile": {
      "data": {
        "type": "profiles",
        "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
      }
    },
    "author": {
      "data": {
        "type": "profiles",
        "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
      }
    },
    "application": {
      "data": {
        "type": "applications",
        "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
      }
    },
    "subject": {
      "data": {
        "type": "profiles",
        "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
      }
    }
  }
}

GET/v1/activities

List Activities

This endpoint retrieves a paginated list of Activities. By default, a maximum of thirty Activities are shown per page.

This endpoint returns an array of ActivityResponse objects.

Filters

Request

GET
/v1/activities
curl --request GET \
      --url 'https://api.opentransact.com/v1/activities \
      --header 'Authorization: Basic {API_KEY}'

Response

{
  "data": [
    {
      "type": "activities",
      "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0",
      "attributes": {
        "action": "created",
        "previous": {},
        "current": {},
        "diff": {},
        "metadata": {}
      },
      "relationships": {
        "profile": {
          "data": {
            "type": "profiles",
            "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
          }
        },
        "author": {
          "data": {
            "type": "profiles",
            "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
          }
        },
        "application": {
          "data": {
            "type": "applications",
            "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
          }
        },
        "subject": {
          "data": {
            "type": "profiles",
            "id": "4c72784e-fb2a-4858-8067-95b6e36d54c0"
          }
        }
      }
    },
    ... // 29 more
  ],
  "meta": {
    "current-page": 1,
    "page-count": 2,
    "count": 38
  },
  "links": {
    "self": "https://api.opentransact.com/v1/activities?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "first": "https://api.opentransact.com/v1/activities?page%5Bnumber%5D=1&page%5Bsize%5D=30",
    "next": "https://api.opentransact.com/v1/activities?page%5Bnumber%5D=2&page%5Bsize%5D=30",
    "last": "https://api.opentransact.com/v1/activities?page%5Bnumber%5D=2&page%5Bsize%5D=30"
  }
}

Was this page helpful?