Email destination

Hi all,

Is there an API which could be used to update the email destination (the flow it uses in this case) for a specific email address in Genesys?

Hi James,

You can use GET /api/v2/routing/email/domains/{companydomain}/routes to get all of the routes. Then grab the route ID from the response body

{
"entities": [
{
"id": "b948d130-8749-4678-b397-669dc2938a44",
"pattern": "DEMO",
"queue": {
"id": "018a3da2-196e-464c-ba3e-ae39c4a37e8d",
"name": "DEMO",
"selfUri": "/api/v2/routing/queues/018a3XX2-1XXe-4XXc-bXXe-aXX9c4aXXe8d"
},

Then you use the /api/v2/routing/email/domains/{domainName}/routes/{routeId} endpoint to update the email destination.

Thank you, that seems to be exactly what i need.

To update the email destination in the 2nd API i need to get the flow details. I am trying to do this via
/api/v2/flows but it returns a number of IDs per flow. I have tried the obvious oned (including the 1st one returned) but i get the following and I am unsure if i am using the wrong ID or i need to do something else.

"message": "The flow is not eligible for use here.",
"code": "bad.flow.id",
"status": 400,
"contextId": "2a2c1048-a1e7-4518-aede-5f4f009f2d09",
"details": [],
"errors": []

Any help is appreciated

Hi James,

The /api/v2/flows call will return a list of all of the flows in your system. You either need to paginate through all of the records and look for the flow name and type that match the flow you are trying to update your route to. (Flow name and flow type are unique). Or you can pass in as query parameters the name and type to retrieve the record. Once you have the record you can grab the id field on the returned record and use that to update the route.

So if you want to grab a record for a flow called EmailAWSComprehendFlow and of type inboundemail you would use the following call:

GET /api/v2/flows?type=inboundemail&name=EmailAWSComprehendFlow

Just keep in mind that you have to use name and type because Genesys Cloud allows you to use the same name for flow across multiple flow types.

Hope that helps.

Thanks,
John Carnell
Manager, Developer Engagement

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