Set Routing

Create routing definitions

Resource

https://api.infobip.com/ccaas/routing

Body Params

Property name Type Description
name string  
queueId string  
priority string URGENT, HIGH, NORMAL, LOW
enabled boolean TRUE, FALSE
expression mixed  

Request Example

					PUT /ccaas/1/routing HTTP/1.1
Host: api.infobip.com
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Accept: application/json

[
    {
        "name": "English Support",
        "queueId": "8772F93BC855D00A1036B771ACA7EC40",
        "priority": "NORMAL",
      	"enabled": true,
        "expression": {
            "$or": [
                {
                    "$eq": {
                        "customer.country": "United Kindom"
                    }
                },
                {
                    "$eq": {
                        "customer.country": "Australia"
                    }
                }
            ]
        }
    },
    {
        "name": "Spanish Support",
        "queueId": "A1C93E138A8D831F49D047BC0A5B1D0D",
        "priority": "NORMAL",
      	"enabled": true,
        "expression": {
            "$in": {
                "customer.country": [
                    "Spain",
                    "Columbia",
                    "Mexico"
                ]
            }
        }
    },
    {
        "name": "Croatian Support",
        "queueId": "04FAFF86C252478D324CF3F980799C9E",
        "priority": "NORMAL",
      	"enabled": true,
        "expression": {
            "$and": [
                {
                    "$starts_with": {
                        "message.customerNumber": "385"
                    }
                },
                {
                    "$neq": {
                        "message.channel": "FACEBOOK_MESSENGER"
                    }
                }
            ]
        }
    },
    {
        "name": "Keyword STOP",
        "queueId": "1E54701F74BD86A070B43DB49478D82C",
        "priority": "NORMAL",
      	"enabled": true,
        "expression": {
            "$starts_with": {
                "message.content": "STOP"
            }
        }
    }
]
					
				

Response

					{
    "statusCode": "SUCCESS",
    "message": "Routing added successfully."
}
					
				
					{
    "statusCode": "ERROR",
    "message": "Required request body is missing or not valid"
}
					
				

Set routing create new routing set of rules replacing the previous set. Actually, before setting new routing, old routing is deleted. 

 

Parameters

Property name Type Description
name string Rule name, light description of expression logic, 255 characters max.
queueId string Queue ID is a destination queue where the new message will be assigned to.
priority URGENT, HIGH, NORMAL, LOW The priority of the new message. If not provided will be set to default. Default is NORMAL.
enabled boolean Enabled is a boolean value (TRUE, FALSE), so the rule is engaged or avoided in the routing process. If not provided will be set to default. Default is TRUE.
expression object Querry for logical validation of new messages. See Routing for more info. 255 characters max.

Routing order

Order of rules inside routing is essential for proper routing, as rules are matching in provided order. First rule matching message will be used.