Skip to content

Preview swap acceptance

POST
/v1/rotations/{rotationId}/swap-requests/{requestId}/accept/preview
curl --request POST \
--url https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/accept/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json-patch+json' \
--data '{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ] }'

Requires a Slack member access token and the current request revision in expectedRevision. Returns conflicts and the rotation ETag without accepting the request. Review the conflicts before acknowledging them in the acceptance request.

rotationId
required
string
requestId
required
string

The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.

object
operationId

A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.

string
expectedRevision

The request revision reviewed by the caller.

integer | string format: int64
/^-?(?:0|[1-9]\d*)$/
acknowledgedConflictIds

Current conflict identifiers acknowledged for the interval this caller would receive.

Array<string>
acknowledgedStartedLegKeys

Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.

Array<string>
Examplegenerated
{
"operationId": "example",
"expectedRevision": 1,
"acknowledgedConflictIds": [
"example"
],
"acknowledgedStartedLegKeys": [
"example"
]
}

OK

Media typeapplication/json

The proposed assignments and whether conflict acknowledgments and remaining-time consent permit proceeding.

object
legs
required
Array<object>

One proposed assignment and its conflicts. canAcknowledge identifies conflicts this caller may acknowledge. When hasStarted is true, from and to describe the remaining time; accepting requires its key in acknowledgedStartedLegKeys.

object
key
required
string
assigneeUserId
required
string
from
required
string format: date-time
to
required
string format: date-time
conflicts
required
Array<object>

A conflict or an uncertainty affecting the proposed assignment.

object
id
required

The acknowledgment identifier for this conflict and the previewed terms.

string
type
required

absence, sameCellArrangement or unknownAvailability.

string
userId
required

The affected person’s Slack user identifier.

string
from
required

The inclusive UTC start of the conflict intersection with the requested interval.

string format: date-time
to
required

The exclusive UTC end of the conflict intersection with the requested interval.

string format: date-time
source
required

arrangement, manualAvailability, googleCalendar or slackStatus.

string
canAcknowledge
required

Whether explicit acknowledgment permits proceeding with this conflict. False means the conflict blocks the write.

boolean
canAcknowledge
required
boolean
acknowledged
boolean
hasStarted
boolean
canProceed
required
boolean
Example
{
"legs": [
{
"acknowledged": false,
"hasStarted": false
}
]
}