Since we are using our OAuth's client ID and client secret, we are not allowed to use it and seeing this error on response:
{
"message": "This request requires a user context. Client credentials cannot be used for requests to this resource.",
"code": "not.a.user",
"status": 400,
"contextId": "22c14afd-c570-461b-aeaa-6667b9228280",
"details": [],
"errors": []
}
The reason is clear and understandable in the response message, but this is a crucial part of our project and we'd like to know if it's possible to call this API, using .NET SDK.
This has nothing to do with the .NET SDK but rather the API endpoint. The API requires a user context (e.g. from a user logged in with a method other than the OAuth Client credential grant.). I recommend you look at our Ideas portal and register for the request. The product manager for the service in question looks at these requests and then works with the internal development teams to evaluate them.
Hi, thank you. Actually I know what you said, the reason why I opened this case is to see if there is any other way to use this API, and other APIs that requires user context, in .NET with authorization other than client credentials. Is it possible to use OAuth types such as Code Authorization, Token Implicit Grant or SAML2 Bearer?
I'm not sure if my question is relevant and sorry if it's not. Since this API is crucial to be used in our CRM, I'm trying to find a solution.
We provide examples of how to connect using an implicit grant. Once you have authenticated you need to set the Configuration.AccessToken field on the APIClient and you should be good to go. The implicit grant does require a callback URL in your application that Genesys Cloud can call back into with the auth token once you have authenticated with Genesys.
You should be good to go because three other authentication mechanisms (Code Authorization, Token Implicit Grant or SAML2 Bearer) all provide a user-context on the token.,
Thanks,
John Carnell
Director, Developer Engagement