API Gateway : MobileTicket Example
  

MobileTicket Example

API Gateway by default exposes a new API, MobileTicket. MobileTicket is optimized for the mobile ticket scenario, as listed below.

Get Branches for Services

/geo/services/[serviceId]/branches/

Get nearest Branches

/geo/services/[serviceId]/nearestbranches

Issue Ticket

/MobileTicket/services/[serviceId]/branches/[branchId]/ticket/issue

Find information about a Visit

This way the mobile application does not need to keep track of which Queue the Visit is located in.
/MobileTicket/MyVisit/CurrentStatus/branches/{branchId}/visits/{visitId}?checksum=123456789
The call previously used to get position in Queue, /MobileTicket/MyVisit/Position/branches/[branchId]/queues/[queueId]/visits?visitId=[visitId], should no longer be used!
Example:
 
curl -i -H "auth-token:d0516eee-a32d-11e5-bf7f-feff819cdc9f" -X GET "http://localhost:9090/geo/services/1/nearestbranches?longitude=12.017959999999979&latitude=57.637160000000094&maxNrOfBranches=1000"
 
curl -i -H "auth-token:d0516eee-a32d-11e5-bf7f-feff819cdc9f" -X GET "http://localhost:9090/geo/services/1/branches?longitude=12.017959999999979&latitude=57.637160000000094&radius=1000"
curl -i -H "auth-token:d0516eee-a32d-11e5-bf7f-feff819cdc9f" -X GET "http://localhost:9090/geo/nearestbranches?longitude=12.017959999999979&latitude=57.637160000000094&maxNrOfBranches=1000"
 
curl -i -H "auth-token:d0516eee-a32d-11e5-bf7f-feff819cdc9f" -X GET "http://localhost:9090/geo/branches?longitude=12.017959999999979&latitude=57.637160000000094&radius=100000"
 
curl -i -H 'auth-token:d0516eee-a32d-11e5-bf7f-feff819cdc9f' -X POST "http://localhost:9090/MobileTicket/services/1/branches/1/ticket/issue/"
 
curl -i -H 'auth-token:c7a1331a-32d-11e5-bf7f-feff819acdc9f' -X GET "http://localhost:9090/MobileTicket/MyVisit/Position/branches/1/queues/1/visits?visitId=83"
 
curl -i -H 'auth-token:c7a1331a-32d-11e5-bf7f-feff819acdc9f' -X GET "http://localhost:9090/MobileTicket/MyVisit/LastEvent/branches/1/visits/83/events"
 
curl -X GET -H "auth-token: d0516eee-23ef453"  "http://localhost:9090/MobileTicket/MyVisit/CurrentStatus/branches/1/visits/47?checksum=1585286891"