Accept & Decline
Use these endpoints to accept or decline service requests that have been broadcast to your organization.
Accept Request
Section titled “Accept Request”
PUT
https://hub.vectorcare.com/openapi/v2.0/requests/{request_id}/accept/
Request Body
Section titled “Request Body”{ "response_notes": "We can accommodate this request. ETA 15 minutes."}| Field | Type | Description |
|---|---|---|
response_notes | string | Optional notes for the requester (max 450 characters) |
Example
Section titled “Example”curl -X PUT "https://hub.vectorcare.com/openapi/v2.0/requests/KP-ABCD1234/accept/" \ -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..." \ -H "Content-Type: application/json" \ -d '{ "response_notes": "Confirmed. Unit 42 dispatched." }'Success Response (201 Created)
Section titled “Success Response (201 Created)”{ "response_notes": "Confirmed. Unit 42 dispatched."}Decline Request
Section titled “Decline Request”
PUT
https://hub.vectorcare.com/openapi/v2.0/requests/{request_id}/decline/
Request Body
Section titled “Request Body”{ "response_notes": "No available units in that area at this time."}| Field | Type | Description |
|---|---|---|
response_notes | string | Optional notes explaining the decline (max 450 characters) |
Example
Section titled “Example”curl -X PUT "https://hub.vectorcare.com/openapi/v2.0/requests/KP-ABCD1234/decline/" \ -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..." \ -H "Content-Type: application/json" \ -d '{ "response_notes": "Outside service area." }'Success Response (201 Created)
Section titled “Success Response (201 Created)”{}What Happens Next
Section titled “What Happens Next”| Action | Webhook You’ll Receive | Request Status |
|---|---|---|
| Accept | BROADCAST_ACCEPTED | ASSIGNED |
| Decline | BROADCAST_DECLINED | UNAVAILABLE |
| No response | BROADCAST_EXPIRED | UNAVAILABLE |
After accepting, begin dispatching and sending state updates and location updates.
Error Handling
Section titled “Error Handling”| Status | Cause | Resolution |
|---|---|---|
| 401 | Invalid/expired token | Refresh your access token |
| 403 | Request not available to you | May already be assigned or canceled |
| 404 | Request not found | Verify the request_id |
| 400 | Invalid request body | Check response_notes length |