cURL
curl -X POST "https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/reviews/wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz/answer" \
-H "Authorization: Bearer $WORKLAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"answers": {
"carrier": {
"optionIds": [
"ups"
]
}
}
}'const response = await fetch('https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/reviews/wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz/answer', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"answers": {
"carrier": {
"optionIds": [
"ups"
]
}
}
}),
});
const data = await response.json();
console.log(data);{
"requestId": "wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz",
"workerId": "6f1c2a9e-4b7d-4e2a-9c51-3d8e0b7a1f24"
}{
"statusCode": 400,
"message": "Invalid answers.",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 402,
"message": "Worker admission denied."
}{
"statusCode": 404,
"message": "Request not found.",
"error": "Not Found"
}{
"statusCode": 409,
"message": "Request has changed.",
"error": "Conflict"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Review
Answer a question
Submits answers for a pending question Review, keyed by question ID, resuming the waiting Worker.
POST
/
v1
/
rooms
/
{roomId}
/
reviews
/
{requestId}
/
answer
cURL
curl -X POST "https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/reviews/wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz/answer" \
-H "Authorization: Bearer $WORKLAYER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"answers": {
"carrier": {
"optionIds": [
"ups"
]
}
}
}'const response = await fetch('https://api.myworklayer.com/v1/rooms/cmhx3q7v20004l808sd5k2r1m/reviews/wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz/answer', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WORKLAYER_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"answers": {
"carrier": {
"optionIds": [
"ups"
]
}
}
}),
});
const data = await response.json();
console.log(data);{
"requestId": "wr1.Y2x4Mmh0cTlrMDAwMQ.2.Qm9vVGF0Y2hlcy1maW5nZXJwcmludC1leGFtcGxlXzQz",
"workerId": "6f1c2a9e-4b7d-4e2a-9c51-3d8e0b7a1f24"
}{
"statusCode": 400,
"message": "Invalid answers.",
"error": "Bad Request"
}{
"statusCode": 401,
"message": "Unauthorized"
}{
"statusCode": 402,
"message": "Worker admission denied."
}{
"statusCode": 404,
"message": "Request not found.",
"error": "Not Found"
}{
"statusCode": 409,
"message": "Request has changed.",
"error": "Conflict"
}{
"statusCode": 429,
"message": "ThrottlerException: Too Many Requests"
}Authorizations
Your factory's Worklayer API key (wrk-...). See Get an API key and Authentication. Requests sent from the playground execute live against your factory.
Path Parameters
Body
application/json