Apollo API Documentation

Notes API calls


List all notes

GET /#{ contacts || cases || deals }/#{id}/notes/#{page}

Returns a collection of notes that are visible to the authenticated user and related to a specific contact, case or deal.

Response

{
	"continued-at":"/contacts/5/notes/2"
	"notes":[
		{
			"id":"84334887",
			"body":"A note",
			"date":"2012-05-24 15:30:34",
			...
		},
		{
			"id":"56253586",
			"body":"Another note",
			"date":"2012-05-30 08:30:34",
			...
		},
		...
	]
}

Get single note

GET /notes/#{id}

Returns a single note. Attachments are included, but comments are kept separate at /notes/#{id}/comments.

Response

{
	"note":{
		"id":"84334887",
		"body":"A note",
		"date":"2012-05-24 15:30:34",
		...
	}
}

Create note

POST /#{ contacts || cases || deals }/#{id}/notes

Creates a new note with the currently authenticated user as the author. By default, a new note is assumed to be visible to everyone. You can also choose to make the note only visible to the creator using “only-me” as the value for the visibility key. Or “group” and pass in a workgroup-id key too. Or “selected-people” and pass an array of id of users that can see the note (note that the creator id is always included).

Request

{
	"note":{
		"body":"A note",
		// UTC timestamp
		"date":"2012-05-24 15:30:34",
		"visibility":"public",
		"attachments":["98906073"]
	}
}

Response

Returns HTTP status code 201 (“Created”) on success. The response contain the new note ID. On failure, a non-200 status code will be returned, possibly with error information in JSON format as the response's content.

{
	"note-id":"68974119"
}

Update note

PUT /notes/#{id}

Updates an existing note with new details from the submitted JSON.

Request

{
	"note":{
		"visibility":"only-me",
		"attachments":["-56340843", "50360412"]
	}
}

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error.


Destroy note

DELETE /notes/#{id}

Destroys the given note.

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error.