Platform Status: Good
V1.5
Join Free
API Reference
Events

Events

Events are things that have happened. These will be sent to your configured webhook if you have setup a subscription for the event type.

Available Endpoints:

HTTP Method

Endpoint

Function

List events
Get an event

List events

Endpoint URL
GET https://api.port.im/events
Content Type
application/json
Authentication
OAuth2 Access token

Retrieves events that have occurred in pages of 100 rows. For example, to read the first page of 100 events, call the endpoint with an offset parameter of 0 and to read the second page of 100 events, call the endpoint with an offset parameter of 100.

Parameter

Type

Required

Description

offset
Integer
No
The offset row from the first event (defaults to 0)

Example request

curl --request GET \
--url 'https://api.port.im/events' \
--header 'Authorization: Bearer {access_token}' \
--include

Example response

HTTP/1.1 200 OK
Date: Fri, 16 Feb 2018 02:42:47 GMT
Server: PORT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000 ; includeSubDomains ; preload
Content-Type: application/json;charset=UTF-8
Content-Length: 4378

[ {
  "id" : "228k0qc2z9",
  "eventtime" : "2018-02-16T01:21:10.842Z",
  "type" : "DIRECT_DATA_CHANGE",
  "properties" : {
    "user" : "507",
    "entity" : "1390",
    "changeset" : "1709"
  },
  "delivered" : true,
  "deliveredtime" : "2018-02-16T02:00:37.173Z"
}, {
  "id" : "228lc5tkwm",
  "eventtime" : "2018-02-16T02:07:51.529Z",
  "type" : "DIRECT_DATA_CHANGE",
  "properties" : {
    "user" : "507",
    "entity" : "1390",
    "changeset" : "1710"
  },
  "delivered" : true,
  "deliveredtime" : "2018-02-16T02:07:52.448Z"
} ]

Get an event

Endpoint URL
GET https://api.port.im/events/{event_id}
Content Type
application/json
Authentication
OAuth2 Access token

Retrieves a specific event.

Path parameters

Parameter

Required

Description

event_id
Yes
The unique id for the Event.

Example request

curl --request GET \
--url 'https://api.port.im/events/228k0qc2z9' \
--header 'Authorization: Bearer {access_token}' \
--include

Example response

HTTP/1.1 200 OK
Date: Fri, 16 Feb 2018 02:47:05 GMT
Server: PORT
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Strict-Transport-Security: max-age=31536000 ; includeSubDomains ; preload
Content-Type: application/json;charset=UTF-8
Content-Length: 264

{
  "id" : "228k0qc2z9",
  "eventtime" : "2018-02-16T01:21:10.842Z",
  "type" : "DIRECT_DATA_CHANGE",
  "properties" : {
    "user" : "507",
    "entity" : "1390",
    "changeset" : "1709"
  },
  "delivered" : true,
  "deliveredtime" : "2018-02-16T02:00:37.173Z"
}