Intent
Execute an option for a specific intent
POST /intent/{intentId}/execute
POST /intent/{intentId}/execute
Path parameters
intentIdintegerpathrequiredThe id of the intent that should be executed
Request body
Optional additional parameters to override/validate the existing data in the intent or trigger a response to the customer
intentIdnumberbodyNo description.
codestringbodyThis field is necessary for creating new intent when we don't have intentId
ticketIdnumberbodyThis field is necessary for creating new intent when we don't have intentId
informCustomerbooleanbodyDefault: falseIf true, an email is being sent to the customer informing him about the outcome, and the corresponding ticket is closed (if the operation was successful)
dryRunbooleanbodyDefault: falseIf true, the execution is simulated without any write API calls triggered to the backend systems
dataobjectbodyIntent-specific data object that should be used to process the intent
contractIdstringbodyOptional contract id. If provided, the backend verifies that the provided contractId matches the contract id associated to the intent and throws an error if it does not match
Request Example
{
"intentId": 1,
"code": "process_meter_reading",
"ticketId": 1010,
"informCustomer": false,
"dryRun": true,
"data": null,
"contractId": "376189"
}Responses
200 — Option was processed
Response Example
{
"aiAgentId": 1,
"success": true,
"messageLocalized": "Powercloud accepted meter reading",
"internalData": {
"requestEndpoint": "saveReadingByContractId",
"requestParams": "readingValue=21;date=2022-12-31"
},
"executedAt": "2022-12-13 22:18:06",
"userId": 1,
"sent": true,
"ticketClosed": true,
"recipient": "john@smith.com",
"message": "We successfully processed your meter reading of 21 kWh dated Dec 31, 2022",
"template": "<p>Dear John,</p><p>%MESSAGE%</p><i>Mike from your service team</i>",
"sources": [
{
"type": "knowledgeSource",
"id": 376189,
"name": "Opening hours",
"url": "https://company.com/faq/376189",
"text": "Our service hours are from 8am to 5pm. We are closed on weekends. [...]"
}
],
"txId": "c916167c94"
}403 — Unauthorized
404 — Intent not found
500 — Internal error