- User authentication
- Journals with entry tracking
POST /users
{
"firstName": "Zaphod",
"lastName": "Beeblebrox",
"email": "zaphod@beeblebrox.com",
"password": "Betelgeuse123"
}
HTTP/1.1 200 OK
Content-Length: 173
Content-Type: application/json
Date: Sun, 18 May 2014 07:14:55 GMT
{
"created": "2014-05-18T07:14:55.324614747Z",
"email": "zaphod@beeblebrox.com",
"firstName": "Zaphod",
"id": 14,
"lastName": "Beeblebrox",
"updated": "2014-05-18T07:14:55.324614861Z"
}
{
"email": "zaphod@beeblebrox.com",
"password": "Betelgeuse123"
}
HTTP/1.1 200 OK
Content-Length: 129
Content-Type: application/json
Date: Sun, 18 May 2014 07:16:08 GMT
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MDA2NTY1NjgsImlkIjoxNH0.hmfpEmTidzQ5kEzJ3iZ_dMmhg-ohetW5rEyBx2Jl1TM"
}
token
is a JSON Web Token (JWT). It should be included with every
authenticated request in the Authorization
header.
Example of a valid Authorization
header.
Authorization:Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MDA2NTY1NjgsImlkIjoxNH0.hmfpEmTidzQ5kEzJ3iZ_dMmhg-ohetW5rEyBx2Jl1TM
POST /journals
- Must be authenticated
{
"name": "Personal"
}
HTTP/1.1 200 OK
Content-Length: 126
Content-Type: application/json
Date: Sun, 18 May 2014 07:26:43 GMT
{
"created": "2014-05-18T07:26:43.204760935Z",
"id": 14,
"name": "Personal",
"updated": "2014-05-18T07:26:43.204760993Z",
"userID": 14
}
GET /journals
- Must be authenticated
HTTP/1.1 200 OK
Content-Length: 210
Content-Type: application/json
Date: Sun, 18 May 2014 07:31:16 GMT
[
{
"created": "2014-05-18T00:00:00Z",
"id": 14,
"name": "Personal",
"updated": "2014-05-18T00:00:00Z",
"userID": 14
},
{
"created": "2014-05-18T00:00:00Z",
"id": 15,
"name": "Work",
"updated": "2014-05-18T00:00:00Z",
"userID": 14
}
]
GET /journals/:id
- Must be authenticated
HTTP/1.1 200 OK
Content-Length: 106
Content-Type: application/json
Date: Sun, 18 May 2014 07:32:42 GMT
{
"created": "2014-05-18T00:00:00Z",
"id": 14,
"name": "Personal",
"updated": "2014-05-18T00:00:00Z",
"userID": 14
}
POST /journals/:id/entries
- Must be authenticated
{
"rating": 4,
"message": "I'm having a great time at this hackathon, but just ran into a bug."
}
HTTP/1.1 200 OK
Content-Length: 201
Content-Type: application/json
Date: Sun, 18 May 2014 07:35:06 GMT
{
"created": "2014-05-18T07:35:06.517898461Z",
"id": 10,
"journalID": 14,
"message": "I'm having a great time at this hackathon, but just ran into a bug",
"rating": 4,
"updated": "2014-05-18T07:35:06.517898522Z"
}
GET /journals/:id/entries
- Must be authenticated
HTTP/1.1 200 OK
Content-Length: 312
Content-Type: application/json
Date: Sun, 18 May 2014 07:37:43 GMT
[
{
"created": "2014-05-18T00:00:00Z",
"id": 10,
"journalID": 14,
"message": "I'm having a great time at this hackathon, but just ran into a bug",
"rating": 4,
"updated": "2014-05-18T00:00:00Z"
},
{
"created": "2014-05-18T00:00:00Z",
"id": 11,
"journalID": 14,
"message": "Fixed the bug!",
"rating": 5,
"updated": "2014-05-18T00:00:00Z"
}
]
GET /entries/:id
- Must be authenticated
HTTP/1.1 200 OK
Content-Length: 181
Content-Type: application/json
Date: Sun, 18 May 2014 07:45:19 GMT
{
"created": "2014-05-18T00:00:00Z",
"id": 10,
"journalID": 14,
"message": "I'm having a great time at this hackathon, but just ran into a bug",
"rating": 4,
"updated": "2014-05-18T00:00:00Z"
}