Apollo API Documentation

Links API calls


Get links

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

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

Response

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

Get link

GET /links/#{id}

Returns a single link record identified by its integer ID.

Response

{
	"link":{
		"id":"61755784",
		"title":"Link 1",
		...
	}
}

Get links by category

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

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

Response

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

Create link

POST /projects/#{project_id}/links

Creates a new link, optionally sending notifications to a selected list of people.

Request

{
	"link":{
		"category-id":"51524282",
		"title":"New link",
		"description":"This is a <strong>new</strong> link",
		"code": "http://www.apollohq.com/",
		"is-private":"1",
		"subscribers":["14505968", "4748932", "7574837"]
	}
}

Response

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

{
	"link-id":"140104985"
}

Update link

PUT /links/#{id}

Updates an existing link, optionally sending notifications to a selected list of people.

Request

{
	"link":{
		"title":"Updated link",
		"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 link

DELETE /links/#{id}

Destroys the given link 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.