-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b566a5f
commit fb3d78f
Showing
14 changed files
with
329 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,48 @@ | |||
--- | |||
title: Qoolife API V1 Journal Entries Creation | |||
--- | |||
|
|||
# Journal Entries Creation | # Journal Entries Creation | ||
|
|
||
You can create a new journal entry for the authenticated user with: | You can create a new journal entry for the authenticated user submitting its data to: | ||
|
|||
<pre> | |||
POST /api/v1/journal_entries | |||
</pre> | |||
|
|||
<dl> | |||
<dt>journal_entry[body]</dt> | |||
<dd>Text for the entry body</dd> | |||
<dt>journal_entry[date]</dt> | |||
<dd>Date for the entry</dd> | |||
<dt>journal_entry[private]</dt> | |||
<dd>Boolean value to indicate if the entry will be marked as private. Can be 1 (true) or 0 (false). By default, it's false so you only need to include this param if you want to set it to true.</dd> | |||
</dl> | |||
|
|||
Currently the API does not support creating measurements for the entries. | |||
|
|||
Example request: | |||
|
|||
<pre class="console"> | |||
curl -u 'user@example.com:sekret' -X POST -d "journal_entry[body]=a private entry for October 5th 15:35;journal_entry[date]=2012-10-05T15:35;journal_entry[private]=1" https://qoolife.com/api/v1/journal_entries | |||
</pre> | |||
|
|||
Response: | |||
|
|||
<pre> | |||
HTTP/1.1 201 Created | |||
|
|
||
POST /api/v1/journal_entries | { | ||
"id":609, | |||
"user_id":1, | |||
"author_id":1, | |||
"body":"a private entry for October 5th 15:35", | |||
"body_html":"<p>a private entry for October 5th 15:35</p>", | |||
"private":true, | |||
"date":"2012-10-05T15:35:00+02:00", | |||
"created_at":"2012-03-18T10:40:30+01:00", | |||
"updated_at":"2012-03-18T10:40:30+01:00", | |||
"comments_count":0, | |||
"measurements":[] | |||
} | |||
</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,66 @@ | |||
--- | |||
title: Qoolife API V1 Journal Entries Listing | |||
--- | |||
|
|||
# Journal Entries Listing | # Journal Entries Listing | ||
|
|
||
You can get all journal entries for the authenticated user with: | You can get all journal entries for the authenticated user from: | ||
|
|||
<pre> | |||
GET /api/v1/journal_entries | |||
</pre> | |||
|
|||
The response will be a JSON array with all the journal entries for the user, including an array of measurements for each individual entry. | |||
|
|||
Example request: | |||
|
|||
<pre class="console"> | |||
curl -v -u 'user@example.com:sekret' https://qoolife.com/api/v1/journal_entries | |||
</pre> | |||
|
|||
Response: | |||
|
|||
<pre> | |||
HTTP/1.1 200 OK | |||
|
|
||
GET /api/v1/journal_entries | [ | ||
{ | |||
"id":202, | |||
"author_id":1, | |||
"user_id":1, | |||
"body":"Id autem", | |||
"body_html":"<p>Id autem</p>", | |||
"comments_count":0, | |||
"private":false, | |||
"date":"2011-07-18T09:41:00+02:00", | |||
"created_at":"2011-07-19T09:41:47+02:00", | |||
"updated_at":"2011-11-30T16:48:24+01:00", | |||
"measurements":[ | |||
{ | |||
"created_at":"2011-07-19T09:41:47+02:00", | |||
"date":"2011-07-18T09:41:00+02:00", | |||
"float_value":68.0, | |||
"id":99, | |||
"int_value":null, | |||
"journal_entry_id":202, | |||
"text_value":"68.0", | |||
"updated_at":"2011-11-30T16:48:24+01:00", | |||
"user_id":1, | |||
"variable_id":1 | |||
}, | |||
{ | |||
"created_at":"2011-07-19T09:41:47+02:00", | |||
"date":"2011-07-18T09:41:00+02:00", | |||
"float_value":null, | |||
"id":100, | |||
"int_value":0, | |||
"journal_entry_id":202, | |||
"text_value":null, | |||
"updated_at":"2011-09-05T20:56:09+02:00", | |||
"user_id":1, | |||
"variable_id":3 | |||
} | |||
] | |||
} | |||
] | |||
</pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.