new GenesysAPI().PostConversationsEmailMessages(conversationId, emailMessage);
I get token the same way that I do for other services:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11;
CreateCallbackResponse result = new CreateCallbackResponse();
PureCloudPlatform.Client.V2.Client.Configuration.Default.ApiClient.setBasePath(PureCloudRegionHosts.eu_west_1);
var accessTokenInfo = PureCloudPlatform.Client.V2.Client.Configuration.Default.ApiClient.PostToken("MyIdClient", "MySecretClient");
But in this case, I get an ERROR 403 Response:
{
"message": "User is not an active communication on the conversation.",
"code": "postino.error.forbidden",
"status": 403,
"messageWithParams": "User is not an active communication on the conversation.",
"messageParams": {},
"contextId": "0a267f6d-08e9-45bb-be39-d982cd00e86d",
"details": [],
"errors": []
}
If I get a token from some call in https://apps.mypurecloud.de/ (Chrome > DevTools > Network) and I hardcode it, then call works correctly.
It means that this API Endpoint must be invoked with an access/authorization token associated with a user who is an active participant in the conversation.
I mean that the token you get must be obtained by a user who is an active participant in the conversation - with an OAuth Grant flow like Implicit Grant flow, Authorization Code Grant, PKCE Grant or SAML2 Bearer Grant.
I think you are missing what OAuth Grant flows and Authorization relate to.
In order to get an access token, you'll select one of the OAuth Grant types (Implicit, Client Credentials, ...).
Requesting a user oriented access token (with implicit, or authorization code, ...) implies that the user will authenticate on a Genesys Cloud Login web page.
You can check this: https://developer.genesys.cloud/authorization/platform-auth/ for more info on the different Grant Types.
Once you have decided which grant type you want to use, you will define/create an OAuth Client with the corresponding Grant Type (Client Credentials, Code Authorization, Token Implicit Grant, ...).
And you will invoke the corresponding OAuth Grant type flow. For Authorization Code, see:
Thanks for that info, I have been reading and I understand this system a bit more now. But it means to make changes that we may not do.
Is there any way to let any user to reply an email? We need that any user can reply any email at any moment, it includes agents that does not have this email in a queue.
As far as I know, the user must be a participant in the conversation to reply.
So it will not be possible with a Client Credentials Grant token - no user context.
For other user oriented grants (Implicit Grant, Authorization Code Grant, ...), the user would first need to retrieve the email (transferring the email from the queue/other user to the user who will be replying).
I've created a new Authorization Code Grant Oauth client and uploaded framework.js file with the new client id (replacing the current Implicit Grant that embeddedframework uses).
I set dedicatedLoginWindow to false in the query, to have access to the ?code= at the response.
You seem to be asking a different question (on Embeddable Framework) than your original one (on Platform API .Net SDK).
The Genesys Embeddable Framework only supports OAuth Implicit Grant (public deployments, private deployments with User.getAuthToken).
In Create an OAuth client page - select "Genesys Cloud Embeddable Framework" tab.