Running into a weird auth issue with Studio handovers to NICE Cognigy voicebots. The initial bot interaction works fine, but when I try to pass context back to the bot after a human agent interaction, the GetRESTProxy call fails with a 401 Unauthorized.
Here’s the snippet:
ASSIGN rest = GetRESTProxy("CognigyAPI")
ASSIGN payload = {"sessionId": "{{session.id}}", "context": {"agentName": "{{user.name}}"}}
ASSIGN response = rest.post("/api/v1/sessions/{{session.id}}/handover", payload)
The proxy is configured with the correct endpoint and API key. I can hit this endpoint directly from Postman using the same key, so it’s not a credential issue. The error log shows:
Error: 401 Unauthorized
Message: Invalid or expired token
The session ID is definitely valid. I’ve checked the Cognigy logs and they show the initial bot session was created correctly. The problem seems to be that the Studio session isn’t passing the right auth header to the Cognigy API. I’ve tried adding the Authorization header manually in the proxy config, but that didn’t help.
Is there a specific way to handle auth for handovers in Studio? Or is this a known issue with the Cognigy integration? Any help is appreciated.