I’ve hit a snag with the Platform API while trying to map old Zendesk tickets to new GC interactions.
In Zendesk, we simply appended the ticket ID to the custom field. In GC, I am using the POST /api/v2/interactions endpoint to create a new interaction and link it to an existing conversation. However, I keep getting a 401 Unauthorized error.
Here are the details:
- Endpoint:
POST /api/v2/interactions - SDK Version: Genesys Cloud REST API v2.0
- Auth: OAuth Client Credentials Grant
- Environment: Genesys Cloud US East
I have verified that my OAuth token is valid by successfully calling GET /api/v2/users/me. The token has the interaction:write scope. The payload looks like this:
{
"type": "email",
"direction": "inbound",
"to": [{"id": "agent-id", "name": "Agent Name"}],
"from": {"id": "customer-id", "name": "Customer Name"},
"content": [{"contentType": "text/plain", "content": "Test migration ticket"}]
}
The error response is:
{"code":"unauthorized","message":"Authentication failed"}
Since the token works for user queries, I suspect it might be a specific permission issue with the interaction resource or perhaps a mismatch in how Zendesk ticket IDs are being passed. Has anyone faced similar issues during Zendesk-to-GC migrations? I would love some practical advice on debugging this specific API call. Thanks in advance!