{"openapi":"3.0.0","info":{"title":"86Borders API","description":"These are all the restful endpoints for 86Borders public API.\n\n***Accesing the API***\n\nThe HTTP request should include the X-86b-Api-Key header with the following format:\n  ````\n  X-86b-Api-Key: <api-key>\n  ````\n  Where `<api-key>` is the API key\n\n\n***Other Parameters***\n- `<group-guid>` is the group GUID, if required for the function or known, `<empty>` if not known\n- `<appid>` is an APP ID, required for SDK usage","version":"2.0.0"},"tags":[{"name":"Location Service"},{"name":"Marketing Messaging"},{"name":"Enroute Service"}],"security":[{"ApiKeyAuth":[]}],"paths":{"/dssb/devices":{"post":{"tags":["Location Service"],"summary":"Register (register device)","description":"Group-wide registration without the need for individual password. It will only Register if the user identified by the userId field (e-mail or nickname or default phone number) is a part of the group identified by the GUID. That function will be called only if APIKEY/appid/groupGUID combination is valid (check to be performed on the auth level in gateway) and all these values are present (they are required as per description below), which should be checked by the function itself.","parameters":[{"in":"path","name":"context","required":true,"schema":{"type":"object","items":{"groupGUID":{"type":"string","description":"Group identifier of the driver's group"},"appId":{"type":"string","description":"Application identifier"},"userId":{"type":"string","description":"Login id: email, phone, or SP nickname"}}}}],"requestBody":{"description":"JSON object payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DevicePayload"}}}},"responses":{"200":{"description":"Device is registered. Return A JSON object","content":{"application/json":{"schema":{"type":"object","required":["session","user"],"properties":{"session":{"type":"string","description":"String reresentation of SP session ID"},"user":{"type":"object","description":"DSSB user structure","required":["id","created","nickname","guid","email"],"properties":{"id":{"type":"integer","description":"User internal identifier"},"created":{"type":"string","format":"date-time","description":"User creation date"},"nickname":{"type":"string","description":"User SP nickname"},"guid":{"type":"string","description":"User system GUID"},"email":{"type":"string","description":"User email"},"firstname":{"type":"string","description":"User first name"},"lastname":{"type":"string","description":"User last name"},"fullname":{"type":"string","description":"User full name"},"photo":{"type":"string","description":"User photo (internal) URL"},"photoEncoded":{"type":"string","description":"User photo (internal) encoded URL"},"confirmCode":{"type":"string","description":"User MobileConfirmation code"},"activated":{"type":"boolean","description":"User activated flag"},"phone":{"type":"string","description":"User default phone"}}}}}}}},"default":{"$ref":"#/components/responses/ErrorObject"}}}},"/dssb/device/{deviceId}":{"delete":{"tags":["Location Service"],"summary":"UnRegister (unregister device)","description":"Group-wide registration without the need for individual password. It will only Register if the user identified by the userId field (e-mail or nickname or default phone number) is a part of the group identified by the GUID. That function will be called only if APIKEY/appid/groupGUID combination is valid (check to be performed on the auth level in gateway) and all these values are present (they are required as per description below), which should be checked by the function itself.","parameters":[{"in":"path","name":"deviceId","description":"Device identifier","required":true,"schema":{"type":"string"}},{"in":"query","name":"groupGUID","description":"Group identifier of the driver's group","required":true,"schema":{"type":"string"}},{"in":"query","name":"appId","description":"Application identifier","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successfully unregistered the device","content":{"application/json":{"schema":{"type":"object","properties":{"deviceId":{"type":"string","description":"Device identifier of the unregistered device"}}}}}},"default":{"$ref":"#/components/responses/ErrorObject"}}}},"/dssb/geofences":{"get":{"tags":["Location Service"],"summary":"Get Geofences","description":"Returns a list of generic geofences for the device to set and trigger","parameters":[{"in":"query","name":"deviceId","description":"Device identifier","required":true,"schema":{"type":"string"}},{"in":"query","name":"groupGUID","description":"Group identifier of the driver's group","required":true,"schema":{"type":"string"}},{"in":"query","name":"appId","description":"Application identifier","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Result will be return in a JSON object","content":{"application/json":{"schema":{"type":"object","required":["settings"],"properties":{"settings":{"type":"object","description":"Gives the sdk some custom settings","properties":{"clusterInclusive":{"type":"number","description":"Distance to start clustering locations"},"clusterExclusive":{"type":"number","description":"Maximum distance for two locations to be grouped in the same cluster"}}},"geofences":{"type":"array","description":"Array of geofences for the sdk to set and trigger","items":{"type":"object","properties":{"id":{"type":"string","description":"id of the geofence as a guid"},"latitude":{"type":"number","description":"latitude of location"},"longitude":{"type":"number","description":"longitude of location"},"type":{"type":"string","description":"Decides if fence will trigger on enter or exit","enum":["ENTER","EXIT"]},"radii":{"type":"array","description":"Array of radiuses to put around location. If any are crossed, sdk will trigger for this id","items":{"type":"number"}}}}}}}}}},"default":{"$ref":"#/components/responses/ErrorObject"}}}},"/dssb/geofences/crossed":{"post":{"tags":["Location Service"],"summary":"Geofence Crossed","description":"Endpoint for the mobile app to tell the server a geofence has been crossed","requestBody":{"description":"JSON object payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeofenceCrossedPayload"}}}},"responses":{"200":{"description":"Return empty repsonse"},"default":{"$ref":"#/components/responses/ErrorObject"}}}},"/services/messaging/contacts":{"post":{"tags":["Marketing Messaging"],"summary":"Contact List (recipeints)","description":"Endpoint for the list of recipeints of the text message","requestBody":{"description":"JSON object payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactListPayload"}}}},"responses":{"200":{"description":"Return empty repsonse"},"default":{"$ref":"#/components/responses/ErrorObject"}}}},"/services/enroute/statistics":{"get":{"tags":["Enroute Service"],"summary":"Get Statistics","description":"Returns a list of values for different time period, which shows the perfomance of the driver","parameters":[{"in":"query","name":"groupGUID","description":"Group identifier of the driver's group","required":true,"schema":{"type":"string"}},{"in":"query","name":"appId","description":"Application identifier","required":true,"schema":{"type":"string"}},{"in":"path","name":"userId","description":"User identifier","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["total","year-to-date","month-to-date","today"],"properties":{"total":{"description":"Whole statistics for the user","$ref":"#/components/schemas/Statistics"},"year-to-date":{"description":"Statistics from January 1st of the curren year for the user","$ref":"#/components/schemas/Statistics"},"month-to-date":{"description":"Object\tStatistics from 1st day of the current month for the user","$ref":"#/components/schemas/Statistics"},"week-to-date":{"description":"Statistics from the 1st day of the week based on the locale setting (could by 'Sunday' or 'Monday')","$ref":"#/components/schemas/Statistics"},"today":{"description":"Statistics for the curren day for the user","$ref":"#/components/schemas/Statistics"}}}}}},"default":{"$ref":"#/components/responses/ErrorObject"}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-86b-api-key"}},"responses":{"ErrorObject":{"description":"HTTP error response","content":{"application/json":{"schema":{"type":"object","properties":{"apiErrorCode":{"type":"integer","description":"Error code"},"apiErrorMessage":{"type":"string","description":"Error message"},"apiErrorMarker":{"type":"string","description":"Error marker for fast navigation"}}}}}}},"schemas":{"DevicePayload":{"type":"object","properties":{"context":{"type":"object","required":["groupGUID","appId"],"properties":{"groupGUID":{"type":"string","description":"Group identifier of the driver's group"},"appId":{"type":"string","description":"Application identifier"},"userId":{"type":"string","description":"Login id: email, phone, or SP nickname"}}},"device":{"type":"object","required":["deviceId","deviceType","appVersion"],"properties":{"deviceId":{"type":"string","description":"Device Identifier"},"deviceType":{"type":"string","description":"Device type string"},"platformType":{"type":"string","description":"Device platform type"},"appVersion":{"type":"string","description":"Application version"},"osVersion":{"type":"string","description":"Device operation system version"},"networkType":{"type":"string","description":"Network type"},"carrier":{"type":"string","description":"Carrier notation"},"pushId":{"type":"string","description":"Device PUSH notification identifier"}}}}},"GeofenceCrossedPayload":{"type":"object","required":["context","deviceId","timeCrossed","latitude","longitude","geofenceId"],"properties":{"context":{"type":"object","required":["groupGUID","appId"],"properties":{"groupGUID":{"type":"string","description":"Group identifier of the driver's group"},"appId":{"type":"string","description":"Application identifier"}}},"deviceId":{"type":"string","description":"Device identifier"},"timeCrossed":{"type":"number","description":"Time when fence was crossed (stamp in millis)"},"latitude":{"type":"number","description":"latitude where fence was crossed"},"longitude":{"type":"number","description":"longitude where fence was crossed"},"geofenceId":{"type":"array","description":"id or array of ids of fences that were crossed","items":{"type":"string"}}}},"ContactListPayload":{"type":"object","required":["context","customers"],"properties":{"context":{"type":"object","required":["groupGUID","appId"],"properties":{"groupGUID":{"type":"string","description":"Group identifier of the client's group"},"appId":{"type":"string","description":"Application identifier"}}},"filters":{"type":"array","description":"array of filters","items":{"properties":{"name":{"type":"string","description":"name of the filter"},"type":{"type":"string","description":"type of the filter","enum":["number","date","string"]}}}},"customers":{"type":"array","description":"array of contacts","items":{"type":"object","required":["cellphone"],"properties":{"id":{"type":"string","description":"internal contact identification"},"name":{"type":"string","description":"contact full name"},"cellphone":{"type":"string","description":"10-digit or E164 formated phone number"},"opt-in":{"type":"boolean","description":"opt-in information if available"},"address":{"type":"object","required":["line1","city","postalcode"],"properties":{"line1":{"type":"string","description":"line 1"},"line2":{"type":"string","description":"line 2"},"city":{"type":"string","description":"city name"},"state":{"type":"string","description":"state, province, territory, etc. name"},"postalcode":{"type":"string","description":"postal or zip code"},"country":{"type":"string","description":"2-letters country code or full country name"}}},"filters":{"type":"array","description":"array of filters","items":{"properties":{"name":{"type":"string","description":"name of the filter"},"value":{"type":"string","description":"value of the filter"}}}}}}}}},"Statistics":{"type":"object","required":["kilometersDriven","clockInHours","ordersNew","ordersRejected","ordersAccepted","ordersActive","ordersDelivered","ordersCanceled","ordersCompleted","topSpeed"],"properties":{"kilometersDriven":{"type":"number","description":"Kilometers driven"},"clockInHours":{"type":"number","description":"Hours user was in clock in mode"},"ordersNew":{"type":"number","description":"Current number of orders assigned to the user with status `NEW`"},"ordersRejected":{"type":"number","description":"Current number of orders rejected by the user"},"ordersAccepted":{"type":"number","description":"Current number of orders assigned to the user with status `ACCEPTED`"},"ordersActive":{"type":"number","description":"Current number of orders assigned to the user with statuses `WAITING`, `ENROUTE`, `APPROACHING`, `AT_LOCATION`,"},"ordersDelivered":{"type":"number","description":"Current number of orders assigned to the user with status `DELIVERED`"},"ordersCanceled":{"type":"number","description":"Current number of orders assigned to the user with status `CANCELED`"},"ordersCompleted":{"type":"number","description":"Current number of orders assigned to the user with status `COMPLETED`"},"topSpeed":{"type":"number","description":"Top Speed"}}}}}}