splitwise / api-docs

API documentation for the Splitwise API.
http://dev.splitwise.com
28 stars 16 forks source link

Update user endpoint response shapes #73

Closed Kore-rep closed 9 months ago

Kore-rep commented 9 months ago

Update the shape of the /get_user/{id} endpoint to match actual response (missing a parent "user" object wrapping all the details, as in the get_current_user endpoint).

Docs shape:

{
  "id": 0,
  "first_name": "Ada",
  "last_name": "Lovelace",
  "email": "ada@example.com",
  "registration_status": "confirmed",
  "picture": {
    "small": "string",
    "medium": "string",
    "large": "string"
  }
}

Actual response:

{
    "user": {
        "id": 49783008,
        "first_name": "Angus",
        "last_name": null,
        "picture": {
            "small": "https://s3.amazonaws.com/splitwise/uploads/user/default_avatars/avatar-teal45-50px.png",
            "medium": "https://s3.amazonaws.com/splitwise/uploads/user/default_avatars/avatar-teal45-100px.png",
            "large": "https://s3.amazonaws.com/splitwise/uploads/user/default_avatars/avatar-teal45-200px.png"
        },
        "custom_picture": false,
        "email": "xxxxxx",
        "registration_status": "confirmed"
    }
}

Additionally added the custom_picture fields to the documentation for /get_current_user and get_user/{id}