Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create/Sign up user #30

Open
williamespindola opened this issue Apr 21, 2017 · 0 comments
Open

Create/Sign up user #30

williamespindola opened this issue Apr 21, 2017 · 0 comments
Milestone

Comments

@williamespindola
Copy link
Owner

williamespindola commented Apr 21, 2017

Create/Sign up user

Request

POST /users
Accept: Application/vnd.siren+json
Content-Type: Application/Json
{
  "name": "Girafales",
  "email": "[email protected]",
  "password": "123456",
}

Response

Status: 201 Created
Content-Type: Application/vnd.siren+json
{
    "class":  ["user"],
    "properties": {
      "_id": "e4eaaaf2-d142-11e1-b3e4-080027620cdd",
      "name": "Girafales",
      "email": "[email protected]",
      "created_at": "2016-09-09 10:10:10",
      "updated_at": "2016-09-09 10:10:10"
    },
    "actions" : [
      {
        "name": "edit-user",
        "title": "Edit user",
        "method": "PUT",
        "href": "http://api.x.io/users/e4eaaaf2-d142-11e1-b3e4-080027620cdd",
        "type": "application/json",
        "fields": [
          { "name": "name", "type": "text", "value": "Girafales" },
          { "name": "email", "type": "text", "value": "[email protected]" }
          { "name": "password", "type": "text", "value": "***" }
        ]
      },
      {
        "name": "delete-user",
        "title": "Delete user",
        "method": "DELETE",
        "href": "http://api.x.io/users/e4eaaaf2-d142-11e1-b3e4-080027620cdd",
      }
    ],
    "links": [
      { "rel": ["self"], "href": "/users/e4eaaaf2-d142-11e1-b3e4-080027620cdd" }
      { "rel": ["collection"], "href": "/users/e4eaaaf2-d142-11e1-b3e4-080027620cdd/events" }
      { "rel": ["collection"], "href": "/users/e4eaaaf2-d142-11e1-b3e4-080027620cdd/subjects" }
    ]
}

Related #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant