Link Search Menu Expand Document

Updated Fri Jun 18th 2021, 16:17 UTC

Show

GET /users/:user

Shows the details for a particular User, along with their memerships. A membership is the association between a user and an account.

Examples

Get a User

Request

GET /users/wqyODPA
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X GET /users/wqyODPA
    

Response

Status

200

Response Type

User

Example
{
  "@type": "User",
  "@context": "/contexts/User.jsonld",
  "id": "/users/wqyODPA",
  "name": "Chuck Norris",
  "firstName": "Chuck",
  "lastName": "Norris",
  "email": "chuck@textus.example",
  "avatar": null,
  "automatedActor": false,
  "hasPassword": false,
  "discarded": false,
  "settings": {
    "notifications": {
      "email": true
    },
    "customSettings": {}
  },
  "memberships": {
    "@type": "hydra:Collection",
    "@context": "/contexts/hydra:Collection.jsonld",
    "id": "/users/wqyODPA/memberships",
    "members": [
      {
        "@type": "Membership",
        "@context": "/contexts/Membership.jsonld",
        "id": "/users/wqyODPA/memberships/PWApBE3",
        "role": "user",
        "user": "/users/wqyODPA",
        "account": {
          "@type": "Account",
          "@context": "/contexts/Account.jsonld",
          "id": "/accounts/my_account",
          "name": "Example Account"
        }
      }
    ],
    "totalItems": 1
  }
}

Get a User with Custom Schema data

Request

GET /users/wqyODPA
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X GET /users/wqyODPA
    

Response

Status

200

Response Type

User

Example
{
  "@type": "User",
  "@context": "/contexts/User.jsonld",
  "id": "/users/wqyODPA",
  "name": "Chuck Norris",
  "firstName": "Chuck",
  "lastName": "Norris",
  "email": "chuck@textus.example",
  "avatar": null,
  "automatedActor": false,
  "hasPassword": false,
  "discarded": false,
  "settings": {
    "notifications": {
      "email": true
    },
    "customSettings": {
      "/textus/user_schema/calendar": "https://calend.ly/chuck-norris"
    }
  },
  "memberships": {
    "@type": "hydra:Collection",
    "@context": "/contexts/hydra:Collection.jsonld",
    "id": "/users/wqyODPA/memberships",
    "members": [
      {
        "@type": "Membership",
        "@context": "/contexts/Membership.jsonld",
        "id": "/users/wqyODPA/memberships/PWApBE3",
        "role": "user",
        "user": "/users/wqyODPA",
        "account": {
          "@type": "Account",
          "@context": "/contexts/Account.jsonld",
          "id": "/accounts/my_account",
          "name": "Example Account"
        }
      }
    ],
    "totalItems": 1
  }
}

© 2021 TextUs