Viewing 0 reply threads
  • Author
    Posts
    • #10048
      Michel Castaño
      Keymaster

      This guide is intended mainly to change Vehicle’s thresholds as well as speed, RPMs or Tracking resolution. However it can be used with any API call which needs to be sent massively.

      The main purpose is to do these tasks easier by doing them massively by api, instead manually.

      1. Install Bash in your PC (This step is needed only if you use Windows). Follow the guide in the following URL: https://www.laptopmag.com/articles/use-bash-shell-windows-10

      2. Run bash from windows in administrator mode:

      3. Fill the following cURL call with the same username and password used for you to login in Pegasus (Must be an admin account)
      curl -X POST -H ‘Content-Type:application/json’ -d ‘{“username”:”youremail@yourdomain.com“,”password”:”yourpassword“}’ ‘https://terrestre.logitracs.com/api/login’

      4. As seen in the picture above, Pegasus answers a JSON from which we are only interested in the token highlighted in blue. For this example is:
      {“message”: “User successfully authenticated”, “app”: null, “auth”: “78fbc6f3c7733496949235f63f2e61a28680c8aa353c72be2aeb1477“}

      78fbc6f3c7733496949235f63f2e61a28680c8aa353c72be2aeb1477

      5. Assemble the massive api request in the following way:
      curl -X POST –header ‘Content-Type: application/json’ –header ‘Accept: application/json’ –header ‘Authenticate: Put the token here!‘ -d ‘{Put the Payload here!}’ ‘https://YourPegdomain Goes here/api/vehicles/{Insert VIDs here separated by commas}/And your API request goes Here

      6. Following the lines exposed in point 5, let’s create 3 examples: The change of RPMs threshold, Speed threshold and resolution for several vehicles at the same time:

      Change resolution Massively
      curl -X POST –header ‘Content-Type: application/json’ –header ‘Accept: application/json’ –header ‘Authenticate: 6cd5b63709adff764359356ca4c614afcfb808369d81afc6d343e539’ -d ‘{“resolution”:7}’ ‘https://pegasus1.pegasusgateway.com/api/vehicles/{169,182,291}/remote/tracking_resolution’

      Change speed Massively
      curl -X POST –header ‘Content-Type: application/json’ –header ‘Accept: application/json’ –header ‘Authenticate: 6cd5b63709adff764359356ca4c614afcfb808369d81afc6d343e539’ -d ‘{“mph”:40.4,”persistencesecs”:60}’ ‘https://pegasus1.pegasusgateway.com/api/vehicles/{169,182,291}/remote/speed’

      Change speed Massively
      curl -X POST –header ‘Content-Type: application/json’ –header ‘Accept: application/json’ –header ‘Authenticate: 6cd5b63709adff764359356ca4c614afcfb808369d81afc6d343e539’ -d ‘{“rpm”:2000,”persistencesecs”:120}’ ‘https://pegasus1.pegasusgateway.com/api/vehicles/{169,182,291,794,799,809}/remote/rpm’

Viewing 0 reply threads
  • You must be logged in to reply to this topic.