Viewing 1 post (of 1 total)
  • Author
    Posts
  • #9205

    leo
    Keymaster

    A great way to use the External Integrations action on triggers is to self consume the API.

    This opens the door to many possibilities, everything you see in Pegasus was built with an API, so you can imagine having a single trigger make requests to perform any of the actions on the API Reference

    In other words a trigger could be made for a device to change it’s behavior based on some condition or one device could be used to control multiple things.

    In the case of a device changing it’s behavior, an example could be if the panic button is pressed the device could change it’s reporting frequency to the highest value, report every 10 seconds.

    An example of a device controlling other devices could be when a panic button is pressed, it trigger other devices to capture photos.

    To make this possible we facilitate the use of a shortcode

    $pegasus_api

    which when used in the External Integrations it can replace the base_url api endpoint and adds a valid token to the request.

    so for example instead of writing

    https://pegasus1.pegasusgateway.com/api/vehicles/123/remote/tracking_resolution

    you could write

    $pegasus_api/vehicles/123/remote/tracking_resolution

    In order to trigger actions for other entities that fire the trigger, you can use {{object.id}}

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.