Apollo API Documentation

Cases API calls


List all cases

GET /cases?status=#{status}&page=#{page}

Returns a collection of cases that are visible to the authenticated user. Possible values for “status” parameter can be open or closed (if you don't pass nothing both open and closed cases are returned).

Response

{
	"continued-at":"/cases?status=open&page=2"
	"cases":[
		{
			"id":"65529188",
			"name":"A case",
			"type":"case",
			...
		},
		{
			"id":"78028991",
			"name":"Another case",
			"type":"case",
			...
		},
		...
	]
}

Get single case

GET /cases/#{id}

Returns a single case.

Response

{
	"case":{
		"id":"65529188",
		"name":"A case",
		"type":"case",
		...
	}
}

Create case

POST /cases

Creates a new case with the currently authenticated user as the author. By default, a new case is assumed to be visible to everyone. You can also chose to make the case 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 case (note that the creator id is always included). If the account doesn't allow for more cases to be created, a “507 Insufficient Storage” response will be returned.

Request

{
	"case":{
		"name":"A case",
		"visibility":"public",
		"case-status":"open",
		"attachment":["1672428"],
		"involved-people":["62092502", "52829439"]
	}
}

Response

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

{
	"case-id":"82663335"
}

Update case

PUT /cases/#{id}

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

Request

{
	"case":{
		"visibility":"only-me",
		"attachment":["-1672428", "16977387"]
	}
}

Response

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


Destroy case

DELETE /cases/#{id}

Destroys the given case.

Response

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