-
Notifications
You must be signed in to change notification settings - Fork 1
Creating a move lockout
Adam Sharp edited this page Aug 12, 2022
·
2 revisions
- Move from
A
toB
- Journey from
A
toB
(cancelled) - Journey from
A
toC
- Journey from
C
toB
-
Create a journey from A to B for the move (in a proposed state)
curl --request POST \ --url /api/moves/{MOVE_ID}/journeys \ --header 'Authorization: Bearer {OAUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: {RANDOM_UUID}' \ --data '{ "data":{ "type":"journeys", "attributes":{ "timestamp":"2022-08-12T08:01:39.276Z", "billable":true, "date": "2022-08-12", "vehicle":{ "id":"12345678ABC", "registration":"AB12 CDE" } }, "relationships":{ "from_location":{ "data":{ "type":"locations", "id":"{LOCATION_A_ID}" } }, "to_location":{ "data":{ "type":"locations", "id":"{LOCATION_B_ID}" } } } } }'
-
Start journey 1 (A to B)
curl --request POST \ --url /api/events \ --header 'Authorization: Bearer {OAUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: {RANDOM_UUID}' \ --data '{ "data":{ "type":"events", "attributes":{ "occurred_at":"2022-08-12T08:03:44.088Z", "recorded_at":"2022-08-12T08:03:44.088Z", "notes":"example note: lorem ipsum dolor sit amet", "details":{ }, "event_type":"JourneyStart" }, "relationships":{ "eventable":{ "data":{ "type":"journeys", "id":"{JOURNEY_1_ID}" } } } } }'
-
Create a MoveLockout event
curl --request POST \ --url /api/events \ --header 'Authorization: Bearer {OAUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: {RANDOM_UUID}' \ --data '{ "data":{ "type":"events", "attributes":{ "occurred_at":"2022-08-12T08:05:04.088Z", "recorded_at":"2022-08-12T08:05:04.088Z", "notes":"example note: lorem ipsum dolor sit amet", "details":{ "reason":"no_space", "authorised_at":"2022-08-12T08:05:04+00:00", "authorised_by":"PMU" }, "event_type":"MoveLockout" }, "relationships":{ "eventable":{ "data":{ "type":"moves", "id":"{MOVE_ID}" } }, "from_location":{ "data":{ "type":"locations", "id":"{LOCATION_B_ID}" } } } } }'
-
Cancel journey 1 (A to B)
curl --request POST \ --url /api/events \ --header 'Authorization: Bearer {OAUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: {RANDOM_UUID}' \ --data '{ "data":{ "type":"events", "attributes":{ "occurred_at":"2022-08-12T08:10:44.088Z", "recorded_at":"2022-08-12T08:10:44.088Z", "notes":"example note: lorem ipsum dolor sit amet", "details":{ }, "event_type":"JourneyCancel" }, "relationships":{ "eventable":{ "data":{ "type":"journeys", "id":"{JOURNEY_1_ID}" } } } } }'
-
Create a journey from A to C for the move (in a proposed state)
curl --request POST \ --url /api/moves/{MOVE_ID}/journeys \ --header 'Authorization: Bearer {OAUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: {RANDOM_UUID}' \ --data '{ "data":{ "type":"journeys", "attributes":{ "timestamp":"2022-08-12T08:15:39.276Z", "billable":true, "date": "2022-08-12", "vehicle":{ "id":"12345678ABC", "registration":"AB12 CDE" } }, "relationships":{ "from_location":{ "data":{ "type":"locations", "id":"{LOCATION_A_ID}" } }, "to_location":{ "data":{ "type":"locations", "id":"{LOCATION_C_ID}" } } } } }'
-
Create a journey from C to B for the move (in a proposed state)
curl --request POST \ --url /api/moves/{MOVE_ID}/journeys \ --header 'Authorization: Bearer {OAUTH_TOKEN}' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: {RANDOM_UUID}' \ --data '{ "data":{ "type":"journeys", "attributes":{ "timestamp":"2022-08-12T08:20:39.276Z", "billable":true, "date": "2022-08-13", "vehicle":{ "id":"12345678ABC", "registration":"AB12 CDE" } }, "relationships":{ "from_location":{ "data":{ "type":"locations", "id":"{LOCATION_C_ID}" } }, "to_location":{ "data":{ "type":"locations", "id":"{LOCATION_B_ID}" } } } } }'
- API Guide
- Version 2
- Asked Questions
- Webhook & Email notifications
- Walkthroughs
- Deployment
- Useful Queries
- Data quality improvements
-
Journeys and Payment Related Calls
- Single journey move
- Redirection before move commences
- Redirection after move commences
- Lockouts and Lodgings
- Assessments
- Event Documentation
- GPS Track a move