uphold / docs

Uphold API Reference
https://uphold.com/en/developer/api/documentation/
48 stars 39 forks source link

Error response for transactions is different? #38

Closed naps62 closed 9 years ago

naps62 commented 9 years ago

Most errors responses I see from the API are in this format:

{"code":401,"error":"invalid_token","error_description":"The access token provided is invalid."}

However, I just noticed that when attempting to create an invalid transaction, I get an error of a different format:

# Note that I used a wrong value for the destination field

curl "https://api.bitreserve.org/v0/me/cards/OMITTED_CARD_ID/transactions" \
  -X POST \
  -H "Authorization: Bearer OMITTED_TOKEN" \
  -d "denomination[currency]=BTC&denomination[amount]=0&destination=this_email_does_exist"

{"code":"validation_failed","errors":{"destination":[{"code":"invalid","message":"This value is not valid"}]}

Is this intendend?

fixe commented 9 years ago

@naps62 the authentication error responses follows the OAuth2 specification. In the other cases we use the structure you mentioned.

naps62 commented 9 years ago

@fixe Ok makes sense now. Thanks