I saw the Platform API Client SDK - JavaScript in the developer center but I couldn't adapt it to be used in a simple tompermonkey (for demo).
I was wondering if anyone has an example of code in Javascript (without html) of how we call Genesys Cloud APIs.
(The purpose here is to request the number of agents available in a specific queue before poping up the launcher of web messaging).
I used the launcher plugin events and commands to control the pop up but I still can't find how I can Iimplement the API request to get the number of available agents.
I wouldn't use this for production because it exposed a client id and client secret, which essentially is a username and password that would give someone access to make API requests against your org, but for a tampermonkey demo you can use a Client Credentials grant to get an access token: https://developer.genesys.cloud/api/tutorials/oauth-client-credentials/#language=nodejs&step=0