Skip to Content
Chameleon Docs
API referenceJobs and publishing

Start publish

Publishes the deck for everyone or for its owner, or moves a published deck. On a manual that is unpublished, or published at the visibility sent, this starts a `publish`: the pack is built from the cards and assets as they are saved. A publish needs `cardsVersion`, the version of the cards its caller read and means to publish, which is the number in the cards' ETag: cards saved since are refused with `stale-version`, to be read again first. On a deck published at the other visibility it starts a `change-visibility`: the deck as it is published moves, and the saved cards take no part, so `cardsVersion` is not needed and one sent is not looked at.

POST
/api/manuals/{id}/jobs/publish

Publishes the deck for everyone or for its owner, or moves a published deck.

On a manual that is unpublished, or published at the visibility sent, this starts a publish: the pack is built from the cards and assets as they are saved. A publish needs cardsVersion, the version of the cards its caller read and means to publish, which is the number in the cards' ETag: cards saved since are refused with stale-version, to be read again first. On a deck published at the other visibility it starts a change-visibility: the deck as it is published moves, and the saved cards take no part, so cardsVersion is not needed and one sent is not looked at.

Authorization

headerx-api-key<token>

Scope: manuals:write

Path Parameters

id*string
Match^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

Request Body

application/json
  1. body
visibility*string
Value in"public""private"
cardsVersion?integer

The version of the saved cards to publish, as their ETag gave it. Needed unless the deck is published at the other visibility.

Range1 <= value

Response Body

The job as it stands; poll the job route until it is no longer running

application/json
  1. response
job*|null
Example Request
curl -X POST 'https://www.chameleonlabs.org/api/manuals/string/jobs/publish' \  -H 'Content-Type: application/json' \  -d '{  "visibility": "public"}'
Example Response
{  "job": {    "id": "string",    "kind": "breakdown",    "status": "running",    "startedAt": "2019-08-24T14:15:22Z",    "stoppedAt": "2019-08-24T14:15:22Z",    "error": "string"  }}