PTV Drive&Arrive creates a protocol of (all) relevant operations.
The method call https://driveandarrive-v1.cloud.ptvgroup.com/em/journal?SCEMID=X9X9X9X9X9&token=<25_digit_token>&source=<myProduct_Vx.y> will return a protocol of all recorded operations, subscriptions, events and notifications. If the API call contains the optional source parameter the value is assigned to the event source content --> default = "unknown"
Below you find examples extracted from a /journal/ GET response. "JournalEntries" contains an array of "JournalEntry" with different journalTypes (TOUR_CREATED, SUBSCRIPTION_CREATED, EVENT_CREATED, STATUS_STOP, ETA_INFO, SUBSCRIPTION_REMOVED, TOUR_DELETED). Each JournalEntry can contain an "entry" content that is JSON encoded:
{ "journalEntries":[ { "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of tour creation API call "journalType": "TOUR_CREATED", // type of journal entry. Can be TOUR_CREATED, TOUR_UPDATED, SUBSCRIPTION_CREATED, EVENT_CREATED, STATUS_STOP, ETA_INFO, SUBSCRIPTION_REMOVED, TOUR_DELETED "description": "Tour created", // description of journal entry "entry": "{ ... }", // The content depends on the "journalType". "scemid": "X9X9X9X9X9", // SCMEM-ID of this tour, stop or event "source": "customer specific entry" // either the given source from API call, or if not set as default "unknown" }, { ... all other journal entries ... } ] }The following section contains several examples for possible journal entries.
This journal entry informs about a created tour.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of tour creation API call "journalType": "TOUR_CREATED", // type of journal entry. "description": "Tour created", // description of journal entry "scemid": "X9X9X9X9X9", // SCMEM-ID of this tour "entry" : "{ ... }", // the tour as json "source": "customer specific entry" // either the given source from API call, or if not set as default "unknown" }
This journal entry informs about an updated tour.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of tour update API call "journalType": "TOUR_UPDATED", // type of journal entry. "description": "Tour Updated", // description of journal entry "scemid": "X9X9X9X9X9", // SCMEM-ID of this tour "entry" : "{ ... }", // the updated tour as json "source": "customer specific entry" // either the given source from API call, or if not set as default "unknown" }
This journal entry informs about an updated stop in the tour.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of stip update API call "journalType": "STOP_UPDATED", // type of journal entry. "description": "Stop updated", // description of journal entry "scemid": "X9X9X9X9X9", // SCMEM-ID of this tour "entry" : "{ ... }", // the updated stop object }
This journal entry informs about a deleted stop in the tour.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of stop delete API call "journalType": "STOP_DELETED", // type of journal entry. "description": "Stop deleted", // description of journal entry "scemid": "X9X9X9X9X9", // SCEM-ID of the deleted stop "entry" : "{ ... }", // the deleted stop scemid }
This journal entry contains the EtaInfo for each stop in the tour. Both creation and updating a tour force an ETA calculation.
{ "ts": "2016-06-06T07:00:05.4585799+00:00", "journalType": "ETA_INFO", "description": "RefRoute ETA info´s", "entry": "[ { "scemid": "X9X9X9X9X9", "planned": "YYYY-MM-DDThh:mm:ss.0000000+01:00", "refroute": "YYYY-MM-DDThh:mm:ss.0000000+01:00", "estimated": "YYYY-MM-DDThh:mm:ss.0000000+01:00", "notification": true, "uniqSeqId": "d7f5204ed6424a1f9fe7a626008dce22", "trafficTimeLoss": 1158, "breakTimeLoss": 0, "info": "Tour Create/Update" }, { .... for each stop in the tour an entry .... }, { "scemid": "X8X8X8X8X8", "planned": "2016-06-15T16:46:00.0000000+02:00", "refroute": "2016-06-15T23:43:59.0000000+02:00", "estimated": "2016-06-15T23:43:59.0000000+02:00", "notification": true, "uniqSeqId": "d7f5204ed6424a1f9fe7a626008dce22", "trafficTimeLoss": 1158, "breakTimeLoss": 0, "info": "Tour Create/Update" } ]", "scemid": "X1X1X1X1X1" }
This journal entry contains the EtaInfo if the (position) event was used for an ETA calculation. For each stop exists a single journal entry.
{ "ts": "YYYY-MM-DDThh:mm:ss.0000000+01:00" "journalType": "ETA_INFO", "description": "ETA info", "scemid": "X9X9X9X9X9", "entry": { "uniqSeqId": "01234567890123456789012345678901", // unique sequence identifier of API call "originator": { // original event that has forced ETA calculation "coordinate": { "locationX": 11.000000, "locationY": 49.000000 }, "heading": 145.23, "timeStamp": "YYYY-MM-DDThh:mm:ss.0000000+01:00" }, "planned": "YYYY-MM-DDThh:mm:ss.0000000+01:00", // customer planned time of selected stop "estimated": "YYYY-MM-DDTmm:hh:ss.0000000+01:00", // time of current ETA "refroute": "YYYY-MM-DDTmm:hh:ss.0000000+01:00", // time of calculated route at tour start "scemid": "X9X9X9X9X9", // SCEM-ID of selected stop "notification": false, "trafficTimeLoss": 14, // current delays due to traffic incidents or patterns in seconds "breakTimeLoss": 0, // already detected breaks in seconds "waitingPeriod": 0, // waiting period on route "info": ""PositionEvent - Route cannot be calculated" // an info text is set, e.g. if the route cannot be calculated }, }
entry.info also contains useful information on how the ETA was calculated based on current traffic information.
{ "ts": "YYYY-MM-DDThh:mm:ss.0000000+01:00" "description": "ETA info", "journalType": "ETA_INFO", "scemid": "X9X9X9X9X9", // SCEM-ID of selected stop "entry": { "trafficTimeLoss": 14, "breakTimeLoss": 0, // current delays due to traffic incidents or patterns in seconds "waitingPeriod": 0 // waiting period on route "notification": false, "planned": "YYYY-MM-DDThh:mm:ss.0000000+01:00", // customer planned time of selected stop "estimated": "YYYY-MM-DDTmm:hh:ss.0000000+01:00", // time of current ETA "refroute": "YYYY-MM-DDTmm:hh:ss.0000000+01:00", // time of calculated route at tour start "scemid": "X9X9X9X9X9", "uniqSeqId": "01234567890123456789012345678901", // unique sequence identifier of API call "info": "PositionEvent - (traffic information excluded due to inaccessible route sections)", }, }
Similar to ETA_INFO, this journal entry is created on routing error, where no ETA can be calculated.
{ "ts": "YYYY-MM-DDThh:mm:ss.0000000+01:00", "journalType": "ETA_INFO", "description": "ETA failed info", "entry": { "scemid": "X8X8X8X8X8", "planned": "YYYY-MM-DDThh:mm:ss.0000000+01:00", "refroute": "0001-01-01T00:00:00.0000000+00:00", "estimated": "YYYY-MM-DDThh:mm:ss.0000000+01:00", "notification": true, "uniqSeqId": "948a141f-2a5a-4f2e-ac27-aac000c05d38", "trafficTimeLoss": 0, "breakTimeLoss": 0, "info": "PositionEvent - Route cannot be calculated." }, "scemid": "X8X8X8X8X8" }
This journal entry informs about a created event.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of event creation "journalType": "EVENT_CREATED", // type of journal entry. "description": "Position", // description of journal entry "entry": { \"eventType\":\"POSITION\", \"eventSubtype\":\"GPS\", \"visibility\":true, // TRUE if the coordinates are stored in the journal \"action\":\"FORCE_XROUTE_CALC\", // Possible values NONE or if used for calculation FORCE_XROUTE_CALC \"eventPayLoad\": {\"coordinate\": { \"locationX\":16.22, \"locationY\":58.11 }, \"timeStamp\":\"YYYY-MM-DDThh:mm:ss.0000000+01:00\"}, \"scemid\":\"X9X9X9X9X9\" } "scemid": "X9X9X9X9X9", // SCEM-ID of the depending stop scemid "source": "customer specific entry" // either the given source from API call, or if not set as default "unknown" }
This journal entry informs about a created event.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of event creation "journalType": "EVENT_CREATED", // type of journal entry. "description": "Status stop", // description of journal entry "entry": { "eventType":"STATUS_STOP", "eventSubtype":"ARRIVED", // Possible values ARRIVED, DEPARTED, APPROACHING "visibility":true, // TRUE if the coordinates are stored in the journal "eventPayLoad": {"coordinate": { "locationX":16.22, "locationY":58.11 }, "timeStamp":"YYYY-MM-DDThh:mm:ss.0000000+01:00"}, "scemid":"X9X9X9X9X9", "heading": 0, // optional: degree (0=North 90=East 0-360) "accuracy": 0.0, // optional: accuracy in meter "speed": 0.0 // optional: meter/seconds, 0.0 = no speed } "scemid": "X9X9X9X9X9", // SCEM-ID of the depending stop scemid "source": "customer specific entry" // either the given source from API call, or if not set as default "unknown" }
This journal entry informs about a created subscription.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of subscription creation "journalType": "SUBSCRIPTION_CREATED", // type of journal entry. "description": "Subscribe", // description of journal entry "entry": "{ ... }", // will be the transmitted subscription object itself. See source description above the code block. "scemid": "X9X9X9X9X9", // SCEM-ID of this subscription "source": "customer specific entry" // either the given source from API call, or if not set as default "unknown" }
This journal entry informs about confirmation of successfully created subscriptions.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of subscription confirmation "journalType": "SUBSCRIPTION_CONFIRMATION", // type of journal entry. "description": "SUBSCRIPTION_CONFIRMATION", // description of journal entry "entry": "{ ... }", // contains confirmation object with payload containing the subscription id "scemid": "X9X9X9X9X9", // SCEM-ID of this subscription "source": "customer specific entry" // either the given source from API call, or if not set as default "unknown" }
This journal entry informs about a subscription was deleted.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of subscription removal "journalType": "SUBSCRIPTION_REMOVED", // type of journal entry. "description": "Unsubscribe", // description of journal entry "entry": "{ ... }", // will be the transmitted subscription object itself. See source description above the code block. "scemid": "X9X9X9X9X9", // SCEM-ID of this subscription "source": "customer specific entry" // either the given source from API call, or if not set as default "unknown" }
This journal entry contains the notification to subscriptions if the ETA to the stop/tour becomes updated.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of the journal creation "journalType": "NOTIFICATION_INFO", // type of journal entry. "description": "Notification info", // description of journal entry "entry": "{ ... }", // notification object with updated eta info "scemid": "X9X9X9X9X9" // SCEM-ID of selected stop }
This journal entry informs about a tour was deleted, this JournalEntry is never visible for a customer.
{ "ts":"YYYY-MM-DDThh:mm:ss.0000000+01:00", // time stamp of tour delete "journalType": "TOUR_DELETED", // type of journal entry. "description": "Tour deleted", // description of journal entry "entry": "", "scemid": "X9X9X9X9X9", // SCEM-ID of deleted tour "source": "customer specific entry" // either the given source from API call, or if not set as default "unknown" }
validation / message | errorCode |
---|---|
Token does not exist. | TOKEN_ERROR |
Your token is blocked. Please contact support in order to get further information. | TOKEN_BLOCKED |
The validation date of the token is expired. | TOKEN_EXPIRED |
SCEM-ID not valid. SCEM-ID should be a 10-digit, case-sensitive, alphanumeric identifier of an existing tour. | SCEMID_INVALID |
To get the journals to a tour more effectively, paging can be applied when calling journals. The method call https://driveandarrive-v1.cloud.ptvgroup.com/em/journal?SCEMID=X9X9X9X9X9&token=<25_digit_token>&startindex=0&itemsperpage=20&source=<myProduct_Vx.y> will return first 20 journals as in "itemsperpage" to the tour scemid. More journals can be asked just changing the StartIndex to next items.
for example, the next call can be with StartIndex=20 for the next 20 items.
This API method gets the journals from a tour or a stop more effectively using multiple filters and paging options. Following options are available:
Some example calls made using above filters:
https://driveandarrive-v1.cloud.ptvgroup.com/em/journal/batch?SCEMID=<TOUR_SCEMID>&token=<25_digit_token>&source=<myProduct>
https://driveandarrive-v1.cloud.ptvgroup.com/em/journal/batch?SCEMID=<STOP_SCEMID>&token=<25_digit_token>&source=<myProduct>
https://driveandarrive-v1.cloud.ptvgroup.com/em/journal/batch?SCEMID=<STOP_SCEMID>&entryTypes=EVENT_CREATED&token=<25_digit_token>&source=<myProduct>
https://driveandarrive-v1.cloud.ptvgroup.com/em/journal/batch?SCEMID=<STOP_SCEMID>&entryTypes=EVENT_CREATED&eventTypes=STATUS_STOP&token=<25_digit_token>&source=<myProduct>
https://driveandarrive-v1.cloud.ptvgroup.com/em/journal/batch?SCEMID=<TOUR_SCEMID>&sortOrder=entryCreateTime|DESC&token=<25_digit_token>&source=<myProduct>
The method call https://driveandarrive-v1.cloud.ptvgroup.com/em/journal/batch?SCEMID=X9X9X9X9X9&token=<25_digit_token>&startindex=0&itemsperpage=20&source=<myProduct_Vx.y> will return first 20 journals as in "itemsperpage" to the scemid. More journals can be asked just changing the StartIndex to next items.
Here, for example, next call can be with StartIndex=20 for the next 20 items.
© 2022 PTV Planung Transport Verkehr GmbH | Imprint