If Green Mile's API is returning the wrong information, surely it's up to them to look into. I would suggest confirming you are hitting the correct endpoint with the correct data provided. Dump out the $this->baseSite . 'RouteDriver/restrictions' to confirm the endpoint is correct, then make sure the payload keys and values are correct in what's expected by the Green Mile API.
Mar 9, 2022
4
Level 8
HTTP response from a API
I'm using the API from a company called Green Mile and the people there seem to be stumped. I'm making a request to one of the tables (RouteDriver), the documentation shows it should return the Driver ID among other things but only returns the Record Id and the Creation Date. Here is my call:
public function getDriverAssigned(int $routeId)
{
return
Http::withHeaders($this->headers)
->post($this->baseSite . 'RouteDriver/restrictions', [
'attr'=> 'route.id',
'eq' => $routeId,
])
->collect();
}
and here is the answer:
[
{
"id": 84807,
"creationDate": "2022-03-09T07:32:20+0000"
}
]
It is the correct record as i can get in the database and check.
Has anyone experienced this problem before?
Thanks for any ideas.
Please or to participate in this conversation.