Preview swap acceptance
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/accept/preview"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"operationId\": \"example\", \"expectedRevision\": 1, \"acknowledgedConflictIds\": [ \"example\" ], \"acknowledgedStartedLegKeys\": [ \"example\" ] }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json-patch+json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/accept/preview"
payload := strings.NewReader("{ \"operationId\": \"example\", \"expectedRevision\": 1, \"acknowledgedConflictIds\": [ \"example\" ], \"acknowledgedStartedLegKeys\": [ \"example\" ] }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>") req.Header.Add("Content-Type", "application/json-patch+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json-patch+json");RequestBody body = RequestBody.create(mediaType, "{ \"operationId\": \"example\", \"expectedRevision\": 1, \"acknowledgedConflictIds\": [ \"example\" ], \"acknowledgedStartedLegKeys\": [ \"example\" ] }");Request request = new Request.Builder() .url("https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/accept/preview") .post(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json-patch+json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'POST', url: 'https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/accept/preview', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'}, data: '{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ] }'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.roundrobinbot.eu/v1/rotations/example/swap-requests/example/accept/preview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json-patch+json'}, body: '{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ] }'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.
object
A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.
The request revision reviewed by the caller.
Current conflict identifiers acknowledged for the interval this caller would receive.
Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.
Examplegenerated
{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ]}The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.
object
A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.
The request revision reviewed by the caller.
Current conflict identifiers acknowledged for the interval this caller would receive.
Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.
Examplegenerated
{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ]}The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.
object
A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.
The request revision reviewed by the caller.
Current conflict identifiers acknowledged for the interval this caller would receive.
Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.
Examplegenerated
{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ]}The reviewed request revision, conflict acknowledgments and remaining-time consent for a swap response.
object
A caller-generated identifier of at most 128 characters. Reuse it only for an identical retry.
The request revision reviewed by the caller.
Current conflict identifiers acknowledged for the interval this caller would receive.
Keys of started intervals whose remaining time the recipient agrees to exchange. Include every preview leg with hasStarted set to true when accepting.
Examplegenerated
{ "operationId": "example", "expectedRevision": 1, "acknowledgedConflictIds": [ "example" ], "acknowledgedStartedLegKeys": [ "example" ]}Responses
Section titled “Responses”OK
The proposed assignments and whether conflict acknowledgments and remaining-time consent permit proceeding.
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
A conflict or an uncertainty affecting the proposed assignment.
object
The acknowledgment identifier for this conflict and the previewed terms.
absence, sameCellArrangement or unknownAvailability.
The affected person’s Slack user identifier.
The inclusive UTC start of the conflict intersection with the requested interval.
The exclusive UTC end of the conflict intersection with the requested interval.
arrangement, manualAvailability, googleCalendar or slackStatus.
Whether explicit acknowledgment permits proceeding with this conflict. False means the conflict blocks the write.
Example
{ "legs": [ { "acknowledged": false, "hasStarted": false } ]}