Announcements

The Equinix Community will be offline for scheduled maintenance on July 31, 2024. Learn More.

Discussions

Error with error format on serviceTokens

Error with error format on serviceTokens

API_User
Level 9

Hello

I have error with "Error message" of the API.

Endpoint: https://api.equinix.com/fabric/v4/serviceTokens/{serviceTokenId}

 

$ curl --request GET --url "https://api.equinix.com/fabric/v4/serviceTokens/e72498f3-xxxx-xxxx-xxxx-87df25f05e5a" --header 'authorization: Bearer xxxx' 
> Result OK


I change only one char to get an unknown service token :


$ curl --request GET --url "https://api.equinix.com/fabric/v4/serviceTokens/e72498f3-xxxx-xxxx-xxxx-87df25f05e5b" --header 'authorization: Bearer xxxx'
Warning: Binary output can mess up your terminal. Use "--output -" to tell
Warning: curl to output it to your terminal anyway, or consider "--output
Warning: " to save to a file.

The answer is not a readable json.

This does not occur with every error. For example the ports endpoints work without error.

I try a very simple call which work :

$ curl --request GET --url "https://api.equinix.com/fabric/v4/ports/24ce23cd-c42e-4746-8cdd-94cc363a0b3c" --header 'authorization: Bearer xxxxx' 
> Result OK

I change only one letter in the port uuid:

$ curl --request GET --url "https://api.equinix.com/fabric/v4/ports/24ce23cd-c42e-4746-8cdd-94cc363a0b3d" --header 'authorization: Bearer xxxxx' 
{"errorCode":"ERR-PRT-000-00","errorMessage":"System is unable to process the request at this time due to some internal error. Please contact support@equinix.com for more info","moreInfo":"","property":"ERROR"}

On this endpoint i have a readable json as expected.

On serviceTokens i tried to add many headers

- Accept: application/json
- Content-Type: application/json

But i dont find a solution.

The curl i tried are the same as the documentation :
- https://developer.equinix.com/catalog/fabricv4#operation/getServiceTokenByUUID

Could you check why i have this bad error message ?

Best regards

Replies 3 3

API_User
Level 9
Hello,

The error was on my side.
The response had a header «Content-Encoding: gzip» that I ignored.
I "just" had to decode the response to get a valid json.

Best regards

API_User
Level 9
Thanks for the update!

Warm Regards,
Equinix Fabric Developer Community

API_User
Level 9
Hi
Can you share more detail on it? is it possible share code also