« Back to Flocknote API Documentation home
Get a Note
GET /notes/[id]
Accessing a particular note will return a JSON array with the following information:
{
"id" : 1234,
"type" : "note",
"author" : 123,
"created" : 1310528804, // Unix timestamp (subject to change).
"changed" : 1312348983, // Unix timestamp (subject to change).
"title" : "Retrieved Note Title",
"body" : "<p>Body of the retrieved note.</p>",
"list" : 123
}Example — Retrieve a note using Flocknote's SDK for PHP:
require_once('flocknote.php'); if ($flocknote = new Flocknote(APINAME, APIKEY)) { // Set the username and password for this request. $flocknote->setUserCredentials(USERNAME, PASSWORD); // Get a note with ID 123. $note = $flocknote->getNote(123); }
Submit a Note
POST /notes
To submit a new note, don't provide an id in the URL, but include JSON in the body of the http request with the following items:
list_id- The list into which this note should be posted (make sure the user has the add_note permission for this list prior to allowing submission of a new note).title- The title of the new note.body- The body of the new note. (Can be plain text or HTML-formatted.)
Example JSON body for a new note:
{
"list_id" : 123,
"title" : "New Note",
"body":"This is a test note posted to the Flocknote API."
}If the note was successfully saved, you will receive HTTP code 201 and the id of the new note in the response body:
{
"id" : 51199
}If the note could not be saved, you will receive HTTP code 400 and an Error in the response body:
{
"Error" : true,
"ErrorMessage" : "Note could not be posted into the given list."
}(Alternatively, if your request was missing one of the required parameters, you'll receive ErrorMessage "Note was missing required parameters.")
Example — Submit a new note, using Flocknote's SDK for PHP:
require_once('flocknote.php'); if ($flocknote = new Flocknote(APINAME, APIKEY)) { // Set the username and password for this request. $flocknote->setUserCredentials(USERNAME, PASSWORD); $note = array( 'list_id' => 123, 'title' => 'Test Note', 'body' => 'This is a test note posted to the Flocknote API.', ); // If succesful, the new note id is stored in $note['id']. $note = $flocknote->addNote($note); }