Hi,
I'm trying to automate a process that causes us some issues. We upload new outbound campaign contact lists each day. If the campaign doesn't stop correctly the night before, the upload process fails. This is usually because an agent still has a preview interaction open - so the campaign gets stuck in "Stopping" mode, and we use "Force Stop" (manually) on the campaign.
I want to instead schedule a Powershell script that will use the GC CLI to loop through our campaigns and if necessary, stop them.
It seems that there is no way to directly force stop a campaign from the API - just using outbound campaigns stop create <id> will just put them into the "Stopping" state, the same as always.
So, instead, the workaround would be to get the list of active interactions on the campaign, then call conversations calls update <id> and change the status to Disconnected, so the campaign can then be stopped.
However, I'm authenticating the CLI through Client Credentials, so if I try to update the conversation status, I get:
{
"message": "This request requires a user context. Client credentials cannot be used for requests to this resource.",
"code": "not.a.user",
"status": 400,
"contextId": "fb78394d-30d7-4e08-abdb-008344656a3b",
"details": [],
"errors": []
}
My question is, is there no way round this? The "expected" solution is to have the CLI launch a login page and log in to authenticate - which then defeats the purpose of automating it through the CLI. This is meant to run unmanaged to alleviate work for us (for me).
#PlatformCLI------------------------------
James Dunn
Telecoms Specialist
------------------------------