DevStack

General notes

Documentation for Matee iOS/Android DevStack REST API.

API detail

Auth

POST /auth/login

Obtain authorization token

curl -X POST -H "Content-Type: application/json" -d '{
	"email": "petr.chmelar@matee.cz",
	"pass": "11111111"
}' "https://matee-devstack.herokuapp.com/api/auth/login"
POST /api/auth/login HTTP/1.1
Host: matee-devstack.herokuapp.com
Content-Type: application/json

{
	"email": "petr.chmelar@matee.cz",
	"pass": "11111111"
}
Status200
ServerCowboy
Connectionkeep-alive
X-Powered-ByExpress
Access-Control-Allow-Origin*
Access-Control-Allow-HeadersOrigin, X-Requested-With, Content-Type, Accept, Authorization
Access-Control-Allow-MethodsPUT, POST, GET, DELETE, OPTIONS
Content-Typeapplication/json; charset=utf-8
Content-Length270
EtagW/"10e-F0Aa+yQJw8kFDE3tpQ0fYGkjZ1M"
DateWed, 19 Dec 2018 12:46:37 GMT
Via1.1 vegur
{
    "userId": "5c1a3d7b4a74580016faadf8",
    "email": "petr.chmelar@matee.cz",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1YzFhM2Q3YjRhNzQ1ODAwMTZmYWFkZjgiLCJpYXQiOjE1NDUyMjM1OTcsImV4cCI6MTU0NTgyODM5N30.Gr5GmFDDm2u_hFvltMlwwwmT_JIc_134HNC6seRe90U"
}

POST /auth/registration

Create a new user (aka registration).

curl -X POST -H "Content-Type: application/json" -d '{
    "email": "petr.chmelar@matee.cz",
    "pass": "11111111",
    "firstName": "Petr",
    "lastName": "Chmelar"
}' "https://matee-devstack.herokuapp.com/api/auth/registration"
POST /api/auth/registration HTTP/1.1
Host: matee-devstack.herokuapp.com
Content-Type: application/json

{
    "email": "petr.chmelar@matee.cz",
    "pass": "11111111",
    "firstName": "Petr",
    "lastName": "Chmelar"
}
Status201
ServerCowboy
Connectionkeep-alive
X-Powered-ByExpress
Access-Control-Allow-Origin*
Access-Control-Allow-HeadersOrigin, X-Requested-With, Content-Type, Accept, Authorization
Access-Control-Allow-MethodsPUT, POST, GET, DELETE, OPTIONS
Location/user/5c1a3d7b4a74580016faadf8
Content-Typeapplication/json; charset=utf-8
Content-Length174
EtagW/"ae-Rgtv0ZErP3i8DBLl4ioDNTsMBuI"
DateWed, 19 Dec 2018 12:45:47 GMT
Via1.1 vegur
{
    "id": "5c1a3d7b4a74580016faadf8",
    "email": "petr.chmelar@matee.cz",
    "firstName": "Petr",
    "lastName": "Chmelar"
}

User

GET /user

List all users. Returns array with previews of User objects (id, email, firstName, lastName).

curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1YzFhM2Q3YjRhNzQ1ODAwMTZmYWFkZjgiLCJpYXQiOjE1NDUyMjM1OTcsImV4cCI6MTU0NTgyODM5N30.Gr5GmFDDm2u_hFvltMlwwwmT_JIc_134HNC6seRe90U" "https://matee-devstack.herokuapp.com/api/user?page=0&limit=100"
GET /api/user?page=0&limit=100 HTTP/1.1
Host: matee-devstack.herokuapp.com
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1YzFhM2Q3YjRhNzQ1ODAwMTZmYWFkZjgiLCJpYXQiOjE1NDUyMjM1OTcsImV4cCI6MTU0NTgyODM5N30.Gr5GmFDDm2u_hFvltMlwwwmT_JIc_134HNC6seRe90U
Status200
ServerCowboy
Connectionkeep-alive
X-Powered-ByExpress
Access-Control-Allow-Origin*
Access-Control-Allow-HeadersOrigin, X-Requested-With, Content-Type, Accept, Authorization
Access-Control-Allow-MethodsPUT, POST, GET, DELETE, OPTIONS
Content-Typeapplication/json; charset=utf-8
Content-Length210
EtagW/"d2-0+KGnsxrN7JmJQphNVz4aMQXfi8"
DateWed, 19 Dec 2018 12:47:07 GMT
Via1.1 vegur
{
    "page": 0,
    "limit": 100,
    "lastPage": 0,
    "data": [
        {
            "id": "5c1a3d7b4a74580016faadf8",
            "email": "petr.chmelar@matee.cz",
            "firstName": "Petr",
            "lastName": "Chmelar"
        },
        {
            "id": "5c50224464662000177f69a9",
            "email": "user1@matee.cz",
            "firstName": "User1",
            "lastName": "Matee"
        }
    ]
}

