COVERITLIVE API - PIN/ORDER (V. 2.0)

The Request

This method allows the display of published pin items to be ordered. There must be at least 2 published pin items to order. Each call must reorder all of the currently published pin items (ie. single item reordering is not supported). The ordering is achieved by passing a json encoded array of the ids and positions of each pin item.

URL:
https://api.coveritlive.com/remote/2/pin/order
Response Formats:
JSON
HTTP Method(s):
POST
API Rate Limited:
false
In addition to the parameters listed in the Request Parameters section, the pin/order method also includes the following parameters:

Parameter Description Required
event_code The event code for the event in which the pin items to be ordered exist. Each CiL event that is created is assigned a unique event code that identifies it in the database - The event owner can find this value after creating a new event, by selecting the "altcast_code" which is found in their Viewer Window embed code (e.g. the event code is "46e6cd22b5" in "altcast_code=46e6cd22b5"). This value is also returned by the event/list API method. yes
order_data

A json encoded array of the published pin item ids, and the positions in which to order them. All of the currently published pin items must be represented, and each position may only be used once. For example, for two published pin items:

[{ "pin_id": 123, "position":1 }, { "pin_id": 456, "position":2 }]

For three published pin items:

[{ "pin_id": 123, "position":1 }, { "pin_id": 456, "position":2 }, { "pin_id": 789, "position":3 }]

yes

The Response

There is no extra data returned from an pin/order request, so the response has the same fields as a general response.

Example response to a successful pin/order request:


{
	"result": "success",
	"message": "true",
	"type": "pin",
	"action": "order",
	"version": 2
}

pin/order Error Responses

A variety of error responses (in addition to the common error responses) to pin/order requests, and instructions on how to rectify them:

result response message response solution
missing_order_data_param Required parameter empty: order_data Ensure the order_data request parameter is present when making a pin/order request.
invalid_pin_order_request Not enough published pin items to order. There must be at least 2 published pin items to order.
invalid_order_data_param The order_data request parameter did not contain a valid value. Ensure the order_data parameter contains 1 JSON object entry per published pin item. Each JSON object must have pin_id and position properties.
invalid_position Not all available positions were represented in the order_data request parameter. Each JSON object in the order_data parameter must contain a position property, and all available positions must be represented. For example, if there are two published pin items, the positions 1 and 2 must be present as the properties of two JSON objects. If there are three published pin items, the positions 1, 2 and 3 must be present as the properties of three JSON objects.
invalid_pin_ids One or more of the pin_ids in the order_data request parameter were invalid. Ensure that the pin_id properties of the objects in the order_data parameter are valid ids for currently published pin items.