Our API - Extend aNotepad.com!
Our API is based on the REST spec and makes use of GET/POST/PUT/DELETE. Each method is documented below, along with sample CURL calls. For help getting off the ground, download the PHP sample file
Available methods:
- Notes:
- GET notes
- GET note
- POST (add) note
- PUT (update) note
- DELETE note
- Users:
- GET user
Notes
GET notes
URL:
https://anotepad.com/api/notes
Method:
GET
Requires Authentication:
TRUE
Parameters:
None
Usage example:
curl user:pass
https://anotepad.com/api/notes
Response:
{ "stat":"ok", "notes": [ { "noteId":"487", "userId":"461",
"title":"Woodchuck", "content":"How many woodchucks...",
"created":"2009-05-18 19:55:44", "updated":"2009-05-18 19:55:48",
"public":"1" }, { "noteId":"479", "userId":"461", "title":"Note One",
"content":"This is a note, with some content.", "created":"2009-05-17
08:50:07", "updated":"2009-05-18 19:55:30", "public":"0" } ] }
GET note
URL:
https://anotepad.com/api/notes/id
Method:
GET
Requires Authentication:
TRUE unless note is
public
Parameters:
- id [int] - required
Usage example:
curl
https://anotepad.com/api/notes/487
Response:
{ "stat":"ok", "note": { "noteId":"487", "userId":"461",
"title":"Woodchuck", "content":"Lorem ipsum.", "created":"2009-05-18
19:55:44", "updated":"2009-05-20 20:02:29", "public":"0" } }
POST (add) note
URL:
https://anotepad.com/api/notes
Method:
POST
Requires Authentication:
TRUE
Parameters:
- content[string] - required
- title[string]
- public[int]
Usage example:
curl user:pass -d "title=New
Note&content=Content goes here."
https://anotepad.com/api/notes
Response:
{ "stat":"ok", "note": { "noteId":"488", "userId":"461",
"title":"New Note", "content":"Content goes here.",
"created":"2009-05-18 19:55:44", "updated":"2009-05-20 20:02:29",
"public":"0" } }
PUT (update) note
URL:
https://anotepad.com/api/notes/id
Method:
PUT
Requires Authentication:
TRUE
Parameters:
- id[int] - required
- content[string] - required
- title[string]
- public[int]
Usage example:
curl user:pass -x PUT -d
"id=488&title=Updated title&content=Content goes here."
https://anotepad.com/api/notes
Response:
{ "stat":"ok", "note": { "noteId":"488", "userId":"461",
"title":"Updated title", "content":"Content goes here.",
"created":"2009-05-18 19:55:44", "updated":"2009-05-20 22:02:29",
"public":"0" } }
DELETE note
URL:
https://anotepad.com/api/notes/id
Method:
DELETE
Requires Authentication:
TRUE
Parameters:
- id[int] - required
Usage example:
curl user:pass -x DELETE
https://anotepad.com/api/notes
Response:
{ "stat":"ok", "message":"Note deleted." }
Users
GET user
URL:
https://anotepad.com/api/users/id
Method:
GET
Requires Authentication:
TRUE
Parameters:
- none
Usage example:
curl user:pass
https://anotepad.com/api/users
Response:
{ "stat":"ok", "user": { "userId":"461",
"email":"email@domain.com", "first_name":"John", "last_name":"Locke",
"created":"2009-05-15 16:47:33", "updated":"2009-05-20 20:02:29",
"package":"free", "payment_date":"0000-00-00 00:00:00",
"hookNoteSave":"", "hookNoteDelete":"" } }