Apollo API Documentation

Categories API calls


Get categories

GET /projects/#{project_id}/categories/:{type}

Returns all categories for the given project. To filter by type, pass the “type” parameter, which can be one of “message”, “file”, “writeboard” or “link”.

Response

{
	"categories":[
		{
			"id":"40622310",
			"name":"Assets",
			...
		},
		{
			"id":"76859314",
			"name":"Copywriting",
			...
		},
		...
	]
}

Get category

GET /categories/#{id}

Returns a single category identified by its integer ID.

Response

{
	"category":{
		"id":"77749177",
		"name":"Code",
		...
	}
}

Create category

POST /projects/#{project_id}/categories

Creates a new category of the given type for the given project. The “type” attribute is required and must be one of “message”, “file”, “writeboard” or “link”.

Request

{
	"category":{
		"name":"Code",
		"type":"message"
	}
}

Response

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

{
	"category-id":"72280414"
}

Update category

PUT /categories/#{id}

Updates an existing category identified by its integer ID.

Request

{
	"category":{
		"name":"Code"
	}
}

Response

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


Destroy category

DELETE /categories/#{id}

Deletes the category identified by its integer ID.

Response

Returns HTTP status code 200 on success, or any other code (and possibly error information in JSON format) on error. Note that only categories without elements can be deleted.