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.eu_west_1; // 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 auto_replay","code":"not.found","status":404,"messageWithParams":"No {type} could be found with an id of {id}","messageParams":{"id":"auto_replay","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