diff --git a/api/docs.md b/api/docs.md index dd36b70..6ed9685 100644 --- a/api/docs.md +++ b/api/docs.md @@ -406,8 +406,30 @@ Only the following parameters can be changed. Every parameter is optional. | HTTP Status | Error code | Message | |:---:|:---:|:---| -| `401` | `40001` | `user not authorized` | -| `400` | `40004` | `malformed JSON body` | | `400` | `40009` | `organization not found` | | `400` | `40010` | `malformed URL parameter` | +| `400` | `4012` | `no organization provided` | +| `500` | `50002` | `internal server error` | + +### 🧑‍🤝‍🧑 Organization members + +* **Path** `/organizations/{address}/members` +* **Method** `GET` +* **Response** +```json +[ + { + "info": { /* user info response */ }, + "role": "admin" + } +] +``` + +* **Errors** + +| HTTP Status | Error code | Message | +|:---:|:---:|:---| +| `400` | `40009` | `organization not found` | +| `400` | `40010` | `malformed URL parameter` | +| `400` | `4012` | `no organization provided` | | `500` | `50002` | `internal server error` | \ No newline at end of file diff --git a/api/organizations.go b/api/organizations.go index f31302a..1ef4d17 100644 --- a/api/organizations.go +++ b/api/organizations.go @@ -95,7 +95,7 @@ func (a *API) organizationInfoHandler(w http.ResponseWriter, r *http.Request) { // get the organization info from the request context org, parent, ok := a.organizationFromRequest(r) if !ok { - ErrUnauthorized.Write(w) + ErrNoOrganizationProvided.Write(w) return } // send the organization back to the user @@ -109,7 +109,7 @@ func (a *API) organizationMembersHandler(w http.ResponseWriter, r *http.Request) // get the organization info from the request context org, _, ok := a.organizationFromRequest(r) if !ok { - ErrUnauthorized.Write(w) + ErrNoOrganizationProvided.Write(w) return } // send the organization back to the user