Apollo API Documentation

Deal categories API calls


Get categories

GET /dealCategories

Returns all categories.

Response

{
	"categories":[
		{
			"id":"14922807",
			"name":"Assets",
			...
		},
		{
			"id":"62098509",
			"name":"Copywriting",
			...
		},
		...
	]
}

Get category

GET /dealCategories/#{id}

Returns a single category identified by its integer ID.

Response

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

Create category

POST /dealCategories

Creates a new category.

Request

{
	"category":{
		"name":"Code",
		"color":"#FFFFFF"
	}
}

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":"20195810"
}

Update category

PUT /dealCategories/#{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 /dealCategories/#{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.