Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Events are designed as a way to track changes to individual resources throughout the OmniFund application. Resources can be thought of as the different type of objects/records that are created/updated/deleted within the app. Some examples of a resource would be: Transaction, Customer, PaymentAccount, or Invoice. Each one of this may have one or more events happen to it during its lifetime.



End-PointMethodsDescription
/api/eventsGETReturn a collection of events.  
/api/events/{id}GETReturn a single event by its ID.


Info
titleAPI Authentication

All API end-points require an authentication header to included with the request.  See API Authentication


The Event Object



FieldTypeDescription
idstringUnique identifier for the event.
ownerstringAccount owner of the resource
resourcestringIdentifier for the application resource that the event applies to
locationstringLocation where the event was initiated
typestringType of event
eventDataobjectObject containing the information associated with the resource.
createdAtintTime at which the object was created. Measured in seconds since the Unix epoch. UTC



Code Block
languagexml
themeRDark
titleThe Event Object
{
	"id": "025a161c5863e5645e8e997a4",
    "owner": "merch_123456",
    "resource": "cust_5c991e6774567",
    "source": "test-user",
    "location": "dashboard",
    "type": "customer.updated",
    "createdAt": 1553538663,
    "eventData": {
		"object": {
			"id": "5c991e6774567",
            "object": "customer",
            "customerRef": "123-7784",
            "displayName": "Test Customer",
            "company": "",
            "firstName": "Test",
            "lastName": "Customer",
            "displayAs": "contact",
            "address1": "123 main st.",
            "address2": "",
            "city": "Somewhere",
            "state": "CO",
            "zip": "12345",
            "country": "US",
            "phone": "1-555-123-34567",
            "phoneExt": "",
            "email": "test-customer@omnifund.com",
            "dateAdded": "2019-03-25",
            "notes": "",
            "active": "1"
		},
        "previousAttributes": {
        	"phone": ""
        }
	}
	
}



List All Events



ArgumentTypeDescription
typestringName of the event type to filter by.  Optionally, multiple events can be filtered by using type[]


Code Block
languagexml
themeRDark
# filter based on a single event type
GET /api/events?type=customer.updated

# filter based on multiple event types
GET /api/events?type[]=customer.created&type[]=customer.updated


createdAtstring

Unix timestamp to filter based on the createdAt Event field.   The value can be a string with an integer timestamp, or it can be a represented with the following options:

  • createdAt[between]
    Filter events between two timestamps
  • createdAt[gt]
    Filter events greater than a timestamp
  • createdAt[gte]
    Filter events greater than or equal to a timestamp
  • createdAt[lt]
    Filter events less than a timestamp
  • createdAt[lte]
    Filter events less than or equal to a timestamp


Code Block
languagexml
themeRDark
# filter based on a single timestamp
GET /api/events?createdAt=1553538663

# filter events between two timestamps
GET /api/events?createdAt[between]=1553538663..1553638663

# filter events greater than or equal to a timestamp
GET /api/events?createdAt[gte]=1553538663



Retrieve an Event

Retrieves the details of a single event based on the supplied unique identifier.



ArgumentTypeDescription
idstringRequired.  The event identifier to be retrieved.


Code Block
languagexml
themeRDark
# retrieve event
GET /api/events/f4244e2e8b29426b9c490597f21e6b51




Event Types


EventDescriptionEvent Objects
account.autoupdate

Details an event involving the auto-update of a payment account based on information received from the processing bank.