Viewing 0 reply threads
  • Author
    Posts
    • #8853
      leo
      Keymaster

      Pegasus Gateway can be embedded using iframes with the help of tokens.

      Tokens are created via a POST /user/sessions. With this API you can control scopes, groups and which pegasus applications the token has access to.

      The parameters are as follow:
      app – custom name
      schemefinite or infinite whether you wan the token to expire or not
      limit – token expiration time in seconds
      scopesgroups=<group_csvs>&read=<scope_name_csv>&write=<scope_name_csv>
      app_schemeisolated&locked&apps=<app_name_csv>&disable_trips_history=[0|1]&vehicles=<vehicle_id>

      isolated – eliminates the toolbar
      locked – eliminates the ability to hit the back button on tracking
      disable_trips_history – 1 to disable historic information, 0 to have it enabled (shows the last 3 days worth)
      vehicles – vehicle ID to view the information

      list of app_names:

      [
        "automation",
        "alerts",
        "tracking",
        "trips"
        "reports",
        "rawdata",
        "geofences",
        "accessories",
        "applications",
        "syrus mobile",
        "routes monitoring",
        "organization",
      ]
      

      Example:

      POST https://pegasus1.pegasusgateway.com/api/user/sessions

      {
        "scheme": "finite",
        "limit": 7776000,
        "app": "Tracking view only (3 months)",
        "scopes": "groups=123&read=remote.state,plugins.photocam,pindrops,groups,vehicles",
        "app_scheme": "locked&isolated&apps=tracking&disable_trips_history=1&vehicles=123"
      }
      

      The response generates a token that lasts 3 months for vehicle 123 which can be used in an iframe like this:
      https://pegasus1.pegasusgateway.com/v2/?auth=#!/app/tracking/:vid/dash

      https://pegasus1.pegasusgateway.com/v2/?auth=c57e979c00b2f619839a5eec7d2ed74ec4e2ef8bb5daf5e4148a7fb1#!/app/tracking/2600/dash

      Then the iframe can be embedded on any app:
      Custom app with an embedded iframe that uses an API token

      (Notice that there’s no toolbar)

      • This topic was modified 1 year, 8 months ago by leo. Reason: changed to finite example, added new vehicle param
Viewing 0 reply threads
  • You must be logged in to reply to this topic.