Skip to main content
A singular property will return a single related resource. A plural property will return an array of related resources. The include query parameter will include related resources in the response. For example, a user belongs to teams and has authored comments.
GET https://api.obselite.com/v0/users/read?id=...&include=teams,comments
The response will include the user’s teams and comments.
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Sarah Chen",
  "email": "[email protected]",
  "teams": [
    {
        "id": "550e8400-e29b-41d4-a716-446655440001",
        "name": "Engineering"
    }
  ],
  "comments": [
    {
        "id": "c550e840-1234-41d4-a716-446655440001",
        "body": "Updated the API documentation with new examples",
        "createdAt": "2024-03-15T14:23:45.000Z",
        "updatedAt": "2024-03-15T14:23:45.000Z"
    },
    {
        "id": "c550e840-5678-41d4-a716-446655440002",
        "body": "Fixed type validation in user authentication flow",
        "createdAt": "2024-03-14T09:12:30.000Z",
        "updatedAt": "2024-03-14T11:45:22.000Z"
    }
  ]
}
On the other hand, a user can only have one avatar.
GET https://api.obselite.com/v0/users/read?id=...&include=avatar
The response will include the user’s avatar.
{
  "id": "7a1b9c23-d4e5-48f6-90ab-cd1234567890",
  "name": "Alex Rodriguez",
  "email": "[email protected]",
  "avatar": {
    "id": "9f8e7d6c-5b4a-3210-fedc-ba9876543210",
    "name": "profile_photo.jpg",
    "url": "https://api.obselite.com/v0/files/9f8e7d6c-5b4a-3210-fedc-ba9876543210",
    "type": "image/jpeg",
    "size": 2048,
    "createdAt": "2024-02-28T09:45:32.000Z",
    "updatedAt": "2024-02-28T09:45:32.000Z"
  }
}