API ReferenceContext Repository
Get staged ops
Returns whole ops of the open changeset, bodies included, for the ids you name.
GET /context/v1/changeset/ops
Returns whole ops of the open changeset, bodies included, for the ids you name. Use it to read what GET changeset leaves out: an upsert's content and the value of a patch's edit. Ops come back in the order you asked for them. Name at most 100 ids; more is a 422. An id that names no op of the open changeset is a 404 naming it, so a missing body is never returned as an empty one.
Requires the context:read scope.
Parameters
| Parameter | Location | Required | Description |
|---|---|---|---|
ids | query | yes | The op ids to read, comma-separated, from 1 to 100 of them, as GET changeset lists them. |
Responses
| Status | Meaning |
|---|---|
200 | The request succeeded. |
401 | The token is missing, expired or invalid. |
403 | The token does not carry the scope this operation requires. |
404 | No such project, or the token belongs to a different project. |
422 | The request was not valid: a parameter or the body failed validation. |
The 200 response body:
| Field | Type | Required | Description |
|---|---|---|---|
ops | array of ChangesetOp | yes | The ops asked for, in the order their ids were given, each with its full body. |
Shapes
The named shapes used above.
ChangesetOp
One staged op and what has been decided about it.
| Field | Type | Required | Description |
|---|---|---|---|
carried_from | string or null | no | The changeset the op was carried over from, if it was. |
carried_to | string or null | no | The changeset the op was carried over to, if it was. |
cascaded_from | string or null | no | The op whose rejection caused this one to be rejected, if any. |
conflict | string or null | no | Why the op cannot merge as it stands, when something it depends on has moved; null otherwise. |
decided_at | string or null | no | When it was decided. |
decided_by | object or null | no | Who decided and why, once someone has; null while the op is undecided. |
decision | string | yes | Where review stands: undecided, approved or rejected. |
decision_history | array of object | yes | Every decision made about the op, oldest first. |
op | object | yes | The op as it was sent; its op field names the kind. GET changeset leaves out an upsert's content and the value of a patch's edit, which GET changeset/ops returns. |
op_id | string | yes | The id the service assigned when the op was staged. Use it to remove the op. |
reason | string or null | no | The reason given for a rejection. |
review_key | string | yes | Groups the ops a reviewer decides together. |
seq | integer | yes | The op's position in the changeset, in staging order. |
staged_at | string | yes | When the op was staged. |
staged_by | object | yes | Who staged it and why. |
status | string | yes | The op's state in the changeset. |
Example
curl -sS "$API_URL/context/v1/changeset/ops?ids=$IDS" \
-H "Authorization: Bearer $TOKEN"