Riko80 | 2023-02-23 14:44:38 UTC | #1
Hi,
I have developed an api in .Net to send an agentless whatsapp based on the sdk code provided in the Genesys cloud documentation, but I have an error message whereas normally we have already validated the "auto_replay" template at Genesys below is my .Net code
public string Get(int id) {
string basePath = "/api/v2/conversations/messages/agentless"; PureCloudRegionHosts region = PureCloudRegionHosts.euwest1; // Genesys Cloud region
PureCloudPlatform.Client.V2.Client.Configuration.Default.ApiClient.setBasePath(region); var accessTokenInfo = PureCloudPlatform.Client.V2.Client.Configuration.Default.ApiClient.PostToken("692cf986-2a7d-4df6-9dc7-6bd7a95fff4f", "Eom0X83pVROeFQ9DB1UhZlTPXol7BfIVSVa_ycbTcwY", "https://apps.mypurecloud.ie"); string accessToken = accessTokenInfo.AccessToken; PureCloudPlatform.Client.V2.Client.Configuration.Default.AccessToken = accessToken; try {
// Instantiate APIs ConversationsApi conversationsApi = new ConversationsApi();
// Build request body SendAgentlessOutboundMessageRequest request = new SendAgentlessOutboundMessageRequest(); request.FromAddress = "81ff9d2a-a865-48b2-bb3e-7c4fbe0a14b0"; request.ToAddress = "212XXXXXXXXXX"; request.MessagingTemplate = new MessagingTemplateRequest(); MessagingTemplateRequest req = new MessagingTemplateRequest(); req.ResponseId = "auto_replay"; request.MessagingTemplate.ResponseId = req.ResponseId.ToString();
request.ToAddressMessengerType = SendAgentlessOutboundMessageRequest.ToAddressMessengerTypeEnum.Whatsapp; request.UseExistingActiveConversation = false;
// Call to PostConversationsMessagesAgentless function of Conversations API SendAgentlessOutboundMessageResponse response = conversationsApi.PostConversationsMessagesAgentless(request);
// Final Output //Console.WriteLine(response.ToString()); return response.ToString(); } catch (Exception e) { // Debug.Print("Exception when calling Conversations.PostConversationsMessagesAgentless: " + e.Message);
return "exception" + e.Message; } }
Below the error message :
exceptionError calling PostConversationsMessagesAgentless: {"message":"No Response could be found with an id of autoreplay","code":"not.found","status":404,"messageWithParams":"No {type} could be found with an id of {id}","messageParams":{"id":"autoreplay","type":"Response"},"contextId":"2ed9d520-0c42-4af2-9c5d-31a0a7b637ed","details":[],"errors":[]}
the "auto_replay" template validated by Genesys and created in the predefined responses section
Can you bring me a solution on what can be a problem? Regards
Riko80 | 2023-02-28 14:30:53 UTC | #2
Hi, Any update please? Regards
tim.smith | 2023-02-28 14:35:48 UTC | #3
The response ID requires the ID of a response, not its name. You can retrieve responses using GET /api/v2/responsemanagement/responses.
Riko80 | 2023-03-03 07:16:20 UTC | #4
@tim.smith, thank you for your update, I replaced the name with the id but I still have the same error (instead of the name it shows me the id can we make a zoom point please, to explain my need? because I can't find a solution since 1 month I try and it doesn't work my need is send an agentless whatsapp message, I followed the documentation and I took the SDK .net code that I tried to develop in Visual studio but each time I have an error
Regards
tim.smith | 2023-03-03 15:42:29 UTC | #5
Riko80, post:4, topic:18555
can we make a zoom point please, to explain my need?
Yes, Genesys offers consultation services! Direct 1 on 1 consultation can be hired from Genesys Cloud Professional Services. If you need assistance getting in touch with your sales rep to kick off an engagement, let me know and I can have someone reach out to you.
system | 2023-04-03 15:42:43 UTC | #6
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 18555