Send email to outside server

Greetings,

I am looking into a way to send an email from Genesys to either our support queue OR to our department inbox that resides on our email server. I have tried the agentless api. this always results in an error. I have also tried to send the email to our support queue which almost works. It arrives at the queue but never shows the email.

I am trying to explore both options to use in conjunction with each other (for redundancy), but if we can figure out the support queue one, that would work for the time being. when I submit the one using /api/v2/conversations/emails, I use the following

{
   "queueId": "756bdc69-10ab-4876-8b8a-6f347a5f6f8e",
   "skillIds": ["4e4160f9-8d5e-4a0b-8388-7b37bf527281"],
   "toAddress": "Workforce@MyCompany.pure.cloud",
   "toName": "Workforce@MyCompany.pure.cloud",
   "fromAddress": "Workforce@MyCompany.pure.cloud",
   "fromName": "Workforce@MyCompany.pure.cloud",
   "subject": "Test Message",
   "direction": "OUTBOUND",
   "htmlBody": "This is a test",
   "textBody": "This is a test"
}

This works when running it in the dev tools, but when I bring it over to .NET, it gives the following error

Error calling PostConversationsEmails: 
{
   "message":"This request requires a user context. Client credentials cannot be used for requests to this resource.",
   "code":"not.a.user",
   "status":400,
   "contextId":"389b8999-c7bc-49d9-b1be-dd991f8cc6f6",
   "details":[],
   "errors":[]
}

I have spent several hours to get this this point. If anyone can point me in the right directions, that would be fantastic.

Thanks!!!

Hi Nicholas,

The best option will be to use AgentLess API . Let us know what was not working when you try.

Regarding the endpoint you used, couple of comments :

  • to & from address can't be the same. The system will consider it as a loop and close it
  • from address should be the one configure on the queue
  • you need to be authentified as an Genesys Cloud user and pass auth details in the request

I hope it's help

regards

I am now trying the agentless (/api/v2/conversations/emails/agentless), Here is my body:

{
  "senderType": "Outbound",
  "fromAddress": {
    "email": "Workforce@MyCompany.pure.cloud"
  },
  "toAddresses": [
    {
      "email": "MyFirst.MyLast@MyCompany.org"
    }
  ],
  "subject": "This is a test",
  "textBody": "test"
}

This gives me the following error

Error calling PostConversationsEmailsAgentless: 
{
  "message":"The outbound domain does not exist",
  "code":"postino.error.not.found",
  "status":404,
  "messageWithParams":"The outbound domain does not exist",
  "messageParams":{},
  "contextId":"2299c0fa-892b-4541-aec4-56ee6f74b563",
  "details":[],
  "errors":[]
}

I did verify that Workforce@MyCompany.pure.cloud is a valid email address. I also tried creating an email to use for sending emails and got the same error:

{
  "senderType": "Outbound",
  "fromAddress": {
    "email": "OutboundEmails@MyCompany.pure.cloud"
  },
  "toAddresses": [
    {
      "email": "Workforce@MyCompany.pure.cloud"
    }
  ],
  "subject": "This is a test",
  "textBody": "test"
}

Hi @Nicholas_Armaline,

In order to use the Agentless email API, you need to provision an outbound subdomain in Genesys Cloud under the Campaign/Agentless type.
image

Fore more detailed instructions, please refer to the following resource : Set up a domain for outbound email campaigns and agentless email notifications.

Once the subdomain is validated, you can use it in the From field along with the local part of an email address (example: Workforce@my.example.com).

The error message you are currently encountering indicates that no domain has been configured in your Genesys Cloud organization.

Please note that the Agentless API does not function with Genesys Cloud as the domain type, as is the case with your example: Workforce@Mycompany.pure.cloud

I hope that helps :slight_smile:

Best Regards,

Charaf

I don't think that will be an option unfortunately. Is there any other way I can trigger a email/message/anything to a queue? We are creating a system that is gonna send event triggered messages to our queue.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.