Riferimento API delle regole di instradamento

Valori possibili per i campi

Tipo di azione

ValoreDescrizione
NOTIFY_TEAMAvvisa un team specifico
NOTIFY_WORKSPACE_MEMBERAvvisa un membro specifico del workspace
NOTIFY_CURRENT_ON_CALL_USERAvvisa la persona reperibile attuale
NOTIFY_NEXT_ON_CALL_USERAvvisa la prossima persona reperibile
NOTIFY_ALL_ON_CALL_MEMBERSAvvisa tutti i membri attualmente reperibili

Tipo di asserzione

ValoreDescrizione
IMPACTVerifica l'impatto di un evento
TITLEVerifica il titolo di un evento
DESCRIPTIONVerifica la descrizione di un evento
AFFECTED_COMPONENTSVerifica i componenti interessati da un evento

Tipi di confronto

ValoreDescrizione
EQUALSVerifica se il valore è uguale
NOT_EQUALSVerifica se il valore è diverso
IS_EMPTYVerifica se il valore è vuoto
NOT_EMPTYVerifica se il valore non è vuoto
GREATER_THANVerifica se il valore è maggiore
GREATER_THAN_OR_EQUALSVerifica se il valore è maggiore o uguale
LESS_THANVerifica se il valore è minore
LESS_THAN_OR_EQUALSVerifica se il valore è minore o uguale
CONTAINSVerifica se il valore contiene una data sottostringa
NOT_CONTAINSVerifica se il valore non contiene una sottostringa
HAS_KEYVerifica se un oggetto ha una chiave specifica
NOT_HAS_KEYVerifica se un oggetto non ha una chiave specifica
HAS_VALUEVerifica se un oggetto ha un valore specifico
NOT_HAS_VALUEVerifica se un oggetto non ha un valore specifico
IS_NULLVerifica se il valore è null
NOT_NULLVerifica se il valore non è null
STARTS_WITHVerifica se il valore inizia con una data sottostringa
ENDS_WITHVerifica se il valore termina con una data sottostringa

Ottenere le regole di instradamento

Endpoint:

GET /:page_id/routing-rules

Esempio di richiesta

GET /1/routing-rules

Esempio di risposta

{
"routingRules": [
{
"id": "1",
"siteId": "pageId",
"assertions": [
{
"id": "1",
"routingRuleId": "1",
"type": "TITLE",
"comparison": "CONTAINS",
"value": "value1"
},
{
"id": "2",
"routingRuleId": "1",
"type": "TITLE",
"comparison": "CONTAINS",
"value": "value2"
}
],
"actions": [
{
"id": "1",
"routingRuleId": "1",
"type": "NOTIFY_WORKSPACE_MEMBER",
"targetId": "value1"
},
{
"id": "2",
"routingRuleId": "1",
"type": "NOTIFY_WORKSPACE_MEMBER",
"targetId": "member@platform.com"
}
],
"createdAt": "2021-09-29T00:00:00.000Z",
"updatedAt": "2021-09-29T00:00:00.000Z",
"order": 1
}
]
}

Creare una regola di instradamento

Endpoint:

POST /routing-rules

Tieni presente che nelle azioni targetId può essere l'email di un membro del workspace o l'id di un team, a seconda del tipo di azione.

Esempio di richiesta

{
"routingRule": {
"assertions": [
{
"id": "1",
"routingRuleId": "1",
"type": "TITLE",
"comparison": "CONTAINS",
"value": "value1"
},
{
"id": "2",
"routingRuleId": "1",
"type": "TITLE",
"comparison": "CONTAINS",
"value": "value2"
}
],
"actions": [
{
"id": "1",
"routingRuleId": "1",
"type": "NOTIFY_WORKSPACE_MEMBER",
"targetId": "member2@platform.com"
},
{
"id": "2",
"routingRuleId": "1",
"type": "NOTIFY_WORKSPACE_MEMBER",
"targetId": "member@platform.com"
}
],
"order": 1,
"siteId": "site-id-1"
},
"message": "Routing rule updated successfully"
}

Esempio di risposta

{
"routingRule": {
"id": "routing-rule-id-1",
"order": 1,
"siteId": "site123",
"updatedAt": "2021-09-01T12:00:00Z",
"createdAt": "2021-09-01T12:00:00Z"
},
"message": "Routing rule created successfully."
}

Aggiornare una regola di instradamento

Endpoint:

PUT /routing-rules/:id

Esempio di richiesta

PUT /routing-rules/routing-rule-id-1
{
"routingRule": {
"id": "routing-rule-id-1",
"assertions": [
{
"id": "assertion-id-1",
"routingRuleId": "routing-rule-id-1",
"comparison": "CONTAINS",
"value": "Issue With X",
"type": "TITLE"
}
],
"order": 1,
"siteId": "site-id-1",
"updatedAt": "2021-09-01T12:00:00Z",
"createdAt": "2021-05-01T12:00:00Z"
},
"message": "Routing rule updated successfully"
}

Esempio di risposta

{
"routingRule": {
"id": "routing-rule-id-1",
"assertions": [
{
"id": "assertion-id-1",
"routingRuleId": "routing-rule-id-1",
"comparison": "CONTAINS",
"value": "Issue With X",
"type": "TITLE"
}
],
"order": 1,
"siteId": "site-id-1",
"updatedAt": "2024-08-09T12:00:00Z",
"createdAt": "2021-05-01T12:00:00Z"
},
"message": "Routing rule updated successfully"
}

Eliminare una regola di instradamento

Endpoint:

DELETE /routing-rules/:id

Esempio di richiesta

DELETE /routing-rules/routing-rule-id-1

Esempio di risposta

{
"message": "Routing rule deleted successfully."
}