PublishEventAsync

Publishes a custom event message to the event message sink. Returns (Task)

Cause an event to happen at a particular time for the designated objects in the designated folder.

Name Description
folder The folder in which to publish the event
apiKey The API key for authentication (e.g., “MercuryCommands”)
eventTypeMoniker The event type identifier specifying namespace and nickname
occuredOn The timestamp when the event occurred
data The event data to be serialized to BSON Base64
linkedObjects The related objects (readers, controllers, etc.) associated with this event

Publish Event Async

Example in C#

// Returns: nothing
await client.PublishEventAsync(FolderInfo folder, String apiKey, MonikerItem eventTypeMoniker, DateTime occuredOn, Object data, ObjectLinkItem linkedObjects);

Example in CURL



           curl -X POST \
               https://api.us.acresecurity.cloud/api/f/INSTANCE.KEY/eventmessagesink \
               -H 'Authorization:  Bearer TOKEN_GOES_HERE' \
               -H 'Content-Type: application/json' \
               -d '{
                       "$type":"Feenics.Keep.WebApi.Model.EventMessagePosting, Feenics.Keep.WebApi.Model",
                       "OccurredOn":"2019-01-23T19:30:49.10947Z",
                       "AppKey":"MercuryCommands",
                       "EventTypeMoniker":
                      {
                           "$type":"Feenics.Keep.WebApi.Model.MonikerItem, Feenics.Keep.WebApi.Model",
                           "Namespace":"MercuryServiceCommands",
                           "Nickname":"mercury:command-simulateKeyPress"
                       },
                       "RelatedObjects":
                       [
                           {
                               "$type":"Feenics.Keep.WebApi.Model.ObjectLinkItem, Feenics.Keep.WebApi.Model",
                               "Href":"/api/f/INSTANCE.KEY/peripherals/READER.KEY",
                               "LinkedObjectKey":"READER.KEY",
                               "CommonName":"ReaderExampleForCurl",
                               "Relation":"Reader",
                               "MetaDataBson":null
                           },
                           {
                               "$type":"Feenics.Keep.WebApi.Model.ObjectLinkItem, Feenics.Keep.WebApi.Model",
                               "Href":"/api/f/INSTANCE.KEY/controllers/CONTROLLER.KEY",
                               "LinkedObjectKey":"CONTROLLER.KEY",
                               "CommonName":"ControllerExampleForCurl",
                               "Relation":"Controller",
                               "MetaDataBson":null
                           }
                       ],
                       "EventDataBsonBase64":"FAAAAAJLZXlzAAUAAAA3MDUyAAA="
                   }'