GET /user/:id

View a specified user. Returns User object with all of the properties.

curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1YzFhM2Q3YjRhNzQ1ODAwMTZmYWFkZjgiLCJpYXQiOjE1NDUyMjM1OTcsImV4cCI6MTU0NTgyODM5N30.Gr5GmFDDm2u_hFvltMlwwwmT_JIc_134HNC6seRe90U" "https://matee-devstack.herokuapp.com/api/user/5c1a3d7b4a74580016faadf8"
GET /api/user/5c1a3d7b4a74580016faadf8 HTTP/1.1
Host: matee-devstack.herokuapp.com
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1YzFhM2Q3YjRhNzQ1ODAwMTZmYWFkZjgiLCJpYXQiOjE1NDUyMjM1OTcsImV4cCI6MTU0NTgyODM5N30.Gr5GmFDDm2u_hFvltMlwwwmT_JIc_134HNC6seRe90U
Status200
ServerCowboy
Connectionkeep-alive
X-Powered-ByExpress
Access-Control-Allow-Origin*
Access-Control-Allow-HeadersOrigin, X-Requested-With, Content-Type, Accept, Authorization
Access-Control-Allow-MethodsPUT, POST, GET, DELETE, OPTIONS
Content-Typeapplication/json; charset=utf-8
Content-Length174
EtagW/"ae-Rgtv0ZErP3i8DBLl4ioDNTsMBuI"
DateWed, 19 Dec 2018 12:47:24 GMT
Via1.1 vegur
{
    "id": "5c1a3d7b4a74580016faadf8",
    "email": "petr.chmelar@matee.cz",
    "firstName": "Petr",
    "lastName": "Chmelar",
    "phone": "112567",
    "bio": "iOS dev"
}

PUT /user/:id

Edit a specified user. Returns modified User object with all of the properties.

curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1YzFhM2Q3YjRhNzQ1ODAwMTZmYWFkZjgiLCJpYXQiOjE1NDUyMjM1OTcsImV4cCI6MTU0NTgyODM5N30.Gr5GmFDDm2u_hFvltMlwwwmT_JIc_134HNC6seRe90U" -d '{
	"pass": "11111111",
	"firstName": "Petr",
	"lastName": "Chmelar",
	"phone": "112567",
	"bio": "iOS dev"
}' "https://matee-devstack.herokuapp.com/api/user/5c1a3d7b4a74580016faadf8"
PUT /api/user/5c1a3d7b4a74580016faadf8 HTTP/1.1
Host: matee-devstack.herokuapp.com
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1YzFhM2Q3YjRhNzQ1ODAwMTZmYWFkZjgiLCJpYXQiOjE1NDUyMjM1OTcsImV4cCI6MTU0NTgyODM5N30.Gr5GmFDDm2u_hFvltMlwwwmT_JIc_134HNC6seRe90U

{
	"pass": "11111111",
	"firstName": "Petr",
	"lastName": "Chmelar",
	"phone": "112567",
	"bio": "iOS dev"
}
Status200
ServerCowboy
Connectionkeep-alive
X-Powered-ByExpress
Access-Control-Allow-Origin*
Access-Control-Allow-HeadersOrigin, X-Requested-With, Content-Type, Accept, Authorization
Access-Control-Allow-MethodsPUT, POST, GET, DELETE, OPTIONS
Content-Typeapplication/json; charset=utf-8
Content-Length4
EtagW/"4-X/5TO4MPCKAyY0ipFgr6/IraRNs"
DateWed, 19 Dec 2018 12:47:36 GMT
Via1.1 vegur
{
    "id": "5c1a3d7b4a74580016faadf8",
    "email": "petr.chmelar@matee.cz",
    "firstName": "Petr",
    "lastName": "Chmelar",
    "phone": "112567",
    "bio": "iOS dev"
}