api-v2
api-v2 copied to clipboard
Document all possible Id's and Message for API errors/unsuccessful's scenarios
Documentation doesn't reflect the v2 API behavior. Which is correct one?
HTTP/1.1403 Forbidden
{
"error": "forbidden",
"description": "You do not have access for the attempted action."
}
My v2 API client development interaction/testing
Http Code 404: This is for incorrect REST resource URL scenario
{
"id": "not_found",
"message": "The resource you were accessing could not be found."
}
http code 422: This is for unique name exception while domain creation
{
"id":"unprocessable_entity",
"message":"Name has already been taken"
}
Http Code 401: This is for incorrect token & read-only access token performing write operation
{
"id":"unauthorized",
"message":"Unable to authenticate you."
}
- First thing response structure is incorrect as per document
- _For read-only access token performing write operation:_ I should be getting 403 with message; either one format. But API is responding with Http code 401 & saying unauthorized.
+1
Agreed, will do.
Possible duplicate of https://github.com/digitaloceancloud/api-v2/issues/37
For read-only access token performing write operation: I should be getting 403 with message; either one format. But API is responding with Http code 401 & saying unauthorized.
is the bit that overlaps with #37. I want to leave both of them open and just have this one focus on correctly documenting the error messages. The 401 versus 403 is an issue internal to our implementation of oauth.
:+1: