-
AuthorPosts
-
-
June 28, 2019 at 3:00 pm #8853leoKeymaster
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
scheme –finite
orinfinite
whether you wan the token to expire or not
limit – token expiration time in seconds
scopes –groups=<group_csvs>&read=<scope_name_csv>&write=<scope_name_csv>
app_scheme –isolated&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 informationlist 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/dashThen the iframe can be embedded on any app:
(Notice that there’s no toolbar)
- This topic was modified 5 years, 3 months ago by leo. Reason: changed to finite example, added new vehicle param
-
-
AuthorPosts
- You must be logged in to reply to this topic.