0
votes

Tried doing a worker.update(...), worker.completeTask(...) and always getting a CORS error from localhost.

enter image description here

1

1 Answers

0
votes

Try adding this Policy to your back end. There is apparently a "bug" in the example code that Twilio provides and it has yet to be fixed.

This code is assuming a Node backend but the equivalent should work in any language

// Worker Activity update policy
new Policy({
    url: util.workersUrl(workspaceSid, workerSid),
    method: 'POST',
    postFilter: {ActivitySid: {required: true}},
    allow: true,
  })