Apollo API Documentation

Messages API calls


Get messages

GET /projects/#{project_id}/messages/#{page}

Returns the 25 most recent messages in the given project. The {page} parameter is optional. If there are older messages not included in the response, the root response element will also have a “continued-at” attribute specifying the path where the next oldest 25 messages can be retrieved.

Response

{
	"continued-at":"/projects/1/messages/2",
	"messages":[
		{
			"id":"61755784",
			"title":"Message 1",
			...
		},
		{
			"id":"35371388",
			"title":"Message 2",
			...
		},
		...
	]
}

Get message

GET /messages/#{id}

Returns a single message record identified by its integer ID.

Response

{
	"message":{
		"id":"61755784",
		"title":"Message 1",
		...
	}
}

Get messages by category

GET /projects/#{project_id}/cat/#{category_id}/messages/#{page}

Returns the 25 most recent messages in the given project for the given category. The {page} parameter is optional. If there are older messages not included in the response, the root response element will also have a “continued-at” attribute specifying the path where the next oldest 25 messages can be retrieved.

Response

{
	"continued-at":"/projects/1/cat/3/messages/2",
	"messages":[
		{
			"id":"61755784",
			"title":"Message 1",
			...
		},
		{
			"id":"35371388",
			"title":"Message 2",
			...
		},
		...
	]
}

Create message

POST /projects/#{project_id}/messages

Creates a new message, optionally sending notifications to a selected list of people. Note that you can also upload files using this function, but you need to upload the files first and then attach them.

Request

{
	"message":{
		"category-id":"51524282",
		"milestone-id":"22781311",
		"title":"New message",
		"body":"This is a <strong>new</strong> message",
		"is-private":"1",
		"pinned":"0",
		"subscribers":["14505968", "4748932", "7574837"],
		"attachments":["332929", "94092840"]
	}
}

Response

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

{
	"message-id":"140104985"
}

Update message

PUT /messages/#{id}

Updates an existing message, optionally sending notifications to a selected list of people. Note that you can also upload files using this function, but you need to upload the files first and then attach them.

Request

{
	"message":{
		"title":"Updated message",
		"subscribers":["14505968", "4748932"]
	}
}

Response

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


Destroy message

DELETE /messages/#{id}

Destroys the given message and all of its associated comments.

Response

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