Currently we don't know the reason of curl failures. We should probably parse the response and look for an error message to display it to the user.
ex of response:
string(83) "{"error":{"code":401,"message":"Unauthorized: Key or token incorrectly formatted"}}"