User item

Read/write

This resource type refers to a registered store user.

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

"rel": "owner" or "rel": "user"

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

Example request:

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

Example response:

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

  {
      "collection": {
          "href": "http://localhost:8010/api/v1/users/2/",
          "items": [
              {
                  "data": [
                      {
                          "name": "username",
                          "value": "cube"
                      },
                      {
                          "name": "email",
                          "value": "cube@babymri.org"
                      }
                  ],
                  "href": "http://localhost:8010/api/v1/users/2/",
                  "links": [
                      {
                          "href": "http://localhost:8010/api/v1/1/",
                          "rel": "plugin"
                      },
                      {
                          "href": "http://localhost:8010/api/v1/2/",
                          "rel": "plugin"
                      }
                  ]
              }
          ],
          "links": [],
          "template": {
              "data": [
                  {
                      "name": "email",
                      "value": ""
                  },
                  {
                      "name": "password",
                      "value": ""
                  }
              ]
          },
          "version": "1.0"
      }
  }
Request Headers:
 
  • Accept – application/vnd.collection+json
Response Headers:
 
Status Codes:

Properties (API semantic descriptors):

  • username (string) – user’s username
  • email (string) – user’s email

Link Relations:

  • plugin – links to a user’s owned plugin