Skip to content

Instantly share code, notes, and snippets.

@oberhamsi
Created May 27, 2015 07:07
Show Gist options
  • Save oberhamsi/76330495813f86dad595 to your computer and use it in GitHub Desktop.
Save oberhamsi/76330495813f86dad595 to your computer and use it in GitHub Desktop.

User

FIXME

Attributes

Name Type Description Example
created_at date-time when user was created "2012-01-01T12:00:00Z"
id uuid unique identifier of user "01234567-89ab-cdef-0123-456789abcdef"
name string unique name of user "name"
updated_at date-time when user was updated "2012-01-01T12:00:00Z"

User Create

Create a new user.

POST /users

Curl Example

$ curl -n -X POST https://api.hello.com/users \
  -H "Content-Type: application/json" \
 \
  -d '{
}'

Response Example

HTTP/1.1 201 Created
{
  "created_at": "2012-01-01T12:00:00Z",
  "id": "01234567-89ab-cdef-0123-456789abcdef",
  "name": "name",
  "updated_at": "2012-01-01T12:00:00Z"
}

User Delete

Delete an existing user.

DELETE /users/{user_id_or_name}

Curl Example

$ curl -n -X DELETE https://api.hello.com/users/$USER_ID_OR_NAME \
  -H "Content-Type: application/json" \

Response Example

HTTP/1.1 200 OK
{
  "created_at": "2012-01-01T12:00:00Z",
  "id": "01234567-89ab-cdef-0123-456789abcdef",
  "name": "name",
  "updated_at": "2012-01-01T12:00:00Z"
}

User Info

Info for existing user.

GET /users/{user_id_or_name}

Curl Example

$ curl -n https://api.hello.com/users/$USER_ID_OR_NAME

Response Example

HTTP/1.1 200 OK
{
  "created_at": "2012-01-01T12:00:00Z",
  "id": "01234567-89ab-cdef-0123-456789abcdef",
  "name": "name",
  "updated_at": "2012-01-01T12:00:00Z"
}

User List

List existing users.

GET /users

Curl Example

$ curl -n https://api.hello.com/users

Response Example

HTTP/1.1 200 OK
[
  {
    "created_at": "2012-01-01T12:00:00Z",
    "id": "01234567-89ab-cdef-0123-456789abcdef",
    "name": "name",
    "updated_at": "2012-01-01T12:00:00Z"
  }
]

User Update

Update an existing user.

PATCH /users/{user_id_or_name}

Curl Example

$ curl -n -X PATCH https://api.hello.com/users/$USER_ID_OR_NAME \
  -H "Content-Type: application/json" \
 \
  -d '{
}'

Response Example

HTTP/1.1 200 OK
{
  "created_at": "2012-01-01T12:00:00Z",
  "id": "01234567-89ab-cdef-0123-456789abcdef",
  "name": "name",
  "updated_at": "2012-01-01T12:00:00Z"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment