NAV
JSON cURL python

Introduction

Digital Communication Technologies (DCT) manufactures a tracking device called: Syrus.

Syrus devices send their data realtime to a Gateway / Server called: Pegasus. Pegasus works like a Platform as a Service (PaaS) which is used to expose the functionalities of the device and all of it’s data via a RESTful API.

The API allows you to query any of the 250+ parameters the device has available. It is also a way for you to interact directly with the device, allowing you to make changes to the configuration, create rules, customizable actions depending on device states, and much more.

Pegasus Overview

There are multiple Pegasus Gateways deployed around the world, each one having a custom URL or subdomain which is controlled by a gateway owner.

pegasusOverview image

At the core of each Pegasus site, the API is the same. The requests are built the same way, the only difference being the base URL

Base URL

The base URL is used to identify where your requests will be built from. If you are making an application that applies to more than one Pegasus site, it’s recommended to leave the base URL configurable.

For the base URL you may use your Pegasus domain /api/

https://sitedomain.com/api

Or you may try with Pegasus 1

https://pegasus1.pegasusgateway.com/api/

API Reference

The Pegasus API reference allows you to test all the methods directly with your site, it can be found under the path /api/docs

Example:

https://sitedomain.com/api/docs

Pegasus1

Versioning

curl "https://pegasus1.pegasusgateway.com/api/"
{
"tag": "1.44.0",
"data": "Oct 20 12:09:56 2015",
"name": "latest"
}

The API version is same as Pegasus Site version. There are 3 possible versions a site might be using:

Stable (currently: 1.43.6)

Latest (currently: 1.44.0)

Develop (very unstable)

Consult the version of your Gateway with the following request
GET https://pegasus1.pegasusgateway.com/api/
Try it now

For future version releases and changelog please refer to our Github Repo

Deployment Cycle

Pegasus 1 uses Develop versions. Use this site for testing the API’s latest features

Gateways have the Stable version, some may be on Latest

You may request your site to be switched to other version.

Latest is updated regularly (every 1-2 weeks)

Stable is updated less often (every 1-2 months)

Resource Patterns

Resources URI patterns try to follow the general convention:

/vehicles represents all the vehicles

/vehicles/:id represents a particular vehicle ID

/vehicles/:id/remote/state see the state of a particular vehicle ID

etc.

Authentication

curl -v -X POST -d '{"username":"developer@digitalcomtech.com", "password":"dctdevelop"}' --header 'Content-type: application/json' --header 'Origin:anyvalue' https://pegasus1.pegasusgateway.com/api/login

< HTTP/1.1 200 OK 
< Server: nginx 
< Date: Fri, 16 Oct 2015 20:55:29 GMT 
< Content-Type: application/json 
< Content-Length: 114 
< Connection: keep-alive 
< Access-Control-Allow-Origin: * 
< Access-Control-Allow-Methods: HEAD, GET, POST, OPTIONS 
< Access-Control-Max-Age: 21600 
< Access-Control-Allow-Headers: ACCEPT, CONTENT-TYPE, AUTHENTICATE, X-REQUESTED-WITH 
< Set-Cookie: session=eyJ0aW1lIjoxNDQ1MDI4OTI5Ljg0MzcyNCwidG9rZW4iOnsiIGIiOiJOelF6TXpjNFpXUXlObVJsT1RGbFl6RXdZMkUwWm1aa05XTmlNV000WlRKbU4yWmxPREE0TWpSa01qZzVZVFV4TWpVMU1UbGpOVEE9In0sInVzZXIiOjYzMn0.CQL1wQ.zoV_G0600UUC1K2FBR3o23fVM28; HttpOnly; Path=/ 
< Strict-Transport-Security: max-age=31536000;includeSubDomains 
{
  "message": "User succesfully authenticated",
  "auth": "743378ed26de91ec10ca4ffd5cb1c8e2f7fe80824d289a5125519c50"
}

