Discussions

Ask a Question
Back to All

Wrong error codes

Hi

For certain vendors when making a GET request to the material.json endpoint i get the error "403 Invalid Staff Member Impersonation".

I am not setting the x-impersonate-uuid header on this request and the request succeeds for most of the vendors I'm running it for.

The request being run is the following (in PHP):

$apiClient = new Client([
'base_uri' => 'https://api.servicem8.com/api_1.0/',
'headers' => [
'Authorization' => 'Bearer ' . $token,
'Accept' => 'application/json',
]
]);

$response = $apiClient->get('material.json');
$result = json_decode($response->getBody()->getContents(), true);

Hope you can help with this.
Cheers