Developer Forum Equinix Fabric™ APIs Error with error format on serviceTokensClosed
 The Developer Forum is shutting down. Please join the Equinix Community to participate in new discussions.
TO
API User
Wednesday, March 30, 2022 - 21:31

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: <FILE>" 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

TO
API User
Thursday, April 7, 2022 - 19:48

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

AM
API User
Thursday, April 7, 2022 - 21:04

Thanks for the update!

 

Warm Regards,

Equinix Fabric Developer Community

SD
API User
Saturday, April 9, 2022 - 01:31

Hi 

Can you share more detail on it? is it possible share code also