User item

Read-only

This resource type refers to a registered user.

In other Collection+JSON resource representations this resource type is linked by any link relation with attribute:

"rel": "owner"

GET /api/v1/users/(int: user_id)/
Synopsis:Gets a registered user.

Example request:

GET /api/v1/users/2/ HTTP/1.1
Host: localhost:8000
Accept: application/vnd.collection+json

Example response:

HTTP/1.1 200 OK
Allow: GET
Content-Type: application/vnd.collection+json

{
    "collection": {
        "href": "https://localhost:8000/api/v1/users/2/",
        "items": [
            {
                "data": [
                    {
                        "name": "username",
                        "value": "jbernal"
                    }
                ],
                "href": "https://localhost:8000/api/v1/users/2/",
                "links": [
                    {
                        "href": "https://localhost:8000/api/v1/33/",
                        "rel": "feed"
                    },
                    {
                        "href": "https://localhost:8000/api/v1/34/",
                        "rel": "feed"
                    },
                    {
                        "href": "https://localhost:8000/api/v1/35/",
                        "rel": "feed"
                    },
                    {
                        "href": "https://localhost:8000/api/v1/36/",
                        "rel": "feed"
                    }
                ]
            }
        ],
        "links": [],
        "version": "1.0"
    }
}
Request Headers:
 
  • Accept – application/vnd.collection+json
Response Headers:
 
Status Codes:

Properties (API semantic descriptors):

  • username (string) – user’s username

Link Relations:

  • feed – links to a user’s feed