This repository was archived by the owner on May 29, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
API v1.0
Enrico Stano edited this page Nov 5, 2016
·
1 revision
Request:
POST api/v1/signups
{
"email": "user@email.com"
}
Response:
201 CREATED
{}
Request:
GET api/v1/signups/:token
Response:
200 OK
{
"email": "user@email.com"
}
Request:
POST api/v1/signups/complete/:token
{
"username": "username",
"password": "sosecret",
"password_confirmation": "sosecret",
"first_name": "User",
"last_name": "Name"
}
Response:
200 OK
{
"id": 1,
"email": "user@email.com",
"username": "username",
"first_name": "User",
"last_name": "Name"
"created_at": "2014-09-06T11:48:39.072Z",
"updated_at": "2014-09-06T11:48:39.072Z"
}
GET api/v1/account
{}
Response:
{
"id": 1,
"name": "User name",
"email": "user@email.com",
"created_at": "2014-09-06T11:48:39.072Z",
"updated_at": "2014-09-06T11:48:39.072Z"
}
All the users that have a Membership with any of the user's groups
GET api/v1/users
{}
Response:
[
{
"id": 1,
"name": "User name",
"email": "user@email.com",
"created_at": "2014-09-06T11:48:39.072Z",
"updated_at": "2014-09-06T11:48:39.072Z"
},
{
"id":2,
"name":"Other user",
"email":"other@hola.com",
"created_at":"2014-08-31T18:40:40.255Z",
"updated_at":"2014-08-31T18:40:40.255Z"
}
]
POST api/v1/groups
{
"name": "My group"
}
POST api/v1/memberships
{
"group_id": 1,
"user_id": 1,
"role": 1
}
A list of all the possible Group roles can be found in app/models/membership.rb.