{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":568,"path":"api-reference/rest-apis/voice-interaction-resource-api.md","title":"Voice Interaction Resource API","bundle":null,"doc_type":null,"release":"australia","body":"\n# Voice Interaction Resource API\n\nThe Voice Interaction API provides endpoints to transcribe and store voice interactions between agents and callers during a telephone conversation. It works in conjunction with Virtual Agent and Live Agent chats.\n\nYou can use this API to persist transcribed messages from an on-going phone call in real-time or to transcribe and store an existing voice conversation recording for historical purposes. Transcribed messages appear in Agent Workspace, allowing agents to leverage features such as agent assist and search, while talking to a caller. Transcribed messages are persisted in the Conversation Message \\[sys\\_cs\\_message\\] table.\n\n\\[Omitted image \"vir-agent\\_workspace.png\"\\] Alt text: Transcribed messages in Agent Workspace\n\n## Call flow\n\nThe following call flow shows how to use the Voice Interaction API to create a voice interaction record, transcribe and store the messages within that voice conversation, and then close the voice conversation record. You can also use business rules and other scripts to perform this functionality, however, this type of implementation is not covered in this section.\n\n1.  First, call the [Voice Interaction Resource - POST /cs/voice-interactions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/voice-interaction-resource-api.md) endpoint to create a voice interaction record in the Interaction \\[interaction\\] table.\n2.  Then call the [Voice Interaction Resource - POST /cs/voice-interactions/\\{interactionId\\}/messages](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/voice-interaction-resource-api.md) endpoint to store translated messages from the voice conversation into the Conversation Message table. If you are processing a real-time conversation, you should call this endpoint frequently, so that the messages appear in Agent Workspace in a timely manner. When processing a recording for historical purposes, you can pass all messages in a single endpoint call.\n3.  Once you are finished persisting the voice messages, call the [Voice Interaction Resource - PATCH /cs/voice-interactions/\\{interactionId\\}/state](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/voice-interaction-resource-api.md) endpoint to terminate the capture and close the voice interaction record.\n\n## Availability\n\nThis API is available in the base ServiceNow system. Access is restricted by the ACLs imposed on the Interaction \\[interaction\\] and Conversation \\[sys\\_cs\\_conversation\\] tables.\n\n**Parent Topic:**[REST API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/api-rest.md)\n\n## Voice Interaction Resource - PATCH /cs/voice-interactions/\\{interactionId\\}/state\n\nTerminates the specified voice interaction. Once called, no additional voice messages are translated and stored for the phone conversation.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/cs/voice-interactions/{interactionId}/state`\n\nDefault URL: `/api/now/v1/cs/voice-interactions/{interactionId}/state`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\ninteractionId\n\n</td><td>\n\nSys\\_id of the interaction record whose voice interaction to terminate. Passed back by the [Voice Interaction Resource - POST /cs/voice-interactions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/voice-interaction-resource-api.md) endpoint.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nrecordingURL\n\n</td><td>\n\nURL where the original voice recording is located.If configured to do so, this URL appears in Agent Workspace.\n\n Data type: String\n\n Default: None\n\n</td></tr><tr><td>\n\nstate\n\n</td><td>\n\nRequired. State of the voice interaction.Only supported value: closed\\_complete\n\n Data type: String\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. Badly formed JSON or required parameters were not passed.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nStatus of the operation. Possible values:\n\n-   `Success`\n-   `Failed`\n\n If an error is encountered, a message that describes the error is also returned. If the error is on the ServiceNow instance, the instance logs the associated stack trace.\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following example shows how to terminate a voice instance.\n\n```\ncurl \"http://instance.servicenow.com/api/now/v1/ cs/voice-interactions/86837a386f0331003b3c498f5d3ee4ca/state\" \\ \n--request PATCH \\\n--header \"Content-Type: application/json\" \\\n--header \"Accept:application/json\" \\\n--user 'username':'password' \\\n-d {\n  \"state\": \"closed_complete\",\n  \"recordingURL\": \"https: //zoom_instance/rec/QbF7XmPFHPlX1LG\"\n}’\n```\n\nResponse:\n\n```\n{\n  \"result\": \"Success\"\n}\n```\n\n## Voice Interaction Resource - POST /cs/voice-interactions\n\nCreates a voice interaction record within the Interaction \\[interaction\\] table.\n\nYou must create this record before trying to save any transcribed voice messages. You can also use this endpoint to assign a call to a specific agent by passing in their specific user ID.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/cs/voice-interactions`\n\nDefault URL: `/api/now/v1/cs/voice-interactions`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nagentId\n\n</td><td>\n\nUnique identifier of the agent to assign the voice interaction to. Data type: String\n\nDefault: Invoke Virtual Agent\n\n</td></tr><tr><td>\n\ncallerPhoneNumber\n\n</td><td>\n\nCaller's callback phone number. This is the number the agent uses to reach the caller in case the call drops. Data type: String\n\nFormat: E.164 standard compliant\n\nDefault: None\n\n</td></tr><tr><td>\n\nclientSessionId\n\n</td><td>\n\nUnique identifier of a record in an external system used to track this phone call. This information links the records between the two systems. Data type: String\n\nDefault: None\n\n</td></tr><tr><td>\n\ninboundId\n\n</td><td>\n\nUnique identifier of the application provider for the voice service. Data type: String\n\nDefault: Pulled from chat\n\n</td></tr><tr><td>\n\nuserId\n\n</td><td>\n\nRequired. Phone number of the caller who made the call associated with the voice transaction. Data type: String\n\nFormat: Defined by the software that created the voice conversation script. Typically E.164 standard compliant.\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. Badly formed JSON or required parameters were not passed.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\ninteractionId\n\n</td><td>\n\nSys\\_id of the newly created voice interaction record. Use this sys\\_id when:\n\n-   Calling the [Voice Interaction Resource - POST /cs/voice-interactions/\\{interactionId\\}/messages](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/voice-interaction-resource-api.md) endpoint to add a message to the voice interaction.\n-   Calling the [Voice Interaction Resource - PATCH /cs/voice-interactions/\\{interactionId\\}/state](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/voice-interaction-resource-api.md) endpoint to end the voice interaction.\n\nData type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following code example shows how to initiate a voice interaction and transfer the call to a specific agent.\n\n```\ncurl \"http://instance.servicenow.com/api/now/v1/cs/voice-interactions\" \\ \n--request POST \\ \n--header \"Accept:application/json\" \\ \n--user 'username':'password' \\ \n--header \"Content-Type: application/json\"\\ \n-d '{ \n  \"userId\": \"+14089178877\",\n  \"agentId\": \"beth.anglin\",\n  \"callerPhoneNumber\": \"+14089178878\",\n  \"clientSessionId\": \"f8453abb-a33d-45b7-bf01-52b7a821e99z\"\n}'\n```\n\nResponse:\n\n```\n{\n  \"result\": {\n    \"interactionId\": \"4462cb4753751110b6e8ddeeff7b12ca\"\n  }\n}\n```\n\n## Voice Interaction Resource - POST /cs/voice-interactions/\\{interactionId\\}/conversation\n\nCreates a conversation record within the Conversation \\[sys\\_cs\\_conversation\\] table for the specified interaction.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/cs/voice-interactions/{interactionId}/conversation`\n\nDefault URL: `/api/now/v1/cs/voice-interactions/{interactionId}/conversation`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\ninteractionId\n\n</td><td>\n\nSys\\_id of the interaction record for which to create the conversation record. This value is returned by the [Voice Interaction Resource - POST /cs/voice-interactions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/voice-interaction-resource-api.md) endpoint and stored in the Interaction \\[interaction\\] table.Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nagentId\n\n</td><td>\n\nUnique identifier of the agent to assign the voice interaction to. Data type: String\n\nDefault: Invoke Virtual Agent\n\n</td></tr><tr><td>\n\ncallerPhoneNumber\n\n</td><td>\n\nCaller's callback phone number. This is the number the agent uses to reach the caller in case the call drops. Data type: String\n\nFormat: E.164 standard compliant\n\nDefault: None\n\n</td></tr><tr><td>\n\nclientSessionId\n\n</td><td>\n\nUnique identifier of a record in an external system used to track this phone call. This information links the records between the two systems. Data type: String\n\nDefault: None\n\n</td></tr><tr><td>\n\ninboundId\n\n</td><td>\n\nUnique identifier of the application provider for the voice service. Data type: String\n\nDefault: Pull from the chat\n\n</td></tr><tr><td>\n\nuserId\n\n</td><td>\n\nRequired. Phone number of the caller who made the call associated with the voice transaction. Data type: String\n\nFormat: Defined by the software that created the voice conversation script. Typically E.164 standard compliant.\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. Badly formed JSON or required parameters were not passed.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nconversationId\n\n</td><td>\n\nSys\\_id of the newly created conversation record.Data type: String\n\nTable: Conversation \\[sys\\_cs\\_conversation\\]\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following code example shows how to call this endpoint.\n\n```\ncurl \"http://instance.servicenow.com/api/now/v1/cs/voice-interactions/7662cb4721751ea0b6e8dda1b27b131f/conversation\" \\  \n--request POST \\  \n--header \"Accept:application/json\" \\  \n--user 'username':'password' \\  \n--header \"Content-Type: application/json\"\\  \n-d '{  \n  \"userId\": \"+14089178877\", \n  \"agentId\": \"admin@example.com\", \n  \"callerPhoneNumber\": \"+14089178878\", \n  \"clientSessionId\": \"f8453abb-a33d-45b7-bf01-52b7a821e99z\" \n}' \n```\n\nResponse:\n\n```\n{ \n  \"result\": \"a47e1afdb7471110b6e8bc15ae11a934\" \n} \n```\n\n## Voice Interaction Resource - POST /cs/voice-interactions/\\{interactionId\\}/messages\n\nAdds the specified voice conversations messages to the specified voice transaction record. These messages are typically generated using third-party vendor software. Currently, only Amazon Connect is supported.\n\nYou can call this endpoint multiple times during real-time transcribing of the call or pass all messages in a single call if you are transcribing the call for historical purposes. If you are processing a real-time conversation, you should call this endpoint frequently, so that the messages appear in Agent Workspace in a timely manner. Messages are ordered based on their start and end times in relation to the start of the call.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/cs/voice-interactions/{interactionId}/messages`\n\nDefault URL: `/api/now/v1/cs/voice-interactions/{interactionId}/messages`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr><tr><td>\n\ninteractionId\n\n</td><td>\n\nSys\\_id of the interaction record to add the specified messages to. This value is returned by the [Voice Interaction Resource - POST /cs/voice-interactions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/voice-interaction-resource-api.md) endpoint and stored in the Interaction \\[interaction\\] table.Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\n&lt;json\\_string&gt;\n\n</td><td>\n\nList of messages to attach to the specified voice interaction.\n\n```\n\"<json_string>\":[\n  {\n    \"attributes\": [Array],\n    \"beginOffsetMillis\": Long,\n    \"content\": \"String\"\n    \"endOffsetMillis\": Long,\n    \"id\": \"String\",\n    \"isEvent\": Boolean,\n    \"isInternalMessage\": Boolean,\n    \"loudnessScore\": \"Number\",\n    \"participantId\": \"String\",\n    \"sentiment\": \"String\"\n  }\n]\n```\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.attributes\n\n</td><td>\n\nKey-value pairs to associate to the voice interaction.\n\nThese can be any type of data object, from simple objects to complex compound objects. They are used as unique identifiers when invoking Amazon Web Services APIs.\n\n Data type: Array of Objects\n\n Default: None\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.beginOffsetMillis\n\n</td><td>\n\nRequired. Time offset between the start of the voice interaction and the start of the associated message. For example: \"beginOffsetMillis\": 2650. Data type: Long\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.content\n\n</td><td>\n\nRequired. Text of the message to add to the voice interaction. Data type: String\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.endOffsetMillis\n\n</td><td>\n\nRequired. Time offset between the start of the voice interaction and the end of the message. For example: \"endOffsetMillis\": 9380. Data type: Long\n\nUnit: Milliseconds\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.id\n\n</td><td>\n\nMessage UUID of the source of this voice conversation, such as for AmazonConnect. Sets the source message ID column value. Data type: String\n\nDefault: None\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.isEvent\n\n</td><td>\n\nSet by Amazon Connect but not currently used by the method. Flag that indicates whether the associated message is an event.\n\nValid values:\n\n-   true: Message is an event.\n-   false: Message is not an event.\n\n Data type: Boolean\n\n Default: false\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.isInternalMessage\n\n</td><td>\n\nFlag that indicates whether this is an internal message and shouldn't be shown to the caller.\n\nTranscriptions are typically considered internal messages and only appear for the agent and not to the caller. In addition, Agent Whisper is used when a silent third-party is chatting with or is brought into a phone conversation without the caller knowing and offers advice to an agent. The caller doesn't hear or see these messages, but the agent does.\n\nValid values:\n\n-   true: Internal message, don't display to the caller.\n-   false: Not an internal message, display to caller.\n\n Data type: Boolean\n\n Default: false\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.loudnessScore\n\n</td><td>\n\nMeasurement as to how loudly a customer or agent is speaking during a call.\n\nContact Lens displays an analysis of the conversation that shows where they may be talking loudly and have a negative sentiment.\n\n Data type: Number\n\n Range: -1.0 \\(negative\\) to 1.0 \\(positive\\)\n\n Default: Null\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.participantId\n\n</td><td>\n\nRequired. Participant associated with the message.\n\nValid values:\n\n-   AGENT\n-   CUSTOMER\n\n Data type: String\n\n</td></tr><tr><td>\n\n&lt;json\\_string&gt;.sentiment\n\n</td><td>\n\nSentiment of the message.\n\nThis value is generated by a third-party provider. Based on the ServiceNow instance configuration settings, this value is then translated to be either positive, negative, or neutral and is stored in the conversation and interaction record.\n\nValid values:\n\n-   NEGATIVE\n-   NEUTRAL\n-   POSITIVE\n\n Data type: String\n\n Default: Null\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. Badly formed JSON or required parameters were not passed.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nMessage that describes the results of the call.Data type: String\n\n</td></tr><tr><td>\n\nConversation id\n\n</td><td>\n\nSys\\_id of the voice interaction message record that was created.Data type: String\n\nTable: Voice Transcript Conversation Message \\[sys\\_cs\\_message\\_voice\\_transcript\\]\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following example shows how to add messages to an existing voice interaction record.\n\n```\ncurl \"http://instance.servicenow.com/api/now/v1/cs/voice-interactions/86837a386f0331003b3c498f5d3ee4ca/messages\" \\ \n--request POST \\\n--header \"Accept:application/json\" \\\n--header \"Content-Type: application/json\"\\ \n--user 'username':'password' \\\n-d ' [ \n  { \n    \"isEvent\": \"false\",  \n    \"isInternalMessage\": \"false\",  \n    \"beginOffsetMillis\": 10000,  \n    \"content\": \"This is John. How can I help you?\",  \n    \"endOffsetMillis\": 15000,  \n    \"id\": \"954c4edc-31a8-48b0-8f6e-7fa0c4ca00a8\",  \n    \"participantId\": \"AGENT\",  \n    \"sentiment\": \"NEUTRAL\",  \n    \"loudnessScore\": \"null\",  \n    \"attributes\": [{  \n      \"key\": \"key1\",  \n      \"value\": \"value1\"  \n      }, {  \n      \"key\": \"key2\",  \n      \"value\": \"value2\"  \n    }] \n  },  \n  {  \n    \"isEvent\": \"false\",  \n    \"isInternalMessage\": \"false\",  \n    \"beginOffsetMillis\": 20000,  \n    \"content\": \"Uh, yes, John. Um, I'm a little very frustrated right now.\",  \n    \"endOffsetMillis\": 25000,  \n    \"id\": \"18bcf19c-4a9b-4af1-9bd7-7bfb5ba53b9f\",  \n    \"participantId\": \"CUSTOMER\",  \n    \"sentiment\": \"NEGATIVE\"  \n  },  \n  {  \n    \"isEvent\": \"false\",  \n    \"isInternalMessage\": \"false\",  \n    \"beginOffsetMillis\": 30000,  \n    \"content\": \"I am sorry to hear that\",  \n    \"endOffsetMillis\": 35000,  \n    \"id\": \"18bcf19c-4a9b-4af1-9bd7-7bfb5ba53b9f\",  \n    \"participantId\": \"AGENT\",  \n    \"sentiment\": \"NEGATIVE\",  \n \n  },  \n  {  \n    \"isEvent\":\"false\",\n    \"isInternalMessage\":\"false\",\n    \"beginOffsetMillis\":40000,\n    \"content\":\"Can you help me with my insurance? My ssn is 123-12-1234\",\n    \"endOffsetMillis\":45000,\n    \"id\":\"ab09b3b6-23fd-4e41-be05-6b2b53c19059\",\n    \"participantId\":\"CUSTOMER\",\n    \"sentiment\":\"NEUTRAL\" \n  },  \n  {  \n    \"isEvent\":\"False\",\n    \"isInternalMessage\":\"False\",\n    \"beginOffsetMillis\":50000, \n    \"content\":\"Of course, let me check your account\",\n    \"endOffsetMillis\":55000,\n    \"id\":\"18bcf19c-4a9b-4af1-9bd7-7bfb5ba53b9f\",\n    \"participantId\":\"AGENT\",\n    \"sentiment\":\"NEUTRAL\" \n  }  \n]'\n```\n\nResponse:\n\n```\n{ \n  \"result\": \"Voice conversation transcript has been successfully saved. Conversation id: 8439d3c753b51110b6e8ddeeff7b12e2\" \n}\n```\n\n## Voice Interaction Resource - POST /cs/voice-interactions/transcript\n\nAdds messages to an existing voice interaction after a call is completed. You can use this API to attach transcribed messages of a voice call between an agent and caller.\n\n### URL format\n\nVersioned URL: `/api/now/{api_version}/cs/voice-interactions/{interactionId}/transcript`\n\nDefault URL: `/api/now/v1/cs/voice-interactions/{interactionId}/transcript`\n\n**Note:** Available versions are specified in the [REST API Explorer](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/use-REST-API-Explorer.md). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_CustomWebServices.md).\n\n### Supported request parameters\n\n<table class=\"rest_api_path_parameters\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\napi\\_version\n\n</td><td id=\"version-entry-RESTAPI\">\n\nOptional. Version of the endpoint to access. For example, `v1` or `v2`. Only specify this value to use an endpoint version other than the latest. Data type: String\n\n</td></tr></tbody>\n</table>|Name|Description|\n|----|-----------|\n|None| |\n\n<table class=\"rest_api_request_body\"><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nconversationStarted\n\n</td><td>\n\nStart time of the conversation.Data type: String\n\nFormat: YYYY-MM-DD HH:MM:SS\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\ninteractionId\n\n</td><td id=\"vto-interactionId-REST-entry\">\n\nSys\\_id of the interaction record to add the specified messages to. This value is returned by the [Voice Interaction Resource - POST /cs/voice-interactions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-apis/voice-interaction-resource-api.md) endpoint.Data type: String\n\nTable: Interaction \\[interaction\\]\n\n</td></tr><tr><td>\n\nsource\n\n</td><td>\n\nName of the channel that originally created the conversation interaction transcript.Currently, the only supported value is `Amazon Connect`.\n\n Data type: String\n\n</td></tr><tr><td>\n\ntranscript\n\n</td><td>\n\nList of messages to attach to the specified voice interaction.```\n\"transcript\":[\n  {\n    \"attributes\": [Array],\n    \"beginOffsetMillis\": Long,\n    \"content\": \"String\"\n    \"endOffsetMillis\": Long,\n    \"id\": \"String\",\n    \"isEvent\": Boolean,\n    \"isInternalMessage\": Boolean,\n    \"loudnessScore\": \"String\",\n    \"participantId\": \"String\",\n    \"sentiment\": \"String\"\n  }\n]\n```\n\n Data type: Array of Objects\n\n</td></tr><tr><td>\n\ntranscript.attributes\n\n</td><td>\n\nKey-value pairs to associate to the voice interaction.\n\nThese can be any type of data object, from simple objects to complex compound objects. They are used as unique identifiers when invoking Amazon Web Services APIs.\n\n Data type: Array of Objects\n\n Default: None\n\n</td></tr><tr><td>\n\ntranscript.beginOffsetMillis\n\n</td><td>\n\nRequired. Time offset between the start of the voice interaction and the start of the associated message. For example: \"beginOffsetMillis\": 2650. Data type: Long\n\n Unit: Milliseconds\n\n</td></tr><tr><td>\n\ntranscript.content\n\n</td><td>\n\nRequired. Text of the message to add to the voice interaction. Data type: String\n\n</td></tr><tr><td>\n\ntranscript.endOffsetMillis\n\n</td><td>\n\nRequired. Time offset between the start of the voice interaction and the end of the message. For example: \"endOffsetMillis\": 9380. Data type: Long\n\n Unit: Milliseconds\n\n</td></tr><tr><td>\n\ntranscript.id\n\n</td><td>\n\nMessage UUID of the source of this voice conversation, such as for AmazonConnect. Sets the source message ID column value. Data type: String\n\n Default: None\n\n</td></tr><tr><td>\n\ntranscript.isEvent\n\n</td><td>\n\nSet by Amazon Connect but not currently used by the method. Flag that indicates whether the associated message is an event.\n\nValid values:\n\n-   true: Message is an event.\n-   false: Message is not an event.\n\n Data type: Boolean\n\n Default: false\n\n</td></tr><tr><td>\n\ntranscript.isInternalMessage\n\n</td><td>\n\nFlag that indicates whether this is an internal message and shouldn't be shown to the caller.\n\nTranscriptions are typically considered internal messages and only appear for the agent and not to the caller. In addition, Agent Whisper is used when a silent third-party is chatting with or is brought into a phone conversation without the caller knowing and offers advice to an agent. The caller doesn't hear or see these messages, but the agent does.\n\nValid values:\n\n-   true: Internal message, don't display to the caller.\n-   false: Not an internal message, display to caller.\n\n Data type: Boolean\n\n Default: false\n\n</td></tr><tr><td>\n\ntranscript.loudnessScore\n\n</td><td>\n\nMeasurement as to how loudly a customer or agent is speaking during a call.\n\nContact Lens displays an analysis of the conversation that shows where they may be talking loudly and have a negative sentiment.\n\n Data type: Number\n\n Range: -1.0 \\(negative\\) to 1.0 \\(positive\\)\n\n Default: Null\n\n</td></tr><tr><td>\n\ntranscript.participantId\n\n</td><td>\n\nRequired. Participant associated with the message.\n\nValid values:\n\n-   AGENT\n-   CUSTOMER\n\n Data type: String\n\n</td></tr><tr><td>\n\ntranscript.sentiment\n\n</td><td>\n\nSentiment of the message.\n\nThis value is generated by a third-party provider. Based on the ServiceNow instance configuration settings, this value is then translated to be either positive, negative, or neutral and is stored in the conversation and interaction record.\n\nValid values:\n\n-   NEGATIVE\n-   NEUTRAL\n-   POSITIVE\n\n Data type: String\n\n Default: Null\n\n</td></tr></tbody>\n</table>### Headers\n\nThe following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see [Supported REST API headers](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n<table class=\"rest_api_request_headers\"><thead><tr><th>\n\nHeader\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nAccept\n\n</td><td id=\"accept-entry-RESTAPI\">\n\nData format of the response body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr><tr><td>\n\nContent-Type\n\n</td><td id=\"content_type-entry-RESTAPI\">\n\nData format of the request body. Supported types: **application/json** or **application/xml**. Default: **application/json**\n\n</td></tr></tbody>\n</table>|Header|Description|\n|------|-----------|\n|None| |\n\n### Status codes\n\nThe following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see [REST API HTTP response codes](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/c_RESTAPI.md).\n\n|Status code|Description|\n|-----------|-----------|\n|200|Successful. The request was successfully processed.|\n|400|Bad Request. Badly formed JSON or required parameters were not passed.|\n|500|Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.|\n\n### Response body parameters \\(JSON or XML\\)\n\n<table><thead><tr><th>\n\nName\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nresult\n\n</td><td>\n\nMessage that describes the results of the call.Data type: String\n\n</td></tr><tr><td>\n\nConversation id\n\n</td><td>\n\nSys\\_id of the voice conversation table where the messages were attached.Data type: String\n\nTable: Conversation \\[sys\\_cs\\_message\\_conversation\\]\n\n</td></tr></tbody>\n</table>### cURL request\n\nThe following example shows how to add messages to an existing voice interaction record.\n\n```\ncurl \"http://instance.servicenow.com/api/now/v1/cs/voice-interactions/transcript\" \\  \n--request POST \\ \n--header \"Accept:application/json\" \\ \n--header \"Content-Type: application/json\"\\  \n--user 'username':'password' \\ \n-d ' { \n  \"interactionId\": \"e67a6c30c7233010967a34c91dc26068\", \n  \"source\": \"Amazon Connect\", \n  \"conversationStarted\": \"2021-08-06 15:07:51\", \n  \"transcript\": [ \n    { \n      \"isEvent\": \"False\", \n      \"isInternalMessage\": \"False\", \n      \"beginOffsetMillis\": 100000, \n      \"content\": \"This is John. How can I help you?\", \n      \"endOffsetMillis\": 150000, \n      \"id\": \"954c4edc-31a8-48b0-8f6e-7fa0c4ca00a8\", \n      \"participantId\": \"AGENT\", \n      \"sentiment\": \"NEUTRAL\" \n    }, \n    { \n      \"isEvent\": \"False\",\n      \"isInternalMessage\": \"False\", \n      \"beginOffsetMillis\": 200000, \n      \"content\": \"Uh, yes, John. Um, I'm a little frustrated right now.\", \n      \"endOffsetMillis\": 25000, \n      \"id\": \"18bcf19c-4a9b-4af1-9bd7-7bfb5ba53b9f\", \n      \"participantId\": \"CUSTOMER\", \n      \"sentiment\": \"NEGATIVE\" \n    } \n  ] \n} ' \n```\n\nResponse:\n\n```\n{  \n  \"result\": \"Voice conversation transcript has been successfully saved. Conversation id: 8439d3c753b51110b6e8ddeeff7b12e2\"  \n}\n```\n\n"}}