Legacy Dev Forum Posts

 View Only

Sign Up

Update ringnumber for multiple queues

  • 1.  Update ringnumber for multiple queues

    Posted 06-05-2025 18:02

    narodel | 2020-04-07 08:52:24 UTC | #1

    Hi,

    I have the following code:

    if(window.location.hash) { console.log(location.hash); var token = getParameterByName('access_token'); fetch('https://api.mypurecloud.de/api/v2/routing/queues/QueueID/users/UserID', { headers: { "Authorization": 'bearer ' + token, "Content-type": "application/json; charset=UTF-8" }, method: 'PATCH', body: JSON.stringify({ "id": "UserID", "ringNumber": 5, }) });

    This works as intended and updates the ringnumber for that specific queue and user to 5.

    However, I want to achieve this for 6 different queues at the same time (with 1 click). Is this possible?


    Jerome.Saint-Marc | 2020-04-07 12:31:23 UTC | #2

    Yes, it is possible. You can "click" one time and trigger a function/code that will make 6 API calls. What I mean is that you need to run the same request 6 times. There are different ways to chain request (javascript). You can see here for different examples: https://medium.com/@wisecobbler/using-the-javascript-fetch-api-f92c756340f0 As an example, using Promise.all() (at the bottom of the page).


    system | 2020-05-08 12:39:29 UTC | #3

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 7496