{"message":"This request requires a user context. Client credentials cannot be used for requests to this resource.","code":"not.a.user","status":400,"contextId":"53073ec3-fe9f-4194-9209-5d366f704dc0","details":[],"errors":[]}
I am logged into Genesys within SF when executing the above statement.
How would I use the SF SDK to call the API to get the information I need?
It appears you are calling the REST endpoint with an OAuth token obtained with a client credential grant. The endpoint is rejecting it because it needs the OAuth token from a user token and not a client credential grant.
You have to use any of the OAuth grants that aren't client credentials: https://developer.genesys.cloud/authorization/platform-auth/. I'm not familiar with how Apex' architecture works, so I'm not sure which grant is most appropriate. There are descriptions at that link that describe which method is best suited for various architectures.
What SDK is this? Can you link me to docs for it? I don't recognize this.
@Mike_Sobczak I tracked down what SDK you're using: SDK in Genesys Cloud for Salesforce - Genesys Cloud Resource Center. This SDK only supports client credentials, which are unable to make API requests that require a user context. You will need to build a custom integration using one of the auth grants from my previous link that's not client credentials to be able to make those requests with a user context. Those flows will require that the user complete an OAuth flow in their browser.
the above illustration, it seems to me as if that is using auth via the implicit grant from the integraiton. therefore, we can use the users' auth wherever we like on a salesforce page, no?
The embeddable framework uses user-based auth, yes. If that product meets your needs, feel free to use it. My answer above was only about the SDK referenced in the original post.