In order to authenticate with the API you must use the /login resource.

A successful login returns a token that has to be used on every subsequent request.

This token has to be sent on a header called Authenticate Authenticate: 743378ed26de91ec10ca4ffd5cb1c8e2f7fe80824d289a5125519c50

In order to login you must also pass an Origin header
Origin: anyvalue

When sending JSON use the following Content-Type header Content-Type: application/json

Get User Session

$ curl -v -X GET  --header 'Authenticate: 743378ed26de91ec10ca4ffd5cb1c8e2f7fe80824d289a5125519c50' --header 'Origin: anyvalue' https://pegasus1.pegasusgateway.com/api/user

> /api/user HTTP/1.1
> Host: pegasus1.pegasusgateway.com
> User-Agent: curl/7.43.0
> Accept: */*
> Authenticate: 743378ed26de91ec10ca4ffd5cb1c8e2f7fe80824d289a5125519c50
> Origin: anyvalue

< HTTP/1.1 200 OK
< Server: nginx
< Date: Fri, 16 Oct 2015 21:02:29 GMT
< Content-Type: application/json
< Content-Length: 764
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: HEAD, OPTIONS, GET
< Access-Control-Max-Age: 21600
< Access-Control-Allow-Headers: ACCEPT, CONTENT-TYPE, AUTHENTICATE, X-REQUESTED-WITH
< Set-Cookie: session=eyJ0b2tlbiI6Ijc0MzM3OGVkMjZkZTkxZWMxMGNhNGZmZDVjYjFjOGUyZjdmZTgwODI0ZDI4OWE1MTI1NTE5YzUwIiwidXNlciI6NjMyfQ.CQL3ZQ.dAC83AauxpPQeMZdsg8wYkz9Cxg; HttpOnly; Path=/
< Strict-Transport-Security: max-age=31536000;includeSubDomains
<
{
  "username": "developer@digitalcomtech.com",
  "scopes": {
    "sims": "w",
    "tasks": "r",
    "users": "r",
    "groups": "w",
    "plugins.photocam": "r",
    "rawdata": "r",
    "vehicles.counters": "r",
    "remote": "r",
    "assets": "r",
    "triggers": "r",
    "vehicles": "w",
    "devices": "r",
    "geofences": "r",
    "plugins.lumeway": "r",
    "plugins.garmin": "r",
    "configurations": "r"
  },
  "first_name": null,
  "last_name": null,
  "phone": null,
  "is_active": true,
  "email": "developer@digitalcomtech.com",
  "is_superuser": false,
  "is_staff": false,
  "last_login": 1445014134.1470001,
  "groups": [
    479,
    566
  ],
  "prefs": {
    "fuelunits": "gallon",
    "language": "es",
    "coords_type": "WGS84",
    "hour_format_12": true,
    "temperature_in_celsius": false,
    "distanceunits": "mile"
  },
  "id": 632,
  "date_joined": 1396137176.1719999
}

A sample request using the Authentication token is to get the user’s session this gives you access to the scopes or permissions the user has for the API, basic information about the user, as well as preferences among other things

GET https://pegasus1.pegasusgateway.com/api/user

More info

Get Vehicle Information

$  curl -v -X GET  --header 'Authenticate: 743378ed26de91ec10ca4ffd5cb1c8e2f7fe80824d289a5125519c50' --header 'Origin: anyvalue' https://pegasus1.pegasusgateway.com/api/vehicles/197
{
  "info": {
    "description": "Camion",
    "color": "Blue",
    "make": "",
    "year": "",
    "vin": "",
    "license_plate": "",
    "vehicle": 197,
    "model": "",
    "id": 1
  },
  "associations": [
    {
      "vehicle_id": 197,
      "time": 1339707681.625,
      "id": 233,
      "association": true,
      "device_id": 356612022409637
    }
  ],
  "name": "PruIng1-TDX566",
  "trackers": [

  ],
  "primary": null,
  "token": null,
  "groups": [
    229,
    237,
    240,
    582
  ],
  "device": 356612022409637,
  "counters": {
    "dev_dist": 45177099,
    "ecu_dist": 44997580,
    "dev_ign": 6072587,
    "dev_idle": 2091320,
    "dev_ospeed": 139139,
    "ecu_ifuel": 4763,
    "ecu_eusage": 126215,
    "ecu_eidle": 19610,
    "ecu_tfuel": 228005
  },
  "type": "vehicle",
  "id": 197,
  "assets": {
    "off_icon_type": null,
    "idle_icon": null,
    "icon_type": null,
    "photo": null,
    "vehicle": 197,
    "off_icon": null,
    "on_icon": null,
    "on_icon_type": null,
    "photo_type": "image/png",
    "idle_icon_type": null,
    "icon": null
  }
}

Another sample request this time we’re requesting the data of a particular vehicle

GET https://pegasus1.pegasusgateway.com/api/vehicles/:id

More info

Entities

Users

Users are identified by email. Usernames give access to both the Pegasus Platform and to the API. A User’s API access is controlled by Scopes Their entities visibility is determinated by its groups’ membership

GET https://pegasus1.pegasusgateway.com/api/user
GET https://pegasus1.pegasusgateway.com/api/users
GET https://pegasus1.pegasusgateway.com/api/users/:id

More info

Groups

Groups are identified by a unique ID and a user-defined name. Groups relate Users and Vehicles.
The most common usage is “A group per client”, but it’s flexible to serve other purposes:

GET https://pegasus1.pegasusgateway.com/api/groups
GET https://pegasus1.pegasusgateway.com/api/groups/:id

More info

Vehicles

Vehicles are the core resource for 90% of the requests. When you request tracking and counters data, for example, it is organized per vehicle. Remote interaction with a Syrus is done to its associated vehicle. 90% Of Automation triggers are triggered by vehicle events

GET https://pegasus1.pegasusgateway.com/api/vehicles
GET https://pegasus1.pegasusgateway.com/api/vehicles/:id

More info

Devices

Devices refer to a Syrus device, a vehicle has only one Syrus associated. This association may change over time (unit replacement) but it will always be a one to one relationship. You may see an association history of the vehicle’s / IMEIs when you make a GET /api/vehicles/:id

GET https://pegasus1.pegasusgateway.com/api/devices
GET https://pegasus1.pegasusgateway.com/api/devices/:imei

More info

API Access - Scopes

$ curl -v -X GET  --header 'Authenticate: 743378ed26de91ec10ca4ffd5cb1c8e2f7fe80824d289a5125519c50' --header 'Origin: anyvalue' https://pegasus1.pegasusgateway.com/api/user
{
  "scopes": {
    "sims": "w",
    "tasks": "r",
    "users": "r",
    "groups": "w",
    "plugins.photocam": "r",
    "rawdata": "r",
    "vehicles.counters": "r",
    "remote": "r",
    "assets": "r",
    "triggers": "r",
    "vehicles": "w",
    "devices": "r",
    "geofences": "r",
    "plugins.lumeway": "r",
    "plugins.garmin": "r",
    "configurations": "r"
  } 

Users with

{
    "is_staff": true 
}

have access to all scopes

A user’s access to the API is controlled by their Group membership and scopes

When a user belongs to a particular group they can see all the vehicles that group has associated as well as all the names of all the users that belong to that group.

GET https://pegasus1.pegasusgateway.com/api/user

Scopes are identified by the name of the resource and then the letter’s: ‘r’ or 'w’ corresponding to their access level for that resource

r : read-only permissions : GET

w : read and write permissions : POST + PUT + DELETE

For example, the user on the right hand side has: Read permission for “triggers” and Write permissions for “vehicles” allowing the user to see the triggers and create vehicles / update / delete vehicles
{
    …
    “triggers”: “r”,
    “vehicles”: “w”
}

You may perform a PUT to update the scopes of a User

PUT https://pegasus1.pegasusgateway.com/api/user - own user
PUT https://pegasus1.pegasusgateway.com/api/users/:id - other user

Try it now

A user with “r” read-only permissions cannot update his own resource’s scope to “w”

A user with the permission: is_staff enabled has write access to all scopes, only a staff can enable this option

Rates

< HTTP/1.1 200 OK
< Server: nginx
< Date: Sat, 17 Oct 2015 16:18:57 GMT
< Content-Type: application/json
< Content-Length: 932
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: PUT, HEAD, GET, OPTIONS, DELETE
< Access-Control-Max-Age: 21600
< Access-Control-Allow-Headers: ACCEPT, CONTENT-TYPE, AUTHENTICATE, X-REQUESTED-WITH
< X-RateLimit-Limit: 10
< X-RateLimit-Remaining: 8
< X-RateLimit-Reset: 1445098790

If limit is exceeded

< HTTP/1.1 429 TOO MANY REQUESTS
< Server: nginx
< Date: Sat, 17 Oct 2015 16:19:46 GMT
< Content-Type: application/json
< Content-Length: 30
< Connection: keep-alive
< X-RateLimit-Limit: 10
< X-RateLimit-Remaining: 0
< X-RateLimit-Reset: 1445098790
<
{"message": "10 per 1 minute"}

Response headers include X-RateLimit-* keys so you can avoid reaching a limit

The response on the right hand side tells us there’s a limit of 10 requests, and the client has 8 remaining, the limit resets back to 10 at the following epoch timestamp: 1445098790 (Sat, 17 Oct 2015 16:19:50 GMT)

If the limit is reached a 429 is returned

HTTP Verbs

Verb Meaning
GET Used for retrieving resources.
POST Used for creating resources, sending-info, actions
PUT Used for replacing/updating resources.
DELETE Used for deleting resources.

Status

The Pegasus API uses the following Status Codes:

Status Code Short Description Meaning
200 OK General success status code. Most common code to indicate success.
201 CREATED Successful creation occurred (via either POST or PUT). Response body content may or may not be present.
204 NO CONTENT Status when wrapped responses are not used and nothing is in the body (e.g. DELETE).
304 NOT MODIFIED Used in response to conditional GET calls to reduce bandwidth usage.
400 BAD REQUEST General error when fulfilling the request would cause an invalid state. Domain validation errors, missing data, etc. are some examples.
401 UNAUTHORIZED – Error code for a missing or invalid authentication token.
403 FORBIDDEN – Error code for user not authorized to perform the operation, doesn’t have rights to access the resource, or the resource is unavailable for some reason (e.g. time constraints, etc.).
404 NOTFOUND – Used when the requested resource is not found, whether it doesn’t exist or if there was a 401 or 403 that, for security reasons, the service wants to mask.
409 CONFLICT – Whenever a resource conflict would be caused by fulfilling the request. Duplicate entries, deleting root objects when cascade-delete not supported are a couple of examples.
429 TOO MANY REQUESTS - The user has sent too many requests in a given amount of time
500 INTERNAL SERVER ERROR – The general catch-all error when the server-side throws an exception.

Rawdata

Raw data consists of a list of observations within a queried time range. The rawdata API allows you to retrieve data, with a high degree of flexibility. You can transform fields to your liking, perform small calculations, and resample data.

For large data sets, the request can be delegated to a job. This will significantly improve the chances of retreiving the data set, circumventing timeouts and potential network issues.

The rawdata api has several query params that can be passed to specify the data need.

Param Description
from Date from YYYY-MM-DD[Thh:mm:ss]
to Date to YYYY-MM-DD[Thh:mm:ss]
vehicles Vehicles to get data from
groups Groups to get data from
fields Which data fields do you want to include
exclude Exclude the following fields
types Event types to search for
labels Filter by the following labels, which are for describing the event generated
codes Filter by event code (not recommended, use labels instead)
raw Show the rawdata format
filter Create a custom filter for the results
resample Export the data to json (default), html, csv, or tsv
freq Export the data to json (default), html, csv, or tsv
how Export the data to json (default), html, csv, or tsv
fill Export the data to json (default), html, csv, or tsv
group_by Export the data to json (default), html, csv, or tsv
order Order the results by a particular field
head Get top n events from result
tail Get bottom n events from ressult
export Export the data to json (default), html, csv, or tsv
async Run the report in the background (returns a job id)
basic Include the basic data fields
counters Include the counters data fields

Fields

https://pegasus1.pegasusgateway.com/api/rawdata

{
  "keys": {
    "io_exp_in1": {
      "short_desc": "exp in1",
      "long_desc": "I/Os expander input 1",
      "type": "boolean",
      "group": "IO related"
    },
    "code": {
      "short_desc": "EVC",
      "long_desc": "GPS Event code reported by 'EV' msg",
      "type": "number",
      "group": "Event identification"
    },
    "ecu_distance": {
      "short_desc": "VDist",
      "long_desc": "Vehicle dashboard odometer reported by ECUMon [m]",
      "type": "number",
      "group": "ECU monitor accessory related"
    },
    "ecu_idle_fuel": {
      "short_desc": "IFuel",
      "long_desc": "Fuel consumed in IDLE. Rep. by ECUMon [L x10]",
      "type": "number",
      "group": "ECU monitor accessory related"
    },
    "cf_rssi": {
      "short_desc": "rssi",
      "long_desc": "GSM Cell rssi (0-31)",
      "type": "number",
      "group": "Communication related"
    },
    "pid": {
      "short_desc": "Pegasus ID",
      "long_desc": "Pegasus site ID",
      "type": "number",
      "group": "Site identification"
    }
  }
}

The rawdata allows you to select fields from the pegasus’ events table. Simply pass the fields parameter to the request with the fields you want

To view a list of all the fields available to you, perform an empty GET request on the rawdata resource

By default all rawdata requests come with

To select fields, simply pass them to ‘fields’ parameter

/rawdata?fields=comdelay,speed,cf_rssi,hdop,dev_dist...

You may also pass a JSON array to the fields parameter, this allows for higher flexibility when doing complex transformations.

/rawdata?fields=["dev_ign","dev_idle","cf_rssi","hdop","dev_dist"]

Sets

you can pass sets (ex. basic, counters, network, photo …) as part of the 'fields’ parameter preceeded by ’$’

fields=$basic,$network

or as flags to the request (DEPRECATED):

basic=1&counters=1

Exclude

If you want to bring some parts of a set or sets, it may be better to include the whole set, and then exclude what you dont want. In order to do this you can pass the 'excludes’ parameter.

fields=$basic&excludes=speed,mph

The excludes paramater also supports regular expressions, this allows you to exclude multiple fields at once: For example, bring all device counters

fields=$counters&exclude=$ecu.*^

Instead of

fields=dev_dist,dev_idle,dev_ign...

Transformations

In addition to selecting fields, you can rename and create new fields.

Renaming Fields

https://pegasus1.pegasusgateway.com/api/rawdata?vids=197&from=2015-10-29T20:00:00&fields=latitude:@lat,longitude:@lon,rssi:@cf_rssi,speed,head

with field aliases for rssi, latitude, and longitude

{
  "events": [
    {
      "head": 254,
      "vid": 197,
      "event_time": "2015-10-30T00:01:27",
      "system_time": "2015-10-30T00:01:31.202000",
      "longitude": -75.49469,
      "latitude": 10.35458,
      "rssi": 31,
      "speed": 0,
      "id": 5002921407
    }
  ]
}

To rename a field, simply pass the name you want, and the field it is renaming referenced with @ and separated by a : renamed_field:@field

odometer:@dev_dist

You can do as many of these as you want.

rssi:@cf_rssi,satellites:@sv,gsp_quality:@hdop

Building fields

https://pegasus1.pegasusgateway.com/api/rawdata?vids=197&from=2015-10-30T08:00:00&fields=kph:@speed,mph,vehicle_battery_volts:@ecu_battery/1000,com_dly:(@system_epoch-@event_epoch),centimeters_per_second:@mph*44.704,knots:@mph*0.868976

with more operators and number manipulations

{
  "events": [
    {
      "com_dly": 3.7017700672,
      "knots": 28.676208,
      "system_time": "2015-10-30T12:03:08.701770",
      "vid": 197,
      "event_time": "2015-10-30T12:03:05",
      "centimeters_per_second": 1475.232,
      "mph": 33,
      "kph": 53.10822,
      "vehicle_battery_volts": 13.35,
      "id": 5002929550
    }
  ]
}

You can also use basic arithmetic operations to build new fields:

comdelay:@system_epoch-@event_epoch

Remember, you can also use numbers in the transformations, for example to get the km reported by dev_dist: km:@dev_dist/1000

vehicle_battery_volts:@ecu_battery/1000 com_dly:(@system_epoch-@event_epoch) centimeters_per_second:@mph*44.704 knots:@mph*0.868976

Concatenate strings? Sure: fields:["google:'https://google.com/maps?q=' + @lat__str + ',' + @lon__str"]

If you get a validation error, make sure the castings match!, how? Simply append one of

Filtering

https://pegasus1.pegasusgateway.com/api/rawdata?vids=197&from=2015-10-30T08:00:00&fields=mph,valid_position&filter=valid_position and mph>30

return all events with valid positions and speeds above 30mph

{
  "events": [
    {
      "system_time": "2015-10-30T12:03:08.701770",
      "vid": 197,
      "event_time": "2015-10-30T12:03:05",
      "mph": 33,
      "valid_position": true,
      "id": 5002929550
    }
  ]
}

https://pegasus1.pegasusgateway.com/api/rawdata?vids=197&from=2015-10-30T08:00:00&fields=mph,valid_position,event_hour&filter=system_hour > 08 and (speed>20 and valid_position)

return all events after 8 with speed greater than 20 and valid positions

{
  "events": [
    {
      "system_time": "2015-10-30T14:00:19.732220",
      "vid": 197,
      "event_time": "2015-10-30T14:00:16",
      "mph": 0,
      "valid_position": true,
      "id": 5002931328,
      "event_hour": 10
    }
  ]
}

The rawdata allows you to filter fields that meet a certain criteria. Using the 'filter’ field on the request, you can pass complex boolean logic that meets your criteria.

You can apply boolean logic to filter the desired results, available operators: >, < , >= , <=, ==, !=, and, or, not

Some examples:

valid_position and speed > 30 label == "spd" and mph < 50 (lat < -4 and lat > -5) and ( lon < -74 and lon > -75 ) system_hour == 7 and (system_minute > 0 and system_minute < 30) speed > 50

A more complex example: (event_wkday == 3) and cf_rssi < 10 and ( event_hour > 7 and event_hour < 17)

Which translates to: get all events on wednesdays between 7AM and 5PM with an cf_rssi value less than 10 (low GSM signal)

Ordering

You can also order the resulting data set however you choose. Simply pass the order field to the request

?order=mph

This will order the events by mph in ascending order. but what about ascending?

Simple just append a ’-’, to the field you want to order ?fields=...&order=-mph

What about multilevel ordering? Sure thing, no problem:

?fields=...&order=vid,-mph

This will return all events sorted by vehicle id (vid) and then by speed in descending order

Limiting

By default the rawdata request will return all the events that match your criteria.

What if you want to see the first x events. Simply pass the 'head’ argument to the request

head=100

Will return the top 100 events from the set.

Want to see the last n events? pass 'tail’ as the argument.

tail=100

Want both? How about the first 100 and bottom 50 events?

head=100&tail=50

Resampling

Resampling is an important part of data analysis, timed data can be normalized to evenly timed chunks. For more information on how resampling is used, see LINK TO SUPER DUPER BLOG

Events that pass through the Pegasus Gateway naturally contain time information.

These fields are:

The Rawdata API allows you to resample data based on either one of these.

There are 5 fields important to resampling. * resample : timed field to use in resampling (event_time or system_time) * freq : Frequency you want to resample to (ex. by day, by month, every 30 seconds, etc) * how : Method to use for resampling, defaults to 'mean’ (ex. sum, diff, min, max …) * fill : How to fill gaps in the data set. ffill, pad, bfill * group_by : group events by field(s) before performing resample. (useful for multiple vehicles)

resample

Used to activate resampling. Can only be event_time or system_time.

freq

Establishes the frequency by which to resample. Must meet the format:

where N is equal to a number greater than 0. and F can be one of:

how

Determines how to resample the data, based on the frequency established. This must be one of.

You can also resample different fields by different methods. Simply pass the fields as a csv, with the transformation you want separated by a ’:’ field:method

how=dev_dist:diff,cf_rssi:mean,hdop:mean,hdop:max,vdop:min

want to apply the same resample method to a set? Simply:

how=#counters:diff

group_by

You can also group the events before performing a resample. this is useful if you want to keep events tied to a specific field, such as the vehicles id (vid).

group_by:vid

You can additionally group by more than one field:

group_by:vid,label

Output Formats

https://pegasus1.pegasusgateway.com/api/rawdata?vids=197&from=2015-10-30T08:00:00&fields=vid,lat,lon&export=html

export as HTML

|     event_time      |     id     |  label  |   lat   |    lon    | vid
| ------------------: | ----------:| -------:| -------:| --------: | --: 
| 2015-10-30T12:03:05 | 5002929550 | trckpnt | 9.80091 | -74.76004 | 197
| 2015-10-30T12:08:06 | 5002929669 | trckpnt | 9.80670 | -74.73022 | 197

By default, events come in a JSON envelope under the 'events’ property.

The rawdata API also allows you to export in other formats:

Simply pass the 'export’ parameter on the request

export=html

Need another format? Send us a message on our Gitter or create an issue on our github

Async

https://pegasus1.pegasusgateway.com/api/rawdata?vids=197&from=2015-9-30T08:00:00&basic=1&fields=ecu_battery,ecu_distance&filter=speed%3E100&async=true json { "message": "Job created", "job_id": 443 }

https://pegasus1.pegasusgateway.com/api/jobs/59

the relevant field is the “progress”

before the job starts running “`json "progress”: {},


> https://pegasus1.pegasusgateway.com/api/jobs/65/data.json

Results returned by the rawdata API can get big, and we mean big.
This can bring up all sorts of issues when using via a web browser.
These include but are not limited to:

* Connection issues (timeouts, disconections)
* Lack of processing power on client machine (try parsing a 200GB JSON file on chrome)

In order to circumvent these issues, and guarantee that data is always retreived as requested. You can leave the query and processing running in the background.

Simply set the 'async' on the request

`async=True`

The request immediately returns a job ID
you can query the job ID to see the progress of the rawdata request

When the job finishes you can see the result in 
`/api/jobs/:jobid/data.{export_format}`

<aside class="notice">
We recommend that you use a small time range to test the rawdata request before you make a large request.
</aside>

Syrusmart

Syrusmart is a marketplace that lives inside of every Pegasus gateway.

It can be used to expose the applications you make!

Gateway owners are exposed to the applications and they can choose to install it

SyrusMART image

To submit one of your applications please fill out the following form:

SyrusMART