Contact Center AI Insights API
POST
contactcenterinsights.projects.locations.conversations.analyses.create
{{baseUrl}}/v1/:parent/analyses
QUERY PARAMS
parent
BODY json
{
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/analyses");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:parent/analyses" {:content-type :json
:form-params {:analysisResult {:callAnalysisMetadata {:annotations [{:annotationEndBoundary {:transcriptIndex 0
:wordIndex 0}
:annotationStartBoundary {}
:channelTag 0
:entityMentionData {:entityUniqueId ""
:sentiment {:magnitude ""
:score ""}
:type ""}
:holdData {}
:intentMatchData {:intentUniqueId ""}
:interruptionData {}
:issueMatchData {:issueAssignment {:displayName ""
:issue ""
:score ""}}
:phraseMatchData {:displayName ""
:phraseMatcher ""}
:sentimentData {}
:silenceData {}}]
:entities {}
:intents {}
:issueModelResult {:issueModel ""
:issues [{}]}
:phraseMatchers {}
:sentiments [{:channelTag 0
:sentimentData {}}]}
:endTime ""}
:annotatorSelector {:issueModels []
:phraseMatchers []
:runEntityAnnotator false
:runIntentAnnotator false
:runInterruptionAnnotator false
:runIssueModelAnnotator false
:runPhraseMatcherAnnotator false
:runSentimentAnnotator false
:runSilenceAnnotator false}
:createTime ""
:name ""
:requestTime ""}})
require "http/client"
url = "{{baseUrl}}/v1/:parent/analyses"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/analyses"),
Content = new StringContent("{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/analyses");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/analyses"
payload := strings.NewReader("{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:parent/analyses HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1665
{
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:parent/analyses")
.setHeader("content-type", "application/json")
.setBody("{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/analyses"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/analyses")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:parent/analyses")
.header("content-type", "application/json")
.body("{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {
transcriptIndex: 0,
wordIndex: 0
},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {
entityUniqueId: '',
sentiment: {
magnitude: '',
score: ''
},
type: ''
},
holdData: {},
intentMatchData: {
intentUniqueId: ''
},
interruptionData: {},
issueMatchData: {
issueAssignment: {
displayName: '',
issue: '',
score: ''
}
},
phraseMatchData: {
displayName: '',
phraseMatcher: ''
},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {
issueModel: '',
issues: [
{}
]
},
phraseMatchers: {},
sentiments: [
{
channelTag: 0,
sentimentData: {}
}
]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:parent/analyses');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/analyses',
headers: {'content-type': 'application/json'},
data: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/analyses';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"analysisResult":{"callAnalysisMetadata":{"annotations":[{"annotationEndBoundary":{"transcriptIndex":0,"wordIndex":0},"annotationStartBoundary":{},"channelTag":0,"entityMentionData":{"entityUniqueId":"","sentiment":{"magnitude":"","score":""},"type":""},"holdData":{},"intentMatchData":{"intentUniqueId":""},"interruptionData":{},"issueMatchData":{"issueAssignment":{"displayName":"","issue":"","score":""}},"phraseMatchData":{"displayName":"","phraseMatcher":""},"sentimentData":{},"silenceData":{}}],"entities":{},"intents":{},"issueModelResult":{"issueModel":"","issues":[{}]},"phraseMatchers":{},"sentiments":[{"channelTag":0,"sentimentData":{}}]},"endTime":""},"annotatorSelector":{"issueModels":[],"phraseMatchers":[],"runEntityAnnotator":false,"runIntentAnnotator":false,"runInterruptionAnnotator":false,"runIssueModelAnnotator":false,"runPhraseMatcherAnnotator":false,"runSentimentAnnotator":false,"runSilenceAnnotator":false},"createTime":"","name":"","requestTime":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/analyses',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "analysisResult": {\n "callAnalysisMetadata": {\n "annotations": [\n {\n "annotationEndBoundary": {\n "transcriptIndex": 0,\n "wordIndex": 0\n },\n "annotationStartBoundary": {},\n "channelTag": 0,\n "entityMentionData": {\n "entityUniqueId": "",\n "sentiment": {\n "magnitude": "",\n "score": ""\n },\n "type": ""\n },\n "holdData": {},\n "intentMatchData": {\n "intentUniqueId": ""\n },\n "interruptionData": {},\n "issueMatchData": {\n "issueAssignment": {\n "displayName": "",\n "issue": "",\n "score": ""\n }\n },\n "phraseMatchData": {\n "displayName": "",\n "phraseMatcher": ""\n },\n "sentimentData": {},\n "silenceData": {}\n }\n ],\n "entities": {},\n "intents": {},\n "issueModelResult": {\n "issueModel": "",\n "issues": [\n {}\n ]\n },\n "phraseMatchers": {},\n "sentiments": [\n {\n "channelTag": 0,\n "sentimentData": {}\n }\n ]\n },\n "endTime": ""\n },\n "annotatorSelector": {\n "issueModels": [],\n "phraseMatchers": [],\n "runEntityAnnotator": false,\n "runIntentAnnotator": false,\n "runInterruptionAnnotator": false,\n "runIssueModelAnnotator": false,\n "runPhraseMatcherAnnotator": false,\n "runSentimentAnnotator": false,\n "runSilenceAnnotator": false\n },\n "createTime": "",\n "name": "",\n "requestTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/analyses")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/analyses',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/analyses',
headers: {'content-type': 'application/json'},
body: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:parent/analyses');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {
transcriptIndex: 0,
wordIndex: 0
},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {
entityUniqueId: '',
sentiment: {
magnitude: '',
score: ''
},
type: ''
},
holdData: {},
intentMatchData: {
intentUniqueId: ''
},
interruptionData: {},
issueMatchData: {
issueAssignment: {
displayName: '',
issue: '',
score: ''
}
},
phraseMatchData: {
displayName: '',
phraseMatcher: ''
},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {
issueModel: '',
issues: [
{}
]
},
phraseMatchers: {},
sentiments: [
{
channelTag: 0,
sentimentData: {}
}
]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/analyses',
headers: {'content-type': 'application/json'},
data: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/analyses';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"analysisResult":{"callAnalysisMetadata":{"annotations":[{"annotationEndBoundary":{"transcriptIndex":0,"wordIndex":0},"annotationStartBoundary":{},"channelTag":0,"entityMentionData":{"entityUniqueId":"","sentiment":{"magnitude":"","score":""},"type":""},"holdData":{},"intentMatchData":{"intentUniqueId":""},"interruptionData":{},"issueMatchData":{"issueAssignment":{"displayName":"","issue":"","score":""}},"phraseMatchData":{"displayName":"","phraseMatcher":""},"sentimentData":{},"silenceData":{}}],"entities":{},"intents":{},"issueModelResult":{"issueModel":"","issues":[{}]},"phraseMatchers":{},"sentiments":[{"channelTag":0,"sentimentData":{}}]},"endTime":""},"annotatorSelector":{"issueModels":[],"phraseMatchers":[],"runEntityAnnotator":false,"runIntentAnnotator":false,"runInterruptionAnnotator":false,"runIssueModelAnnotator":false,"runPhraseMatcherAnnotator":false,"runSentimentAnnotator":false,"runSilenceAnnotator":false},"createTime":"","name":"","requestTime":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"analysisResult": @{ @"callAnalysisMetadata": @{ @"annotations": @[ @{ @"annotationEndBoundary": @{ @"transcriptIndex": @0, @"wordIndex": @0 }, @"annotationStartBoundary": @{ }, @"channelTag": @0, @"entityMentionData": @{ @"entityUniqueId": @"", @"sentiment": @{ @"magnitude": @"", @"score": @"" }, @"type": @"" }, @"holdData": @{ }, @"intentMatchData": @{ @"intentUniqueId": @"" }, @"interruptionData": @{ }, @"issueMatchData": @{ @"issueAssignment": @{ @"displayName": @"", @"issue": @"", @"score": @"" } }, @"phraseMatchData": @{ @"displayName": @"", @"phraseMatcher": @"" }, @"sentimentData": @{ }, @"silenceData": @{ } } ], @"entities": @{ }, @"intents": @{ }, @"issueModelResult": @{ @"issueModel": @"", @"issues": @[ @{ } ] }, @"phraseMatchers": @{ }, @"sentiments": @[ @{ @"channelTag": @0, @"sentimentData": @{ } } ] }, @"endTime": @"" },
@"annotatorSelector": @{ @"issueModels": @[ ], @"phraseMatchers": @[ ], @"runEntityAnnotator": @NO, @"runIntentAnnotator": @NO, @"runInterruptionAnnotator": @NO, @"runIssueModelAnnotator": @NO, @"runPhraseMatcherAnnotator": @NO, @"runSentimentAnnotator": @NO, @"runSilenceAnnotator": @NO },
@"createTime": @"",
@"name": @"",
@"requestTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/analyses"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/analyses" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/analyses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'analysisResult' => [
'callAnalysisMetadata' => [
'annotations' => [
[
'annotationEndBoundary' => [
'transcriptIndex' => 0,
'wordIndex' => 0
],
'annotationStartBoundary' => [
],
'channelTag' => 0,
'entityMentionData' => [
'entityUniqueId' => '',
'sentiment' => [
'magnitude' => '',
'score' => ''
],
'type' => ''
],
'holdData' => [
],
'intentMatchData' => [
'intentUniqueId' => ''
],
'interruptionData' => [
],
'issueMatchData' => [
'issueAssignment' => [
'displayName' => '',
'issue' => '',
'score' => ''
]
],
'phraseMatchData' => [
'displayName' => '',
'phraseMatcher' => ''
],
'sentimentData' => [
],
'silenceData' => [
]
]
],
'entities' => [
],
'intents' => [
],
'issueModelResult' => [
'issueModel' => '',
'issues' => [
[
]
]
],
'phraseMatchers' => [
],
'sentiments' => [
[
'channelTag' => 0,
'sentimentData' => [
]
]
]
],
'endTime' => ''
],
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'createTime' => '',
'name' => '',
'requestTime' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:parent/analyses', [
'body' => '{
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/analyses');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'analysisResult' => [
'callAnalysisMetadata' => [
'annotations' => [
[
'annotationEndBoundary' => [
'transcriptIndex' => 0,
'wordIndex' => 0
],
'annotationStartBoundary' => [
],
'channelTag' => 0,
'entityMentionData' => [
'entityUniqueId' => '',
'sentiment' => [
'magnitude' => '',
'score' => ''
],
'type' => ''
],
'holdData' => [
],
'intentMatchData' => [
'intentUniqueId' => ''
],
'interruptionData' => [
],
'issueMatchData' => [
'issueAssignment' => [
'displayName' => '',
'issue' => '',
'score' => ''
]
],
'phraseMatchData' => [
'displayName' => '',
'phraseMatcher' => ''
],
'sentimentData' => [
],
'silenceData' => [
]
]
],
'entities' => [
],
'intents' => [
],
'issueModelResult' => [
'issueModel' => '',
'issues' => [
[
]
]
],
'phraseMatchers' => [
],
'sentiments' => [
[
'channelTag' => 0,
'sentimentData' => [
]
]
]
],
'endTime' => ''
],
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'createTime' => '',
'name' => '',
'requestTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'analysisResult' => [
'callAnalysisMetadata' => [
'annotations' => [
[
'annotationEndBoundary' => [
'transcriptIndex' => 0,
'wordIndex' => 0
],
'annotationStartBoundary' => [
],
'channelTag' => 0,
'entityMentionData' => [
'entityUniqueId' => '',
'sentiment' => [
'magnitude' => '',
'score' => ''
],
'type' => ''
],
'holdData' => [
],
'intentMatchData' => [
'intentUniqueId' => ''
],
'interruptionData' => [
],
'issueMatchData' => [
'issueAssignment' => [
'displayName' => '',
'issue' => '',
'score' => ''
]
],
'phraseMatchData' => [
'displayName' => '',
'phraseMatcher' => ''
],
'sentimentData' => [
],
'silenceData' => [
]
]
],
'entities' => [
],
'intents' => [
],
'issueModelResult' => [
'issueModel' => '',
'issues' => [
[
]
]
],
'phraseMatchers' => [
],
'sentiments' => [
[
'channelTag' => 0,
'sentimentData' => [
]
]
]
],
'endTime' => ''
],
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'createTime' => '',
'name' => '',
'requestTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:parent/analyses');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/analyses' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/analyses' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:parent/analyses", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/analyses"
payload = {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": { "intentUniqueId": "" },
"interruptionData": {},
"issueMatchData": { "issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
} },
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [{}]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": False,
"runIntentAnnotator": False,
"runInterruptionAnnotator": False,
"runIssueModelAnnotator": False,
"runPhraseMatcherAnnotator": False,
"runSentimentAnnotator": False,
"runSilenceAnnotator": False
},
"createTime": "",
"name": "",
"requestTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/analyses"
payload <- "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/analyses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:parent/analyses') do |req|
req.body = "{\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/analyses";
let payload = json!({
"analysisResult": json!({
"callAnalysisMetadata": json!({
"annotations": (
json!({
"annotationEndBoundary": json!({
"transcriptIndex": 0,
"wordIndex": 0
}),
"annotationStartBoundary": json!({}),
"channelTag": 0,
"entityMentionData": json!({
"entityUniqueId": "",
"sentiment": json!({
"magnitude": "",
"score": ""
}),
"type": ""
}),
"holdData": json!({}),
"intentMatchData": json!({"intentUniqueId": ""}),
"interruptionData": json!({}),
"issueMatchData": json!({"issueAssignment": json!({
"displayName": "",
"issue": "",
"score": ""
})}),
"phraseMatchData": json!({
"displayName": "",
"phraseMatcher": ""
}),
"sentimentData": json!({}),
"silenceData": json!({})
})
),
"entities": json!({}),
"intents": json!({}),
"issueModelResult": json!({
"issueModel": "",
"issues": (json!({}))
}),
"phraseMatchers": json!({}),
"sentiments": (
json!({
"channelTag": 0,
"sentimentData": json!({})
})
)
}),
"endTime": ""
}),
"annotatorSelector": json!({
"issueModels": (),
"phraseMatchers": (),
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
}),
"createTime": "",
"name": "",
"requestTime": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:parent/analyses \
--header 'content-type: application/json' \
--data '{
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
}'
echo '{
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
}' | \
http POST {{baseUrl}}/v1/:parent/analyses \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "analysisResult": {\n "callAnalysisMetadata": {\n "annotations": [\n {\n "annotationEndBoundary": {\n "transcriptIndex": 0,\n "wordIndex": 0\n },\n "annotationStartBoundary": {},\n "channelTag": 0,\n "entityMentionData": {\n "entityUniqueId": "",\n "sentiment": {\n "magnitude": "",\n "score": ""\n },\n "type": ""\n },\n "holdData": {},\n "intentMatchData": {\n "intentUniqueId": ""\n },\n "interruptionData": {},\n "issueMatchData": {\n "issueAssignment": {\n "displayName": "",\n "issue": "",\n "score": ""\n }\n },\n "phraseMatchData": {\n "displayName": "",\n "phraseMatcher": ""\n },\n "sentimentData": {},\n "silenceData": {}\n }\n ],\n "entities": {},\n "intents": {},\n "issueModelResult": {\n "issueModel": "",\n "issues": [\n {}\n ]\n },\n "phraseMatchers": {},\n "sentiments": [\n {\n "channelTag": 0,\n "sentimentData": {}\n }\n ]\n },\n "endTime": ""\n },\n "annotatorSelector": {\n "issueModels": [],\n "phraseMatchers": [],\n "runEntityAnnotator": false,\n "runIntentAnnotator": false,\n "runInterruptionAnnotator": false,\n "runIssueModelAnnotator": false,\n "runPhraseMatcherAnnotator": false,\n "runSentimentAnnotator": false,\n "runSilenceAnnotator": false\n },\n "createTime": "",\n "name": "",\n "requestTime": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:parent/analyses
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"analysisResult": [
"callAnalysisMetadata": [
"annotations": [
[
"annotationEndBoundary": [
"transcriptIndex": 0,
"wordIndex": 0
],
"annotationStartBoundary": [],
"channelTag": 0,
"entityMentionData": [
"entityUniqueId": "",
"sentiment": [
"magnitude": "",
"score": ""
],
"type": ""
],
"holdData": [],
"intentMatchData": ["intentUniqueId": ""],
"interruptionData": [],
"issueMatchData": ["issueAssignment": [
"displayName": "",
"issue": "",
"score": ""
]],
"phraseMatchData": [
"displayName": "",
"phraseMatcher": ""
],
"sentimentData": [],
"silenceData": []
]
],
"entities": [],
"intents": [],
"issueModelResult": [
"issueModel": "",
"issues": [[]]
],
"phraseMatchers": [],
"sentiments": [
[
"channelTag": 0,
"sentimentData": []
]
]
],
"endTime": ""
],
"annotatorSelector": [
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
],
"createTime": "",
"name": "",
"requestTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/analyses")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.conversations.analyses.list
{{baseUrl}}/v1/:parent/analyses
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/analyses");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:parent/analyses")
require "http/client"
url = "{{baseUrl}}/v1/:parent/analyses"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/analyses"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/analyses");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/analyses"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:parent/analyses HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:parent/analyses")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/analyses"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/analyses")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:parent/analyses")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:parent/analyses');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/analyses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/analyses';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/analyses',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/analyses")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/analyses',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/analyses'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:parent/analyses');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/analyses'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/analyses';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/analyses"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/analyses" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/analyses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:parent/analyses');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/analyses');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:parent/analyses');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/analyses' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/analyses' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:parent/analyses")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/analyses"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/analyses"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/analyses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:parent/analyses') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/analyses";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:parent/analyses
http GET {{baseUrl}}/v1/:parent/analyses
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:parent/analyses
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/analyses")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.conversations.bulkAnalyze
{{baseUrl}}/v1/:parent/conversations:bulkAnalyze
QUERY PARAMS
parent
BODY json
{
"analysisPercentage": "",
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"filter": "",
"parent": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze" {:content-type :json
:form-params {:analysisPercentage ""
:annotatorSelector {:issueModels []
:phraseMatchers []
:runEntityAnnotator false
:runIntentAnnotator false
:runInterruptionAnnotator false
:runIssueModelAnnotator false
:runPhraseMatcherAnnotator false
:runSentimentAnnotator false
:runSilenceAnnotator false}
:filter ""
:parent ""}})
require "http/client"
url = "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/conversations:bulkAnalyze"),
Content = new StringContent("{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/conversations:bulkAnalyze");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze"
payload := strings.NewReader("{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:parent/conversations:bulkAnalyze HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 392
{
"analysisPercentage": "",
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"filter": "",
"parent": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze")
.setHeader("content-type", "application/json")
.setBody("{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/conversations:bulkAnalyze"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations:bulkAnalyze")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:parent/conversations:bulkAnalyze")
.header("content-type", "application/json")
.body("{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}")
.asString();
const data = JSON.stringify({
analysisPercentage: '',
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
filter: '',
parent: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze',
headers: {'content-type': 'application/json'},
data: {
analysisPercentage: '',
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
filter: '',
parent: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"analysisPercentage":"","annotatorSelector":{"issueModels":[],"phraseMatchers":[],"runEntityAnnotator":false,"runIntentAnnotator":false,"runInterruptionAnnotator":false,"runIssueModelAnnotator":false,"runPhraseMatcherAnnotator":false,"runSentimentAnnotator":false,"runSilenceAnnotator":false},"filter":"","parent":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "analysisPercentage": "",\n "annotatorSelector": {\n "issueModels": [],\n "phraseMatchers": [],\n "runEntityAnnotator": false,\n "runIntentAnnotator": false,\n "runInterruptionAnnotator": false,\n "runIssueModelAnnotator": false,\n "runPhraseMatcherAnnotator": false,\n "runSentimentAnnotator": false,\n "runSilenceAnnotator": false\n },\n "filter": "",\n "parent": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations:bulkAnalyze")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/conversations:bulkAnalyze',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
analysisPercentage: '',
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
filter: '',
parent: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze',
headers: {'content-type': 'application/json'},
body: {
analysisPercentage: '',
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
filter: '',
parent: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
analysisPercentage: '',
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
filter: '',
parent: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze',
headers: {'content-type': 'application/json'},
data: {
analysisPercentage: '',
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
filter: '',
parent: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"analysisPercentage":"","annotatorSelector":{"issueModels":[],"phraseMatchers":[],"runEntityAnnotator":false,"runIntentAnnotator":false,"runInterruptionAnnotator":false,"runIssueModelAnnotator":false,"runPhraseMatcherAnnotator":false,"runSentimentAnnotator":false,"runSilenceAnnotator":false},"filter":"","parent":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"analysisPercentage": @"",
@"annotatorSelector": @{ @"issueModels": @[ ], @"phraseMatchers": @[ ], @"runEntityAnnotator": @NO, @"runIntentAnnotator": @NO, @"runInterruptionAnnotator": @NO, @"runIssueModelAnnotator": @NO, @"runPhraseMatcherAnnotator": @NO, @"runSentimentAnnotator": @NO, @"runSilenceAnnotator": @NO },
@"filter": @"",
@"parent": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/conversations:bulkAnalyze"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/conversations:bulkAnalyze",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'analysisPercentage' => '',
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'filter' => '',
'parent' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze', [
'body' => '{
"analysisPercentage": "",
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"filter": "",
"parent": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/conversations:bulkAnalyze');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'analysisPercentage' => '',
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'filter' => '',
'parent' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'analysisPercentage' => '',
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'filter' => '',
'parent' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:parent/conversations:bulkAnalyze');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"analysisPercentage": "",
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"filter": "",
"parent": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/conversations:bulkAnalyze' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"analysisPercentage": "",
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"filter": "",
"parent": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:parent/conversations:bulkAnalyze", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze"
payload = {
"analysisPercentage": "",
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": False,
"runIntentAnnotator": False,
"runInterruptionAnnotator": False,
"runIssueModelAnnotator": False,
"runPhraseMatcherAnnotator": False,
"runSentimentAnnotator": False,
"runSilenceAnnotator": False
},
"filter": "",
"parent": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze"
payload <- "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/conversations:bulkAnalyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:parent/conversations:bulkAnalyze') do |req|
req.body = "{\n \"analysisPercentage\": \"\",\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"filter\": \"\",\n \"parent\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze";
let payload = json!({
"analysisPercentage": "",
"annotatorSelector": json!({
"issueModels": (),
"phraseMatchers": (),
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
}),
"filter": "",
"parent": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:parent/conversations:bulkAnalyze \
--header 'content-type: application/json' \
--data '{
"analysisPercentage": "",
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"filter": "",
"parent": ""
}'
echo '{
"analysisPercentage": "",
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"filter": "",
"parent": ""
}' | \
http POST {{baseUrl}}/v1/:parent/conversations:bulkAnalyze \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "analysisPercentage": "",\n "annotatorSelector": {\n "issueModels": [],\n "phraseMatchers": [],\n "runEntityAnnotator": false,\n "runIntentAnnotator": false,\n "runInterruptionAnnotator": false,\n "runIssueModelAnnotator": false,\n "runPhraseMatcherAnnotator": false,\n "runSentimentAnnotator": false,\n "runSilenceAnnotator": false\n },\n "filter": "",\n "parent": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:parent/conversations:bulkAnalyze
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"analysisPercentage": "",
"annotatorSelector": [
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
],
"filter": "",
"parent": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/conversations:bulkAnalyze")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.conversations.calculateStats
{{baseUrl}}/v1/:location/conversations:calculateStats
QUERY PARAMS
location
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:location/conversations:calculateStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:location/conversations:calculateStats")
require "http/client"
url = "{{baseUrl}}/v1/:location/conversations:calculateStats"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:location/conversations:calculateStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:location/conversations:calculateStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:location/conversations:calculateStats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:location/conversations:calculateStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:location/conversations:calculateStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:location/conversations:calculateStats"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:location/conversations:calculateStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:location/conversations:calculateStats")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:location/conversations:calculateStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/:location/conversations:calculateStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:location/conversations:calculateStats';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:location/conversations:calculateStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:location/conversations:calculateStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:location/conversations:calculateStats',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/:location/conversations:calculateStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:location/conversations:calculateStats');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/:location/conversations:calculateStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:location/conversations:calculateStats';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:location/conversations:calculateStats"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:location/conversations:calculateStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:location/conversations:calculateStats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:location/conversations:calculateStats');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:location/conversations:calculateStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:location/conversations:calculateStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:location/conversations:calculateStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:location/conversations:calculateStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:location/conversations:calculateStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:location/conversations:calculateStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:location/conversations:calculateStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:location/conversations:calculateStats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:location/conversations:calculateStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:location/conversations:calculateStats";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:location/conversations:calculateStats
http GET {{baseUrl}}/v1/:location/conversations:calculateStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:location/conversations:calculateStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:location/conversations:calculateStats")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.conversations.create
{{baseUrl}}/v1/:parent/conversations
QUERY PARAMS
parent
BODY json
{
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/conversations");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:parent/conversations" {:content-type :json
:form-params {:agentId ""
:callMetadata {:agentChannel 0
:customerChannel 0}
:createTime ""
:dataSource {:dialogflowSource {:audioUri ""
:dialogflowConversation ""}
:gcsSource {:audioUri ""
:transcriptUri ""}}
:dialogflowIntents {}
:duration ""
:expireTime ""
:labels {}
:languageCode ""
:latestAnalysis {:analysisResult {:callAnalysisMetadata {:annotations [{:annotationEndBoundary {:transcriptIndex 0
:wordIndex 0}
:annotationStartBoundary {}
:channelTag 0
:entityMentionData {:entityUniqueId ""
:sentiment {:magnitude ""
:score ""}
:type ""}
:holdData {}
:intentMatchData {:intentUniqueId ""}
:interruptionData {}
:issueMatchData {:issueAssignment {:displayName ""
:issue ""
:score ""}}
:phraseMatchData {:displayName ""
:phraseMatcher ""}
:sentimentData {}
:silenceData {}}]
:entities {}
:intents {}
:issueModelResult {:issueModel ""
:issues [{}]}
:phraseMatchers {}
:sentiments [{:channelTag 0
:sentimentData {}}]}
:endTime ""}
:annotatorSelector {:issueModels []
:phraseMatchers []
:runEntityAnnotator false
:runIntentAnnotator false
:runInterruptionAnnotator false
:runIssueModelAnnotator false
:runPhraseMatcherAnnotator false
:runSentimentAnnotator false
:runSilenceAnnotator false}
:createTime ""
:name ""
:requestTime ""}
:medium ""
:name ""
:obfuscatedUserId ""
:runtimeAnnotations [{:annotationId ""
:answerFeedback {:clicked false
:correctnessLevel ""
:displayed false}
:articleSuggestion {:confidenceScore ""
:metadata {}
:queryRecord ""
:source ""
:title ""
:uri ""}
:createTime ""
:dialogflowInteraction {:confidence ""
:dialogflowIntentId ""}
:endBoundary {}
:faqAnswer {:answer ""
:confidenceScore ""
:metadata {}
:queryRecord ""
:question ""
:source ""}
:smartComposeSuggestion {:confidenceScore ""
:metadata {}
:queryRecord ""
:suggestion ""}
:smartReply {:confidenceScore ""
:metadata {}
:queryRecord ""
:reply ""}
:startBoundary {}}]
:startTime ""
:transcript {:transcriptSegments [{:channelTag 0
:confidence ""
:dialogflowSegmentMetadata {:smartReplyAllowlistCovered false}
:languageCode ""
:messageTime ""
:segmentParticipant {:dialogflowParticipant ""
:dialogflowParticipantName ""
:obfuscatedExternalUserId ""
:role ""
:userId ""}
:sentiment {}
:text ""
:words [{:confidence ""
:endOffset ""
:startOffset ""
:word ""}]}]}
:ttl ""
:turnCount 0
:updateTime ""}})
require "http/client"
url = "{{baseUrl}}/v1/:parent/conversations"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/conversations"),
Content = new StringContent("{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/conversations");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/conversations"
payload := strings.NewReader("{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:parent/conversations HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 4062
{
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:parent/conversations")
.setHeader("content-type", "application/json")
.setBody("{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/conversations"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:parent/conversations")
.header("content-type", "application/json")
.body("{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
agentId: '',
callMetadata: {
agentChannel: 0,
customerChannel: 0
},
createTime: '',
dataSource: {
dialogflowSource: {
audioUri: '',
dialogflowConversation: ''
},
gcsSource: {
audioUri: '',
transcriptUri: ''
}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {
transcriptIndex: 0,
wordIndex: 0
},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {
entityUniqueId: '',
sentiment: {
magnitude: '',
score: ''
},
type: ''
},
holdData: {},
intentMatchData: {
intentUniqueId: ''
},
interruptionData: {},
issueMatchData: {
issueAssignment: {
displayName: '',
issue: '',
score: ''
}
},
phraseMatchData: {
displayName: '',
phraseMatcher: ''
},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {
issueModel: '',
issues: [
{}
]
},
phraseMatchers: {},
sentiments: [
{
channelTag: 0,
sentimentData: {}
}
]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {
clicked: false,
correctnessLevel: '',
displayed: false
},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {
confidence: '',
dialogflowIntentId: ''
},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
suggestion: ''
},
smartReply: {
confidenceScore: '',
metadata: {},
queryRecord: '',
reply: ''
},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {
smartReplyAllowlistCovered: false
},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [
{
confidence: '',
endOffset: '',
startOffset: '',
word: ''
}
]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:parent/conversations');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations',
headers: {'content-type': 'application/json'},
data: {
agentId: '',
callMetadata: {agentChannel: 0, customerChannel: 0},
createTime: '',
dataSource: {
dialogflowSource: {audioUri: '', dialogflowConversation: ''},
gcsSource: {audioUri: '', transcriptUri: ''}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {clicked: false, correctnessLevel: '', displayed: false},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {confidence: '', dialogflowIntentId: ''},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {confidenceScore: '', metadata: {}, queryRecord: '', suggestion: ''},
smartReply: {confidenceScore: '', metadata: {}, queryRecord: '', reply: ''},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {smartReplyAllowlistCovered: false},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [{confidence: '', endOffset: '', startOffset: '', word: ''}]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/conversations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"agentId":"","callMetadata":{"agentChannel":0,"customerChannel":0},"createTime":"","dataSource":{"dialogflowSource":{"audioUri":"","dialogflowConversation":""},"gcsSource":{"audioUri":"","transcriptUri":""}},"dialogflowIntents":{},"duration":"","expireTime":"","labels":{},"languageCode":"","latestAnalysis":{"analysisResult":{"callAnalysisMetadata":{"annotations":[{"annotationEndBoundary":{"transcriptIndex":0,"wordIndex":0},"annotationStartBoundary":{},"channelTag":0,"entityMentionData":{"entityUniqueId":"","sentiment":{"magnitude":"","score":""},"type":""},"holdData":{},"intentMatchData":{"intentUniqueId":""},"interruptionData":{},"issueMatchData":{"issueAssignment":{"displayName":"","issue":"","score":""}},"phraseMatchData":{"displayName":"","phraseMatcher":""},"sentimentData":{},"silenceData":{}}],"entities":{},"intents":{},"issueModelResult":{"issueModel":"","issues":[{}]},"phraseMatchers":{},"sentiments":[{"channelTag":0,"sentimentData":{}}]},"endTime":""},"annotatorSelector":{"issueModels":[],"phraseMatchers":[],"runEntityAnnotator":false,"runIntentAnnotator":false,"runInterruptionAnnotator":false,"runIssueModelAnnotator":false,"runPhraseMatcherAnnotator":false,"runSentimentAnnotator":false,"runSilenceAnnotator":false},"createTime":"","name":"","requestTime":""},"medium":"","name":"","obfuscatedUserId":"","runtimeAnnotations":[{"annotationId":"","answerFeedback":{"clicked":false,"correctnessLevel":"","displayed":false},"articleSuggestion":{"confidenceScore":"","metadata":{},"queryRecord":"","source":"","title":"","uri":""},"createTime":"","dialogflowInteraction":{"confidence":"","dialogflowIntentId":""},"endBoundary":{},"faqAnswer":{"answer":"","confidenceScore":"","metadata":{},"queryRecord":"","question":"","source":""},"smartComposeSuggestion":{"confidenceScore":"","metadata":{},"queryRecord":"","suggestion":""},"smartReply":{"confidenceScore":"","metadata":{},"queryRecord":"","reply":""},"startBoundary":{}}],"startTime":"","transcript":{"transcriptSegments":[{"channelTag":0,"confidence":"","dialogflowSegmentMetadata":{"smartReplyAllowlistCovered":false},"languageCode":"","messageTime":"","segmentParticipant":{"dialogflowParticipant":"","dialogflowParticipantName":"","obfuscatedExternalUserId":"","role":"","userId":""},"sentiment":{},"text":"","words":[{"confidence":"","endOffset":"","startOffset":"","word":""}]}]},"ttl":"","turnCount":0,"updateTime":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/conversations',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "agentId": "",\n "callMetadata": {\n "agentChannel": 0,\n "customerChannel": 0\n },\n "createTime": "",\n "dataSource": {\n "dialogflowSource": {\n "audioUri": "",\n "dialogflowConversation": ""\n },\n "gcsSource": {\n "audioUri": "",\n "transcriptUri": ""\n }\n },\n "dialogflowIntents": {},\n "duration": "",\n "expireTime": "",\n "labels": {},\n "languageCode": "",\n "latestAnalysis": {\n "analysisResult": {\n "callAnalysisMetadata": {\n "annotations": [\n {\n "annotationEndBoundary": {\n "transcriptIndex": 0,\n "wordIndex": 0\n },\n "annotationStartBoundary": {},\n "channelTag": 0,\n "entityMentionData": {\n "entityUniqueId": "",\n "sentiment": {\n "magnitude": "",\n "score": ""\n },\n "type": ""\n },\n "holdData": {},\n "intentMatchData": {\n "intentUniqueId": ""\n },\n "interruptionData": {},\n "issueMatchData": {\n "issueAssignment": {\n "displayName": "",\n "issue": "",\n "score": ""\n }\n },\n "phraseMatchData": {\n "displayName": "",\n "phraseMatcher": ""\n },\n "sentimentData": {},\n "silenceData": {}\n }\n ],\n "entities": {},\n "intents": {},\n "issueModelResult": {\n "issueModel": "",\n "issues": [\n {}\n ]\n },\n "phraseMatchers": {},\n "sentiments": [\n {\n "channelTag": 0,\n "sentimentData": {}\n }\n ]\n },\n "endTime": ""\n },\n "annotatorSelector": {\n "issueModels": [],\n "phraseMatchers": [],\n "runEntityAnnotator": false,\n "runIntentAnnotator": false,\n "runInterruptionAnnotator": false,\n "runIssueModelAnnotator": false,\n "runPhraseMatcherAnnotator": false,\n "runSentimentAnnotator": false,\n "runSilenceAnnotator": false\n },\n "createTime": "",\n "name": "",\n "requestTime": ""\n },\n "medium": "",\n "name": "",\n "obfuscatedUserId": "",\n "runtimeAnnotations": [\n {\n "annotationId": "",\n "answerFeedback": {\n "clicked": false,\n "correctnessLevel": "",\n "displayed": false\n },\n "articleSuggestion": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "source": "",\n "title": "",\n "uri": ""\n },\n "createTime": "",\n "dialogflowInteraction": {\n "confidence": "",\n "dialogflowIntentId": ""\n },\n "endBoundary": {},\n "faqAnswer": {\n "answer": "",\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "question": "",\n "source": ""\n },\n "smartComposeSuggestion": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "suggestion": ""\n },\n "smartReply": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "reply": ""\n },\n "startBoundary": {}\n }\n ],\n "startTime": "",\n "transcript": {\n "transcriptSegments": [\n {\n "channelTag": 0,\n "confidence": "",\n "dialogflowSegmentMetadata": {\n "smartReplyAllowlistCovered": false\n },\n "languageCode": "",\n "messageTime": "",\n "segmentParticipant": {\n "dialogflowParticipant": "",\n "dialogflowParticipantName": "",\n "obfuscatedExternalUserId": "",\n "role": "",\n "userId": ""\n },\n "sentiment": {},\n "text": "",\n "words": [\n {\n "confidence": "",\n "endOffset": "",\n "startOffset": "",\n "word": ""\n }\n ]\n }\n ]\n },\n "ttl": "",\n "turnCount": 0,\n "updateTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/conversations',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
agentId: '',
callMetadata: {agentChannel: 0, customerChannel: 0},
createTime: '',
dataSource: {
dialogflowSource: {audioUri: '', dialogflowConversation: ''},
gcsSource: {audioUri: '', transcriptUri: ''}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {clicked: false, correctnessLevel: '', displayed: false},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {confidence: '', dialogflowIntentId: ''},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {confidenceScore: '', metadata: {}, queryRecord: '', suggestion: ''},
smartReply: {confidenceScore: '', metadata: {}, queryRecord: '', reply: ''},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {smartReplyAllowlistCovered: false},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [{confidence: '', endOffset: '', startOffset: '', word: ''}]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations',
headers: {'content-type': 'application/json'},
body: {
agentId: '',
callMetadata: {agentChannel: 0, customerChannel: 0},
createTime: '',
dataSource: {
dialogflowSource: {audioUri: '', dialogflowConversation: ''},
gcsSource: {audioUri: '', transcriptUri: ''}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {clicked: false, correctnessLevel: '', displayed: false},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {confidence: '', dialogflowIntentId: ''},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {confidenceScore: '', metadata: {}, queryRecord: '', suggestion: ''},
smartReply: {confidenceScore: '', metadata: {}, queryRecord: '', reply: ''},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {smartReplyAllowlistCovered: false},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [{confidence: '', endOffset: '', startOffset: '', word: ''}]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:parent/conversations');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
agentId: '',
callMetadata: {
agentChannel: 0,
customerChannel: 0
},
createTime: '',
dataSource: {
dialogflowSource: {
audioUri: '',
dialogflowConversation: ''
},
gcsSource: {
audioUri: '',
transcriptUri: ''
}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {
transcriptIndex: 0,
wordIndex: 0
},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {
entityUniqueId: '',
sentiment: {
magnitude: '',
score: ''
},
type: ''
},
holdData: {},
intentMatchData: {
intentUniqueId: ''
},
interruptionData: {},
issueMatchData: {
issueAssignment: {
displayName: '',
issue: '',
score: ''
}
},
phraseMatchData: {
displayName: '',
phraseMatcher: ''
},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {
issueModel: '',
issues: [
{}
]
},
phraseMatchers: {},
sentiments: [
{
channelTag: 0,
sentimentData: {}
}
]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {
clicked: false,
correctnessLevel: '',
displayed: false
},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {
confidence: '',
dialogflowIntentId: ''
},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
suggestion: ''
},
smartReply: {
confidenceScore: '',
metadata: {},
queryRecord: '',
reply: ''
},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {
smartReplyAllowlistCovered: false
},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [
{
confidence: '',
endOffset: '',
startOffset: '',
word: ''
}
]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations',
headers: {'content-type': 'application/json'},
data: {
agentId: '',
callMetadata: {agentChannel: 0, customerChannel: 0},
createTime: '',
dataSource: {
dialogflowSource: {audioUri: '', dialogflowConversation: ''},
gcsSource: {audioUri: '', transcriptUri: ''}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {clicked: false, correctnessLevel: '', displayed: false},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {confidence: '', dialogflowIntentId: ''},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {confidenceScore: '', metadata: {}, queryRecord: '', suggestion: ''},
smartReply: {confidenceScore: '', metadata: {}, queryRecord: '', reply: ''},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {smartReplyAllowlistCovered: false},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [{confidence: '', endOffset: '', startOffset: '', word: ''}]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/conversations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"agentId":"","callMetadata":{"agentChannel":0,"customerChannel":0},"createTime":"","dataSource":{"dialogflowSource":{"audioUri":"","dialogflowConversation":""},"gcsSource":{"audioUri":"","transcriptUri":""}},"dialogflowIntents":{},"duration":"","expireTime":"","labels":{},"languageCode":"","latestAnalysis":{"analysisResult":{"callAnalysisMetadata":{"annotations":[{"annotationEndBoundary":{"transcriptIndex":0,"wordIndex":0},"annotationStartBoundary":{},"channelTag":0,"entityMentionData":{"entityUniqueId":"","sentiment":{"magnitude":"","score":""},"type":""},"holdData":{},"intentMatchData":{"intentUniqueId":""},"interruptionData":{},"issueMatchData":{"issueAssignment":{"displayName":"","issue":"","score":""}},"phraseMatchData":{"displayName":"","phraseMatcher":""},"sentimentData":{},"silenceData":{}}],"entities":{},"intents":{},"issueModelResult":{"issueModel":"","issues":[{}]},"phraseMatchers":{},"sentiments":[{"channelTag":0,"sentimentData":{}}]},"endTime":""},"annotatorSelector":{"issueModels":[],"phraseMatchers":[],"runEntityAnnotator":false,"runIntentAnnotator":false,"runInterruptionAnnotator":false,"runIssueModelAnnotator":false,"runPhraseMatcherAnnotator":false,"runSentimentAnnotator":false,"runSilenceAnnotator":false},"createTime":"","name":"","requestTime":""},"medium":"","name":"","obfuscatedUserId":"","runtimeAnnotations":[{"annotationId":"","answerFeedback":{"clicked":false,"correctnessLevel":"","displayed":false},"articleSuggestion":{"confidenceScore":"","metadata":{},"queryRecord":"","source":"","title":"","uri":""},"createTime":"","dialogflowInteraction":{"confidence":"","dialogflowIntentId":""},"endBoundary":{},"faqAnswer":{"answer":"","confidenceScore":"","metadata":{},"queryRecord":"","question":"","source":""},"smartComposeSuggestion":{"confidenceScore":"","metadata":{},"queryRecord":"","suggestion":""},"smartReply":{"confidenceScore":"","metadata":{},"queryRecord":"","reply":""},"startBoundary":{}}],"startTime":"","transcript":{"transcriptSegments":[{"channelTag":0,"confidence":"","dialogflowSegmentMetadata":{"smartReplyAllowlistCovered":false},"languageCode":"","messageTime":"","segmentParticipant":{"dialogflowParticipant":"","dialogflowParticipantName":"","obfuscatedExternalUserId":"","role":"","userId":""},"sentiment":{},"text":"","words":[{"confidence":"","endOffset":"","startOffset":"","word":""}]}]},"ttl":"","turnCount":0,"updateTime":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"agentId": @"",
@"callMetadata": @{ @"agentChannel": @0, @"customerChannel": @0 },
@"createTime": @"",
@"dataSource": @{ @"dialogflowSource": @{ @"audioUri": @"", @"dialogflowConversation": @"" }, @"gcsSource": @{ @"audioUri": @"", @"transcriptUri": @"" } },
@"dialogflowIntents": @{ },
@"duration": @"",
@"expireTime": @"",
@"labels": @{ },
@"languageCode": @"",
@"latestAnalysis": @{ @"analysisResult": @{ @"callAnalysisMetadata": @{ @"annotations": @[ @{ @"annotationEndBoundary": @{ @"transcriptIndex": @0, @"wordIndex": @0 }, @"annotationStartBoundary": @{ }, @"channelTag": @0, @"entityMentionData": @{ @"entityUniqueId": @"", @"sentiment": @{ @"magnitude": @"", @"score": @"" }, @"type": @"" }, @"holdData": @{ }, @"intentMatchData": @{ @"intentUniqueId": @"" }, @"interruptionData": @{ }, @"issueMatchData": @{ @"issueAssignment": @{ @"displayName": @"", @"issue": @"", @"score": @"" } }, @"phraseMatchData": @{ @"displayName": @"", @"phraseMatcher": @"" }, @"sentimentData": @{ }, @"silenceData": @{ } } ], @"entities": @{ }, @"intents": @{ }, @"issueModelResult": @{ @"issueModel": @"", @"issues": @[ @{ } ] }, @"phraseMatchers": @{ }, @"sentiments": @[ @{ @"channelTag": @0, @"sentimentData": @{ } } ] }, @"endTime": @"" }, @"annotatorSelector": @{ @"issueModels": @[ ], @"phraseMatchers": @[ ], @"runEntityAnnotator": @NO, @"runIntentAnnotator": @NO, @"runInterruptionAnnotator": @NO, @"runIssueModelAnnotator": @NO, @"runPhraseMatcherAnnotator": @NO, @"runSentimentAnnotator": @NO, @"runSilenceAnnotator": @NO }, @"createTime": @"", @"name": @"", @"requestTime": @"" },
@"medium": @"",
@"name": @"",
@"obfuscatedUserId": @"",
@"runtimeAnnotations": @[ @{ @"annotationId": @"", @"answerFeedback": @{ @"clicked": @NO, @"correctnessLevel": @"", @"displayed": @NO }, @"articleSuggestion": @{ @"confidenceScore": @"", @"metadata": @{ }, @"queryRecord": @"", @"source": @"", @"title": @"", @"uri": @"" }, @"createTime": @"", @"dialogflowInteraction": @{ @"confidence": @"", @"dialogflowIntentId": @"" }, @"endBoundary": @{ }, @"faqAnswer": @{ @"answer": @"", @"confidenceScore": @"", @"metadata": @{ }, @"queryRecord": @"", @"question": @"", @"source": @"" }, @"smartComposeSuggestion": @{ @"confidenceScore": @"", @"metadata": @{ }, @"queryRecord": @"", @"suggestion": @"" }, @"smartReply": @{ @"confidenceScore": @"", @"metadata": @{ }, @"queryRecord": @"", @"reply": @"" }, @"startBoundary": @{ } } ],
@"startTime": @"",
@"transcript": @{ @"transcriptSegments": @[ @{ @"channelTag": @0, @"confidence": @"", @"dialogflowSegmentMetadata": @{ @"smartReplyAllowlistCovered": @NO }, @"languageCode": @"", @"messageTime": @"", @"segmentParticipant": @{ @"dialogflowParticipant": @"", @"dialogflowParticipantName": @"", @"obfuscatedExternalUserId": @"", @"role": @"", @"userId": @"" }, @"sentiment": @{ }, @"text": @"", @"words": @[ @{ @"confidence": @"", @"endOffset": @"", @"startOffset": @"", @"word": @"" } ] } ] },
@"ttl": @"",
@"turnCount": @0,
@"updateTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/conversations"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/conversations" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/conversations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agentId' => '',
'callMetadata' => [
'agentChannel' => 0,
'customerChannel' => 0
],
'createTime' => '',
'dataSource' => [
'dialogflowSource' => [
'audioUri' => '',
'dialogflowConversation' => ''
],
'gcsSource' => [
'audioUri' => '',
'transcriptUri' => ''
]
],
'dialogflowIntents' => [
],
'duration' => '',
'expireTime' => '',
'labels' => [
],
'languageCode' => '',
'latestAnalysis' => [
'analysisResult' => [
'callAnalysisMetadata' => [
'annotations' => [
[
'annotationEndBoundary' => [
'transcriptIndex' => 0,
'wordIndex' => 0
],
'annotationStartBoundary' => [
],
'channelTag' => 0,
'entityMentionData' => [
'entityUniqueId' => '',
'sentiment' => [
'magnitude' => '',
'score' => ''
],
'type' => ''
],
'holdData' => [
],
'intentMatchData' => [
'intentUniqueId' => ''
],
'interruptionData' => [
],
'issueMatchData' => [
'issueAssignment' => [
'displayName' => '',
'issue' => '',
'score' => ''
]
],
'phraseMatchData' => [
'displayName' => '',
'phraseMatcher' => ''
],
'sentimentData' => [
],
'silenceData' => [
]
]
],
'entities' => [
],
'intents' => [
],
'issueModelResult' => [
'issueModel' => '',
'issues' => [
[
]
]
],
'phraseMatchers' => [
],
'sentiments' => [
[
'channelTag' => 0,
'sentimentData' => [
]
]
]
],
'endTime' => ''
],
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'createTime' => '',
'name' => '',
'requestTime' => ''
],
'medium' => '',
'name' => '',
'obfuscatedUserId' => '',
'runtimeAnnotations' => [
[
'annotationId' => '',
'answerFeedback' => [
'clicked' => null,
'correctnessLevel' => '',
'displayed' => null
],
'articleSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'source' => '',
'title' => '',
'uri' => ''
],
'createTime' => '',
'dialogflowInteraction' => [
'confidence' => '',
'dialogflowIntentId' => ''
],
'endBoundary' => [
],
'faqAnswer' => [
'answer' => '',
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'question' => '',
'source' => ''
],
'smartComposeSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'suggestion' => ''
],
'smartReply' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'reply' => ''
],
'startBoundary' => [
]
]
],
'startTime' => '',
'transcript' => [
'transcriptSegments' => [
[
'channelTag' => 0,
'confidence' => '',
'dialogflowSegmentMetadata' => [
'smartReplyAllowlistCovered' => null
],
'languageCode' => '',
'messageTime' => '',
'segmentParticipant' => [
'dialogflowParticipant' => '',
'dialogflowParticipantName' => '',
'obfuscatedExternalUserId' => '',
'role' => '',
'userId' => ''
],
'sentiment' => [
],
'text' => '',
'words' => [
[
'confidence' => '',
'endOffset' => '',
'startOffset' => '',
'word' => ''
]
]
]
]
],
'ttl' => '',
'turnCount' => 0,
'updateTime' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:parent/conversations', [
'body' => '{
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/conversations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'agentId' => '',
'callMetadata' => [
'agentChannel' => 0,
'customerChannel' => 0
],
'createTime' => '',
'dataSource' => [
'dialogflowSource' => [
'audioUri' => '',
'dialogflowConversation' => ''
],
'gcsSource' => [
'audioUri' => '',
'transcriptUri' => ''
]
],
'dialogflowIntents' => [
],
'duration' => '',
'expireTime' => '',
'labels' => [
],
'languageCode' => '',
'latestAnalysis' => [
'analysisResult' => [
'callAnalysisMetadata' => [
'annotations' => [
[
'annotationEndBoundary' => [
'transcriptIndex' => 0,
'wordIndex' => 0
],
'annotationStartBoundary' => [
],
'channelTag' => 0,
'entityMentionData' => [
'entityUniqueId' => '',
'sentiment' => [
'magnitude' => '',
'score' => ''
],
'type' => ''
],
'holdData' => [
],
'intentMatchData' => [
'intentUniqueId' => ''
],
'interruptionData' => [
],
'issueMatchData' => [
'issueAssignment' => [
'displayName' => '',
'issue' => '',
'score' => ''
]
],
'phraseMatchData' => [
'displayName' => '',
'phraseMatcher' => ''
],
'sentimentData' => [
],
'silenceData' => [
]
]
],
'entities' => [
],
'intents' => [
],
'issueModelResult' => [
'issueModel' => '',
'issues' => [
[
]
]
],
'phraseMatchers' => [
],
'sentiments' => [
[
'channelTag' => 0,
'sentimentData' => [
]
]
]
],
'endTime' => ''
],
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'createTime' => '',
'name' => '',
'requestTime' => ''
],
'medium' => '',
'name' => '',
'obfuscatedUserId' => '',
'runtimeAnnotations' => [
[
'annotationId' => '',
'answerFeedback' => [
'clicked' => null,
'correctnessLevel' => '',
'displayed' => null
],
'articleSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'source' => '',
'title' => '',
'uri' => ''
],
'createTime' => '',
'dialogflowInteraction' => [
'confidence' => '',
'dialogflowIntentId' => ''
],
'endBoundary' => [
],
'faqAnswer' => [
'answer' => '',
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'question' => '',
'source' => ''
],
'smartComposeSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'suggestion' => ''
],
'smartReply' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'reply' => ''
],
'startBoundary' => [
]
]
],
'startTime' => '',
'transcript' => [
'transcriptSegments' => [
[
'channelTag' => 0,
'confidence' => '',
'dialogflowSegmentMetadata' => [
'smartReplyAllowlistCovered' => null
],
'languageCode' => '',
'messageTime' => '',
'segmentParticipant' => [
'dialogflowParticipant' => '',
'dialogflowParticipantName' => '',
'obfuscatedExternalUserId' => '',
'role' => '',
'userId' => ''
],
'sentiment' => [
],
'text' => '',
'words' => [
[
'confidence' => '',
'endOffset' => '',
'startOffset' => '',
'word' => ''
]
]
]
]
],
'ttl' => '',
'turnCount' => 0,
'updateTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'agentId' => '',
'callMetadata' => [
'agentChannel' => 0,
'customerChannel' => 0
],
'createTime' => '',
'dataSource' => [
'dialogflowSource' => [
'audioUri' => '',
'dialogflowConversation' => ''
],
'gcsSource' => [
'audioUri' => '',
'transcriptUri' => ''
]
],
'dialogflowIntents' => [
],
'duration' => '',
'expireTime' => '',
'labels' => [
],
'languageCode' => '',
'latestAnalysis' => [
'analysisResult' => [
'callAnalysisMetadata' => [
'annotations' => [
[
'annotationEndBoundary' => [
'transcriptIndex' => 0,
'wordIndex' => 0
],
'annotationStartBoundary' => [
],
'channelTag' => 0,
'entityMentionData' => [
'entityUniqueId' => '',
'sentiment' => [
'magnitude' => '',
'score' => ''
],
'type' => ''
],
'holdData' => [
],
'intentMatchData' => [
'intentUniqueId' => ''
],
'interruptionData' => [
],
'issueMatchData' => [
'issueAssignment' => [
'displayName' => '',
'issue' => '',
'score' => ''
]
],
'phraseMatchData' => [
'displayName' => '',
'phraseMatcher' => ''
],
'sentimentData' => [
],
'silenceData' => [
]
]
],
'entities' => [
],
'intents' => [
],
'issueModelResult' => [
'issueModel' => '',
'issues' => [
[
]
]
],
'phraseMatchers' => [
],
'sentiments' => [
[
'channelTag' => 0,
'sentimentData' => [
]
]
]
],
'endTime' => ''
],
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'createTime' => '',
'name' => '',
'requestTime' => ''
],
'medium' => '',
'name' => '',
'obfuscatedUserId' => '',
'runtimeAnnotations' => [
[
'annotationId' => '',
'answerFeedback' => [
'clicked' => null,
'correctnessLevel' => '',
'displayed' => null
],
'articleSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'source' => '',
'title' => '',
'uri' => ''
],
'createTime' => '',
'dialogflowInteraction' => [
'confidence' => '',
'dialogflowIntentId' => ''
],
'endBoundary' => [
],
'faqAnswer' => [
'answer' => '',
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'question' => '',
'source' => ''
],
'smartComposeSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'suggestion' => ''
],
'smartReply' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'reply' => ''
],
'startBoundary' => [
]
]
],
'startTime' => '',
'transcript' => [
'transcriptSegments' => [
[
'channelTag' => 0,
'confidence' => '',
'dialogflowSegmentMetadata' => [
'smartReplyAllowlistCovered' => null
],
'languageCode' => '',
'messageTime' => '',
'segmentParticipant' => [
'dialogflowParticipant' => '',
'dialogflowParticipantName' => '',
'obfuscatedExternalUserId' => '',
'role' => '',
'userId' => ''
],
'sentiment' => [
],
'text' => '',
'words' => [
[
'confidence' => '',
'endOffset' => '',
'startOffset' => '',
'word' => ''
]
]
]
]
],
'ttl' => '',
'turnCount' => 0,
'updateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:parent/conversations');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/conversations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/conversations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:parent/conversations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/conversations"
payload = {
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": { "intentUniqueId": "" },
"interruptionData": {},
"issueMatchData": { "issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
} },
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [{}]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": False,
"runIntentAnnotator": False,
"runInterruptionAnnotator": False,
"runIssueModelAnnotator": False,
"runPhraseMatcherAnnotator": False,
"runSentimentAnnotator": False,
"runSilenceAnnotator": False
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": False,
"correctnessLevel": "",
"displayed": False
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": { "transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": { "smartReplyAllowlistCovered": False },
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
] },
"ttl": "",
"turnCount": 0,
"updateTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/conversations"
payload <- "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:parent/conversations') do |req|
req.body = "{\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/conversations";
let payload = json!({
"agentId": "",
"callMetadata": json!({
"agentChannel": 0,
"customerChannel": 0
}),
"createTime": "",
"dataSource": json!({
"dialogflowSource": json!({
"audioUri": "",
"dialogflowConversation": ""
}),
"gcsSource": json!({
"audioUri": "",
"transcriptUri": ""
})
}),
"dialogflowIntents": json!({}),
"duration": "",
"expireTime": "",
"labels": json!({}),
"languageCode": "",
"latestAnalysis": json!({
"analysisResult": json!({
"callAnalysisMetadata": json!({
"annotations": (
json!({
"annotationEndBoundary": json!({
"transcriptIndex": 0,
"wordIndex": 0
}),
"annotationStartBoundary": json!({}),
"channelTag": 0,
"entityMentionData": json!({
"entityUniqueId": "",
"sentiment": json!({
"magnitude": "",
"score": ""
}),
"type": ""
}),
"holdData": json!({}),
"intentMatchData": json!({"intentUniqueId": ""}),
"interruptionData": json!({}),
"issueMatchData": json!({"issueAssignment": json!({
"displayName": "",
"issue": "",
"score": ""
})}),
"phraseMatchData": json!({
"displayName": "",
"phraseMatcher": ""
}),
"sentimentData": json!({}),
"silenceData": json!({})
})
),
"entities": json!({}),
"intents": json!({}),
"issueModelResult": json!({
"issueModel": "",
"issues": (json!({}))
}),
"phraseMatchers": json!({}),
"sentiments": (
json!({
"channelTag": 0,
"sentimentData": json!({})
})
)
}),
"endTime": ""
}),
"annotatorSelector": json!({
"issueModels": (),
"phraseMatchers": (),
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
}),
"createTime": "",
"name": "",
"requestTime": ""
}),
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": (
json!({
"annotationId": "",
"answerFeedback": json!({
"clicked": false,
"correctnessLevel": "",
"displayed": false
}),
"articleSuggestion": json!({
"confidenceScore": "",
"metadata": json!({}),
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
}),
"createTime": "",
"dialogflowInteraction": json!({
"confidence": "",
"dialogflowIntentId": ""
}),
"endBoundary": json!({}),
"faqAnswer": json!({
"answer": "",
"confidenceScore": "",
"metadata": json!({}),
"queryRecord": "",
"question": "",
"source": ""
}),
"smartComposeSuggestion": json!({
"confidenceScore": "",
"metadata": json!({}),
"queryRecord": "",
"suggestion": ""
}),
"smartReply": json!({
"confidenceScore": "",
"metadata": json!({}),
"queryRecord": "",
"reply": ""
}),
"startBoundary": json!({})
})
),
"startTime": "",
"transcript": json!({"transcriptSegments": (
json!({
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": json!({"smartReplyAllowlistCovered": false}),
"languageCode": "",
"messageTime": "",
"segmentParticipant": json!({
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
}),
"sentiment": json!({}),
"text": "",
"words": (
json!({
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
})
)
})
)}),
"ttl": "",
"turnCount": 0,
"updateTime": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:parent/conversations \
--header 'content-type: application/json' \
--data '{
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
}'
echo '{
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
}' | \
http POST {{baseUrl}}/v1/:parent/conversations \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "agentId": "",\n "callMetadata": {\n "agentChannel": 0,\n "customerChannel": 0\n },\n "createTime": "",\n "dataSource": {\n "dialogflowSource": {\n "audioUri": "",\n "dialogflowConversation": ""\n },\n "gcsSource": {\n "audioUri": "",\n "transcriptUri": ""\n }\n },\n "dialogflowIntents": {},\n "duration": "",\n "expireTime": "",\n "labels": {},\n "languageCode": "",\n "latestAnalysis": {\n "analysisResult": {\n "callAnalysisMetadata": {\n "annotations": [\n {\n "annotationEndBoundary": {\n "transcriptIndex": 0,\n "wordIndex": 0\n },\n "annotationStartBoundary": {},\n "channelTag": 0,\n "entityMentionData": {\n "entityUniqueId": "",\n "sentiment": {\n "magnitude": "",\n "score": ""\n },\n "type": ""\n },\n "holdData": {},\n "intentMatchData": {\n "intentUniqueId": ""\n },\n "interruptionData": {},\n "issueMatchData": {\n "issueAssignment": {\n "displayName": "",\n "issue": "",\n "score": ""\n }\n },\n "phraseMatchData": {\n "displayName": "",\n "phraseMatcher": ""\n },\n "sentimentData": {},\n "silenceData": {}\n }\n ],\n "entities": {},\n "intents": {},\n "issueModelResult": {\n "issueModel": "",\n "issues": [\n {}\n ]\n },\n "phraseMatchers": {},\n "sentiments": [\n {\n "channelTag": 0,\n "sentimentData": {}\n }\n ]\n },\n "endTime": ""\n },\n "annotatorSelector": {\n "issueModels": [],\n "phraseMatchers": [],\n "runEntityAnnotator": false,\n "runIntentAnnotator": false,\n "runInterruptionAnnotator": false,\n "runIssueModelAnnotator": false,\n "runPhraseMatcherAnnotator": false,\n "runSentimentAnnotator": false,\n "runSilenceAnnotator": false\n },\n "createTime": "",\n "name": "",\n "requestTime": ""\n },\n "medium": "",\n "name": "",\n "obfuscatedUserId": "",\n "runtimeAnnotations": [\n {\n "annotationId": "",\n "answerFeedback": {\n "clicked": false,\n "correctnessLevel": "",\n "displayed": false\n },\n "articleSuggestion": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "source": "",\n "title": "",\n "uri": ""\n },\n "createTime": "",\n "dialogflowInteraction": {\n "confidence": "",\n "dialogflowIntentId": ""\n },\n "endBoundary": {},\n "faqAnswer": {\n "answer": "",\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "question": "",\n "source": ""\n },\n "smartComposeSuggestion": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "suggestion": ""\n },\n "smartReply": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "reply": ""\n },\n "startBoundary": {}\n }\n ],\n "startTime": "",\n "transcript": {\n "transcriptSegments": [\n {\n "channelTag": 0,\n "confidence": "",\n "dialogflowSegmentMetadata": {\n "smartReplyAllowlistCovered": false\n },\n "languageCode": "",\n "messageTime": "",\n "segmentParticipant": {\n "dialogflowParticipant": "",\n "dialogflowParticipantName": "",\n "obfuscatedExternalUserId": "",\n "role": "",\n "userId": ""\n },\n "sentiment": {},\n "text": "",\n "words": [\n {\n "confidence": "",\n "endOffset": "",\n "startOffset": "",\n "word": ""\n }\n ]\n }\n ]\n },\n "ttl": "",\n "turnCount": 0,\n "updateTime": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:parent/conversations
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"agentId": "",
"callMetadata": [
"agentChannel": 0,
"customerChannel": 0
],
"createTime": "",
"dataSource": [
"dialogflowSource": [
"audioUri": "",
"dialogflowConversation": ""
],
"gcsSource": [
"audioUri": "",
"transcriptUri": ""
]
],
"dialogflowIntents": [],
"duration": "",
"expireTime": "",
"labels": [],
"languageCode": "",
"latestAnalysis": [
"analysisResult": [
"callAnalysisMetadata": [
"annotations": [
[
"annotationEndBoundary": [
"transcriptIndex": 0,
"wordIndex": 0
],
"annotationStartBoundary": [],
"channelTag": 0,
"entityMentionData": [
"entityUniqueId": "",
"sentiment": [
"magnitude": "",
"score": ""
],
"type": ""
],
"holdData": [],
"intentMatchData": ["intentUniqueId": ""],
"interruptionData": [],
"issueMatchData": ["issueAssignment": [
"displayName": "",
"issue": "",
"score": ""
]],
"phraseMatchData": [
"displayName": "",
"phraseMatcher": ""
],
"sentimentData": [],
"silenceData": []
]
],
"entities": [],
"intents": [],
"issueModelResult": [
"issueModel": "",
"issues": [[]]
],
"phraseMatchers": [],
"sentiments": [
[
"channelTag": 0,
"sentimentData": []
]
]
],
"endTime": ""
],
"annotatorSelector": [
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
],
"createTime": "",
"name": "",
"requestTime": ""
],
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
[
"annotationId": "",
"answerFeedback": [
"clicked": false,
"correctnessLevel": "",
"displayed": false
],
"articleSuggestion": [
"confidenceScore": "",
"metadata": [],
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
],
"createTime": "",
"dialogflowInteraction": [
"confidence": "",
"dialogflowIntentId": ""
],
"endBoundary": [],
"faqAnswer": [
"answer": "",
"confidenceScore": "",
"metadata": [],
"queryRecord": "",
"question": "",
"source": ""
],
"smartComposeSuggestion": [
"confidenceScore": "",
"metadata": [],
"queryRecord": "",
"suggestion": ""
],
"smartReply": [
"confidenceScore": "",
"metadata": [],
"queryRecord": "",
"reply": ""
],
"startBoundary": []
]
],
"startTime": "",
"transcript": ["transcriptSegments": [
[
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": ["smartReplyAllowlistCovered": false],
"languageCode": "",
"messageTime": "",
"segmentParticipant": [
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
],
"sentiment": [],
"text": "",
"words": [
[
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
]
]
]
]],
"ttl": "",
"turnCount": 0,
"updateTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/conversations")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.conversations.ingest
{{baseUrl}}/v1/:parent/conversations:ingest
QUERY PARAMS
parent
BODY json
{
"conversationConfig": {
"agentId": ""
},
"gcsSource": {
"bucketUri": ""
},
"parent": "",
"transcriptObjectConfig": {
"medium": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/conversations:ingest");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:parent/conversations:ingest" {:content-type :json
:form-params {:conversationConfig {:agentId ""}
:gcsSource {:bucketUri ""}
:parent ""
:transcriptObjectConfig {:medium ""}}})
require "http/client"
url = "{{baseUrl}}/v1/:parent/conversations:ingest"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/conversations:ingest"),
Content = new StringContent("{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/conversations:ingest");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/conversations:ingest"
payload := strings.NewReader("{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:parent/conversations:ingest HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 161
{
"conversationConfig": {
"agentId": ""
},
"gcsSource": {
"bucketUri": ""
},
"parent": "",
"transcriptObjectConfig": {
"medium": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:parent/conversations:ingest")
.setHeader("content-type", "application/json")
.setBody("{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/conversations:ingest"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations:ingest")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:parent/conversations:ingest")
.header("content-type", "application/json")
.body("{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
conversationConfig: {
agentId: ''
},
gcsSource: {
bucketUri: ''
},
parent: '',
transcriptObjectConfig: {
medium: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:parent/conversations:ingest');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations:ingest',
headers: {'content-type': 'application/json'},
data: {
conversationConfig: {agentId: ''},
gcsSource: {bucketUri: ''},
parent: '',
transcriptObjectConfig: {medium: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/conversations:ingest';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"conversationConfig":{"agentId":""},"gcsSource":{"bucketUri":""},"parent":"","transcriptObjectConfig":{"medium":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/conversations:ingest',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "conversationConfig": {\n "agentId": ""\n },\n "gcsSource": {\n "bucketUri": ""\n },\n "parent": "",\n "transcriptObjectConfig": {\n "medium": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations:ingest")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/conversations:ingest',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
conversationConfig: {agentId: ''},
gcsSource: {bucketUri: ''},
parent: '',
transcriptObjectConfig: {medium: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations:ingest',
headers: {'content-type': 'application/json'},
body: {
conversationConfig: {agentId: ''},
gcsSource: {bucketUri: ''},
parent: '',
transcriptObjectConfig: {medium: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:parent/conversations:ingest');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
conversationConfig: {
agentId: ''
},
gcsSource: {
bucketUri: ''
},
parent: '',
transcriptObjectConfig: {
medium: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations:ingest',
headers: {'content-type': 'application/json'},
data: {
conversationConfig: {agentId: ''},
gcsSource: {bucketUri: ''},
parent: '',
transcriptObjectConfig: {medium: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/conversations:ingest';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"conversationConfig":{"agentId":""},"gcsSource":{"bucketUri":""},"parent":"","transcriptObjectConfig":{"medium":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"conversationConfig": @{ @"agentId": @"" },
@"gcsSource": @{ @"bucketUri": @"" },
@"parent": @"",
@"transcriptObjectConfig": @{ @"medium": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/conversations:ingest"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/conversations:ingest" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/conversations:ingest",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conversationConfig' => [
'agentId' => ''
],
'gcsSource' => [
'bucketUri' => ''
],
'parent' => '',
'transcriptObjectConfig' => [
'medium' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:parent/conversations:ingest', [
'body' => '{
"conversationConfig": {
"agentId": ""
},
"gcsSource": {
"bucketUri": ""
},
"parent": "",
"transcriptObjectConfig": {
"medium": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/conversations:ingest');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'conversationConfig' => [
'agentId' => ''
],
'gcsSource' => [
'bucketUri' => ''
],
'parent' => '',
'transcriptObjectConfig' => [
'medium' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'conversationConfig' => [
'agentId' => ''
],
'gcsSource' => [
'bucketUri' => ''
],
'parent' => '',
'transcriptObjectConfig' => [
'medium' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/:parent/conversations:ingest');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/conversations:ingest' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"conversationConfig": {
"agentId": ""
},
"gcsSource": {
"bucketUri": ""
},
"parent": "",
"transcriptObjectConfig": {
"medium": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/conversations:ingest' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"conversationConfig": {
"agentId": ""
},
"gcsSource": {
"bucketUri": ""
},
"parent": "",
"transcriptObjectConfig": {
"medium": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:parent/conversations:ingest", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/conversations:ingest"
payload = {
"conversationConfig": { "agentId": "" },
"gcsSource": { "bucketUri": "" },
"parent": "",
"transcriptObjectConfig": { "medium": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/conversations:ingest"
payload <- "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/conversations:ingest")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:parent/conversations:ingest') do |req|
req.body = "{\n \"conversationConfig\": {\n \"agentId\": \"\"\n },\n \"gcsSource\": {\n \"bucketUri\": \"\"\n },\n \"parent\": \"\",\n \"transcriptObjectConfig\": {\n \"medium\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/conversations:ingest";
let payload = json!({
"conversationConfig": json!({"agentId": ""}),
"gcsSource": json!({"bucketUri": ""}),
"parent": "",
"transcriptObjectConfig": json!({"medium": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:parent/conversations:ingest \
--header 'content-type: application/json' \
--data '{
"conversationConfig": {
"agentId": ""
},
"gcsSource": {
"bucketUri": ""
},
"parent": "",
"transcriptObjectConfig": {
"medium": ""
}
}'
echo '{
"conversationConfig": {
"agentId": ""
},
"gcsSource": {
"bucketUri": ""
},
"parent": "",
"transcriptObjectConfig": {
"medium": ""
}
}' | \
http POST {{baseUrl}}/v1/:parent/conversations:ingest \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "conversationConfig": {\n "agentId": ""\n },\n "gcsSource": {\n "bucketUri": ""\n },\n "parent": "",\n "transcriptObjectConfig": {\n "medium": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v1/:parent/conversations:ingest
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"conversationConfig": ["agentId": ""],
"gcsSource": ["bucketUri": ""],
"parent": "",
"transcriptObjectConfig": ["medium": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/conversations:ingest")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.conversations.list
{{baseUrl}}/v1/:parent/conversations
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/conversations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:parent/conversations")
require "http/client"
url = "{{baseUrl}}/v1/:parent/conversations"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/conversations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/conversations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/conversations"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:parent/conversations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:parent/conversations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/conversations"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:parent/conversations")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:parent/conversations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/conversations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/conversations';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/conversations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/conversations',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/conversations'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:parent/conversations');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/conversations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/conversations';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/conversations"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/conversations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/conversations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:parent/conversations');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/conversations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:parent/conversations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/conversations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/conversations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:parent/conversations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/conversations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/conversations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/conversations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:parent/conversations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/conversations";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:parent/conversations
http GET {{baseUrl}}/v1/:parent/conversations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:parent/conversations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/conversations")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.conversations.upload
{{baseUrl}}/v1/:parent/conversations:upload
QUERY PARAMS
parent
BODY json
{
"conversation": {
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
},
"conversationId": "",
"parent": "",
"redactionConfig": {
"deidentifyTemplate": "",
"inspectTemplate": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/conversations:upload");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:parent/conversations:upload" {:content-type :json
:form-params {:conversation {:agentId ""
:callMetadata {:agentChannel 0
:customerChannel 0}
:createTime ""
:dataSource {:dialogflowSource {:audioUri ""
:dialogflowConversation ""}
:gcsSource {:audioUri ""
:transcriptUri ""}}
:dialogflowIntents {}
:duration ""
:expireTime ""
:labels {}
:languageCode ""
:latestAnalysis {:analysisResult {:callAnalysisMetadata {:annotations [{:annotationEndBoundary {:transcriptIndex 0
:wordIndex 0}
:annotationStartBoundary {}
:channelTag 0
:entityMentionData {:entityUniqueId ""
:sentiment {:magnitude ""
:score ""}
:type ""}
:holdData {}
:intentMatchData {:intentUniqueId ""}
:interruptionData {}
:issueMatchData {:issueAssignment {:displayName ""
:issue ""
:score ""}}
:phraseMatchData {:displayName ""
:phraseMatcher ""}
:sentimentData {}
:silenceData {}}]
:entities {}
:intents {}
:issueModelResult {:issueModel ""
:issues [{}]}
:phraseMatchers {}
:sentiments [{:channelTag 0
:sentimentData {}}]}
:endTime ""}
:annotatorSelector {:issueModels []
:phraseMatchers []
:runEntityAnnotator false
:runIntentAnnotator false
:runInterruptionAnnotator false
:runIssueModelAnnotator false
:runPhraseMatcherAnnotator false
:runSentimentAnnotator false
:runSilenceAnnotator false}
:createTime ""
:name ""
:requestTime ""}
:medium ""
:name ""
:obfuscatedUserId ""
:runtimeAnnotations [{:annotationId ""
:answerFeedback {:clicked false
:correctnessLevel ""
:displayed false}
:articleSuggestion {:confidenceScore ""
:metadata {}
:queryRecord ""
:source ""
:title ""
:uri ""}
:createTime ""
:dialogflowInteraction {:confidence ""
:dialogflowIntentId ""}
:endBoundary {}
:faqAnswer {:answer ""
:confidenceScore ""
:metadata {}
:queryRecord ""
:question ""
:source ""}
:smartComposeSuggestion {:confidenceScore ""
:metadata {}
:queryRecord ""
:suggestion ""}
:smartReply {:confidenceScore ""
:metadata {}
:queryRecord ""
:reply ""}
:startBoundary {}}]
:startTime ""
:transcript {:transcriptSegments [{:channelTag 0
:confidence ""
:dialogflowSegmentMetadata {:smartReplyAllowlistCovered false}
:languageCode ""
:messageTime ""
:segmentParticipant {:dialogflowParticipant ""
:dialogflowParticipantName ""
:obfuscatedExternalUserId ""
:role ""
:userId ""}
:sentiment {}
:text ""
:words [{:confidence ""
:endOffset ""
:startOffset ""
:word ""}]}]}
:ttl ""
:turnCount 0
:updateTime ""}
:conversationId ""
:parent ""
:redactionConfig {:deidentifyTemplate ""
:inspectTemplate ""}}})
require "http/client"
url = "{{baseUrl}}/v1/:parent/conversations:upload"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/conversations:upload"),
Content = new StringContent("{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/conversations:upload");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/conversations:upload"
payload := strings.NewReader("{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:parent/conversations:upload HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 4560
{
"conversation": {
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
},
"conversationId": "",
"parent": "",
"redactionConfig": {
"deidentifyTemplate": "",
"inspectTemplate": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:parent/conversations:upload")
.setHeader("content-type", "application/json")
.setBody("{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/conversations:upload"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations:upload")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:parent/conversations:upload")
.header("content-type", "application/json")
.body("{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
conversation: {
agentId: '',
callMetadata: {
agentChannel: 0,
customerChannel: 0
},
createTime: '',
dataSource: {
dialogflowSource: {
audioUri: '',
dialogflowConversation: ''
},
gcsSource: {
audioUri: '',
transcriptUri: ''
}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {
transcriptIndex: 0,
wordIndex: 0
},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {
entityUniqueId: '',
sentiment: {
magnitude: '',
score: ''
},
type: ''
},
holdData: {},
intentMatchData: {
intentUniqueId: ''
},
interruptionData: {},
issueMatchData: {
issueAssignment: {
displayName: '',
issue: '',
score: ''
}
},
phraseMatchData: {
displayName: '',
phraseMatcher: ''
},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {
issueModel: '',
issues: [
{}
]
},
phraseMatchers: {},
sentiments: [
{
channelTag: 0,
sentimentData: {}
}
]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {
clicked: false,
correctnessLevel: '',
displayed: false
},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {
confidence: '',
dialogflowIntentId: ''
},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
suggestion: ''
},
smartReply: {
confidenceScore: '',
metadata: {},
queryRecord: '',
reply: ''
},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {
smartReplyAllowlistCovered: false
},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [
{
confidence: '',
endOffset: '',
startOffset: '',
word: ''
}
]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
},
conversationId: '',
parent: '',
redactionConfig: {
deidentifyTemplate: '',
inspectTemplate: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:parent/conversations:upload');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations:upload',
headers: {'content-type': 'application/json'},
data: {
conversation: {
agentId: '',
callMetadata: {agentChannel: 0, customerChannel: 0},
createTime: '',
dataSource: {
dialogflowSource: {audioUri: '', dialogflowConversation: ''},
gcsSource: {audioUri: '', transcriptUri: ''}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {clicked: false, correctnessLevel: '', displayed: false},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {confidence: '', dialogflowIntentId: ''},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {confidenceScore: '', metadata: {}, queryRecord: '', suggestion: ''},
smartReply: {confidenceScore: '', metadata: {}, queryRecord: '', reply: ''},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {smartReplyAllowlistCovered: false},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [{confidence: '', endOffset: '', startOffset: '', word: ''}]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
},
conversationId: '',
parent: '',
redactionConfig: {deidentifyTemplate: '', inspectTemplate: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/conversations:upload';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"conversation":{"agentId":"","callMetadata":{"agentChannel":0,"customerChannel":0},"createTime":"","dataSource":{"dialogflowSource":{"audioUri":"","dialogflowConversation":""},"gcsSource":{"audioUri":"","transcriptUri":""}},"dialogflowIntents":{},"duration":"","expireTime":"","labels":{},"languageCode":"","latestAnalysis":{"analysisResult":{"callAnalysisMetadata":{"annotations":[{"annotationEndBoundary":{"transcriptIndex":0,"wordIndex":0},"annotationStartBoundary":{},"channelTag":0,"entityMentionData":{"entityUniqueId":"","sentiment":{"magnitude":"","score":""},"type":""},"holdData":{},"intentMatchData":{"intentUniqueId":""},"interruptionData":{},"issueMatchData":{"issueAssignment":{"displayName":"","issue":"","score":""}},"phraseMatchData":{"displayName":"","phraseMatcher":""},"sentimentData":{},"silenceData":{}}],"entities":{},"intents":{},"issueModelResult":{"issueModel":"","issues":[{}]},"phraseMatchers":{},"sentiments":[{"channelTag":0,"sentimentData":{}}]},"endTime":""},"annotatorSelector":{"issueModels":[],"phraseMatchers":[],"runEntityAnnotator":false,"runIntentAnnotator":false,"runInterruptionAnnotator":false,"runIssueModelAnnotator":false,"runPhraseMatcherAnnotator":false,"runSentimentAnnotator":false,"runSilenceAnnotator":false},"createTime":"","name":"","requestTime":""},"medium":"","name":"","obfuscatedUserId":"","runtimeAnnotations":[{"annotationId":"","answerFeedback":{"clicked":false,"correctnessLevel":"","displayed":false},"articleSuggestion":{"confidenceScore":"","metadata":{},"queryRecord":"","source":"","title":"","uri":""},"createTime":"","dialogflowInteraction":{"confidence":"","dialogflowIntentId":""},"endBoundary":{},"faqAnswer":{"answer":"","confidenceScore":"","metadata":{},"queryRecord":"","question":"","source":""},"smartComposeSuggestion":{"confidenceScore":"","metadata":{},"queryRecord":"","suggestion":""},"smartReply":{"confidenceScore":"","metadata":{},"queryRecord":"","reply":""},"startBoundary":{}}],"startTime":"","transcript":{"transcriptSegments":[{"channelTag":0,"confidence":"","dialogflowSegmentMetadata":{"smartReplyAllowlistCovered":false},"languageCode":"","messageTime":"","segmentParticipant":{"dialogflowParticipant":"","dialogflowParticipantName":"","obfuscatedExternalUserId":"","role":"","userId":""},"sentiment":{},"text":"","words":[{"confidence":"","endOffset":"","startOffset":"","word":""}]}]},"ttl":"","turnCount":0,"updateTime":""},"conversationId":"","parent":"","redactionConfig":{"deidentifyTemplate":"","inspectTemplate":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/conversations:upload',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "conversation": {\n "agentId": "",\n "callMetadata": {\n "agentChannel": 0,\n "customerChannel": 0\n },\n "createTime": "",\n "dataSource": {\n "dialogflowSource": {\n "audioUri": "",\n "dialogflowConversation": ""\n },\n "gcsSource": {\n "audioUri": "",\n "transcriptUri": ""\n }\n },\n "dialogflowIntents": {},\n "duration": "",\n "expireTime": "",\n "labels": {},\n "languageCode": "",\n "latestAnalysis": {\n "analysisResult": {\n "callAnalysisMetadata": {\n "annotations": [\n {\n "annotationEndBoundary": {\n "transcriptIndex": 0,\n "wordIndex": 0\n },\n "annotationStartBoundary": {},\n "channelTag": 0,\n "entityMentionData": {\n "entityUniqueId": "",\n "sentiment": {\n "magnitude": "",\n "score": ""\n },\n "type": ""\n },\n "holdData": {},\n "intentMatchData": {\n "intentUniqueId": ""\n },\n "interruptionData": {},\n "issueMatchData": {\n "issueAssignment": {\n "displayName": "",\n "issue": "",\n "score": ""\n }\n },\n "phraseMatchData": {\n "displayName": "",\n "phraseMatcher": ""\n },\n "sentimentData": {},\n "silenceData": {}\n }\n ],\n "entities": {},\n "intents": {},\n "issueModelResult": {\n "issueModel": "",\n "issues": [\n {}\n ]\n },\n "phraseMatchers": {},\n "sentiments": [\n {\n "channelTag": 0,\n "sentimentData": {}\n }\n ]\n },\n "endTime": ""\n },\n "annotatorSelector": {\n "issueModels": [],\n "phraseMatchers": [],\n "runEntityAnnotator": false,\n "runIntentAnnotator": false,\n "runInterruptionAnnotator": false,\n "runIssueModelAnnotator": false,\n "runPhraseMatcherAnnotator": false,\n "runSentimentAnnotator": false,\n "runSilenceAnnotator": false\n },\n "createTime": "",\n "name": "",\n "requestTime": ""\n },\n "medium": "",\n "name": "",\n "obfuscatedUserId": "",\n "runtimeAnnotations": [\n {\n "annotationId": "",\n "answerFeedback": {\n "clicked": false,\n "correctnessLevel": "",\n "displayed": false\n },\n "articleSuggestion": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "source": "",\n "title": "",\n "uri": ""\n },\n "createTime": "",\n "dialogflowInteraction": {\n "confidence": "",\n "dialogflowIntentId": ""\n },\n "endBoundary": {},\n "faqAnswer": {\n "answer": "",\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "question": "",\n "source": ""\n },\n "smartComposeSuggestion": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "suggestion": ""\n },\n "smartReply": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "reply": ""\n },\n "startBoundary": {}\n }\n ],\n "startTime": "",\n "transcript": {\n "transcriptSegments": [\n {\n "channelTag": 0,\n "confidence": "",\n "dialogflowSegmentMetadata": {\n "smartReplyAllowlistCovered": false\n },\n "languageCode": "",\n "messageTime": "",\n "segmentParticipant": {\n "dialogflowParticipant": "",\n "dialogflowParticipantName": "",\n "obfuscatedExternalUserId": "",\n "role": "",\n "userId": ""\n },\n "sentiment": {},\n "text": "",\n "words": [\n {\n "confidence": "",\n "endOffset": "",\n "startOffset": "",\n "word": ""\n }\n ]\n }\n ]\n },\n "ttl": "",\n "turnCount": 0,\n "updateTime": ""\n },\n "conversationId": "",\n "parent": "",\n "redactionConfig": {\n "deidentifyTemplate": "",\n "inspectTemplate": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/conversations:upload")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/conversations:upload',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
conversation: {
agentId: '',
callMetadata: {agentChannel: 0, customerChannel: 0},
createTime: '',
dataSource: {
dialogflowSource: {audioUri: '', dialogflowConversation: ''},
gcsSource: {audioUri: '', transcriptUri: ''}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {clicked: false, correctnessLevel: '', displayed: false},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {confidence: '', dialogflowIntentId: ''},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {confidenceScore: '', metadata: {}, queryRecord: '', suggestion: ''},
smartReply: {confidenceScore: '', metadata: {}, queryRecord: '', reply: ''},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {smartReplyAllowlistCovered: false},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [{confidence: '', endOffset: '', startOffset: '', word: ''}]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
},
conversationId: '',
parent: '',
redactionConfig: {deidentifyTemplate: '', inspectTemplate: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations:upload',
headers: {'content-type': 'application/json'},
body: {
conversation: {
agentId: '',
callMetadata: {agentChannel: 0, customerChannel: 0},
createTime: '',
dataSource: {
dialogflowSource: {audioUri: '', dialogflowConversation: ''},
gcsSource: {audioUri: '', transcriptUri: ''}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {clicked: false, correctnessLevel: '', displayed: false},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {confidence: '', dialogflowIntentId: ''},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {confidenceScore: '', metadata: {}, queryRecord: '', suggestion: ''},
smartReply: {confidenceScore: '', metadata: {}, queryRecord: '', reply: ''},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {smartReplyAllowlistCovered: false},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [{confidence: '', endOffset: '', startOffset: '', word: ''}]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
},
conversationId: '',
parent: '',
redactionConfig: {deidentifyTemplate: '', inspectTemplate: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:parent/conversations:upload');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
conversation: {
agentId: '',
callMetadata: {
agentChannel: 0,
customerChannel: 0
},
createTime: '',
dataSource: {
dialogflowSource: {
audioUri: '',
dialogflowConversation: ''
},
gcsSource: {
audioUri: '',
transcriptUri: ''
}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {
transcriptIndex: 0,
wordIndex: 0
},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {
entityUniqueId: '',
sentiment: {
magnitude: '',
score: ''
},
type: ''
},
holdData: {},
intentMatchData: {
intentUniqueId: ''
},
interruptionData: {},
issueMatchData: {
issueAssignment: {
displayName: '',
issue: '',
score: ''
}
},
phraseMatchData: {
displayName: '',
phraseMatcher: ''
},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {
issueModel: '',
issues: [
{}
]
},
phraseMatchers: {},
sentiments: [
{
channelTag: 0,
sentimentData: {}
}
]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {
clicked: false,
correctnessLevel: '',
displayed: false
},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {
confidence: '',
dialogflowIntentId: ''
},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
suggestion: ''
},
smartReply: {
confidenceScore: '',
metadata: {},
queryRecord: '',
reply: ''
},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {
smartReplyAllowlistCovered: false
},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [
{
confidence: '',
endOffset: '',
startOffset: '',
word: ''
}
]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
},
conversationId: '',
parent: '',
redactionConfig: {
deidentifyTemplate: '',
inspectTemplate: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/conversations:upload',
headers: {'content-type': 'application/json'},
data: {
conversation: {
agentId: '',
callMetadata: {agentChannel: 0, customerChannel: 0},
createTime: '',
dataSource: {
dialogflowSource: {audioUri: '', dialogflowConversation: ''},
gcsSource: {audioUri: '', transcriptUri: ''}
},
dialogflowIntents: {},
duration: '',
expireTime: '',
labels: {},
languageCode: '',
latestAnalysis: {
analysisResult: {
callAnalysisMetadata: {
annotations: [
{
annotationEndBoundary: {transcriptIndex: 0, wordIndex: 0},
annotationStartBoundary: {},
channelTag: 0,
entityMentionData: {entityUniqueId: '', sentiment: {magnitude: '', score: ''}, type: ''},
holdData: {},
intentMatchData: {intentUniqueId: ''},
interruptionData: {},
issueMatchData: {issueAssignment: {displayName: '', issue: '', score: ''}},
phraseMatchData: {displayName: '', phraseMatcher: ''},
sentimentData: {},
silenceData: {}
}
],
entities: {},
intents: {},
issueModelResult: {issueModel: '', issues: [{}]},
phraseMatchers: {},
sentiments: [{channelTag: 0, sentimentData: {}}]
},
endTime: ''
},
annotatorSelector: {
issueModels: [],
phraseMatchers: [],
runEntityAnnotator: false,
runIntentAnnotator: false,
runInterruptionAnnotator: false,
runIssueModelAnnotator: false,
runPhraseMatcherAnnotator: false,
runSentimentAnnotator: false,
runSilenceAnnotator: false
},
createTime: '',
name: '',
requestTime: ''
},
medium: '',
name: '',
obfuscatedUserId: '',
runtimeAnnotations: [
{
annotationId: '',
answerFeedback: {clicked: false, correctnessLevel: '', displayed: false},
articleSuggestion: {
confidenceScore: '',
metadata: {},
queryRecord: '',
source: '',
title: '',
uri: ''
},
createTime: '',
dialogflowInteraction: {confidence: '', dialogflowIntentId: ''},
endBoundary: {},
faqAnswer: {
answer: '',
confidenceScore: '',
metadata: {},
queryRecord: '',
question: '',
source: ''
},
smartComposeSuggestion: {confidenceScore: '', metadata: {}, queryRecord: '', suggestion: ''},
smartReply: {confidenceScore: '', metadata: {}, queryRecord: '', reply: ''},
startBoundary: {}
}
],
startTime: '',
transcript: {
transcriptSegments: [
{
channelTag: 0,
confidence: '',
dialogflowSegmentMetadata: {smartReplyAllowlistCovered: false},
languageCode: '',
messageTime: '',
segmentParticipant: {
dialogflowParticipant: '',
dialogflowParticipantName: '',
obfuscatedExternalUserId: '',
role: '',
userId: ''
},
sentiment: {},
text: '',
words: [{confidence: '', endOffset: '', startOffset: '', word: ''}]
}
]
},
ttl: '',
turnCount: 0,
updateTime: ''
},
conversationId: '',
parent: '',
redactionConfig: {deidentifyTemplate: '', inspectTemplate: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/conversations:upload';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"conversation":{"agentId":"","callMetadata":{"agentChannel":0,"customerChannel":0},"createTime":"","dataSource":{"dialogflowSource":{"audioUri":"","dialogflowConversation":""},"gcsSource":{"audioUri":"","transcriptUri":""}},"dialogflowIntents":{},"duration":"","expireTime":"","labels":{},"languageCode":"","latestAnalysis":{"analysisResult":{"callAnalysisMetadata":{"annotations":[{"annotationEndBoundary":{"transcriptIndex":0,"wordIndex":0},"annotationStartBoundary":{},"channelTag":0,"entityMentionData":{"entityUniqueId":"","sentiment":{"magnitude":"","score":""},"type":""},"holdData":{},"intentMatchData":{"intentUniqueId":""},"interruptionData":{},"issueMatchData":{"issueAssignment":{"displayName":"","issue":"","score":""}},"phraseMatchData":{"displayName":"","phraseMatcher":""},"sentimentData":{},"silenceData":{}}],"entities":{},"intents":{},"issueModelResult":{"issueModel":"","issues":[{}]},"phraseMatchers":{},"sentiments":[{"channelTag":0,"sentimentData":{}}]},"endTime":""},"annotatorSelector":{"issueModels":[],"phraseMatchers":[],"runEntityAnnotator":false,"runIntentAnnotator":false,"runInterruptionAnnotator":false,"runIssueModelAnnotator":false,"runPhraseMatcherAnnotator":false,"runSentimentAnnotator":false,"runSilenceAnnotator":false},"createTime":"","name":"","requestTime":""},"medium":"","name":"","obfuscatedUserId":"","runtimeAnnotations":[{"annotationId":"","answerFeedback":{"clicked":false,"correctnessLevel":"","displayed":false},"articleSuggestion":{"confidenceScore":"","metadata":{},"queryRecord":"","source":"","title":"","uri":""},"createTime":"","dialogflowInteraction":{"confidence":"","dialogflowIntentId":""},"endBoundary":{},"faqAnswer":{"answer":"","confidenceScore":"","metadata":{},"queryRecord":"","question":"","source":""},"smartComposeSuggestion":{"confidenceScore":"","metadata":{},"queryRecord":"","suggestion":""},"smartReply":{"confidenceScore":"","metadata":{},"queryRecord":"","reply":""},"startBoundary":{}}],"startTime":"","transcript":{"transcriptSegments":[{"channelTag":0,"confidence":"","dialogflowSegmentMetadata":{"smartReplyAllowlistCovered":false},"languageCode":"","messageTime":"","segmentParticipant":{"dialogflowParticipant":"","dialogflowParticipantName":"","obfuscatedExternalUserId":"","role":"","userId":""},"sentiment":{},"text":"","words":[{"confidence":"","endOffset":"","startOffset":"","word":""}]}]},"ttl":"","turnCount":0,"updateTime":""},"conversationId":"","parent":"","redactionConfig":{"deidentifyTemplate":"","inspectTemplate":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"conversation": @{ @"agentId": @"", @"callMetadata": @{ @"agentChannel": @0, @"customerChannel": @0 }, @"createTime": @"", @"dataSource": @{ @"dialogflowSource": @{ @"audioUri": @"", @"dialogflowConversation": @"" }, @"gcsSource": @{ @"audioUri": @"", @"transcriptUri": @"" } }, @"dialogflowIntents": @{ }, @"duration": @"", @"expireTime": @"", @"labels": @{ }, @"languageCode": @"", @"latestAnalysis": @{ @"analysisResult": @{ @"callAnalysisMetadata": @{ @"annotations": @[ @{ @"annotationEndBoundary": @{ @"transcriptIndex": @0, @"wordIndex": @0 }, @"annotationStartBoundary": @{ }, @"channelTag": @0, @"entityMentionData": @{ @"entityUniqueId": @"", @"sentiment": @{ @"magnitude": @"", @"score": @"" }, @"type": @"" }, @"holdData": @{ }, @"intentMatchData": @{ @"intentUniqueId": @"" }, @"interruptionData": @{ }, @"issueMatchData": @{ @"issueAssignment": @{ @"displayName": @"", @"issue": @"", @"score": @"" } }, @"phraseMatchData": @{ @"displayName": @"", @"phraseMatcher": @"" }, @"sentimentData": @{ }, @"silenceData": @{ } } ], @"entities": @{ }, @"intents": @{ }, @"issueModelResult": @{ @"issueModel": @"", @"issues": @[ @{ } ] }, @"phraseMatchers": @{ }, @"sentiments": @[ @{ @"channelTag": @0, @"sentimentData": @{ } } ] }, @"endTime": @"" }, @"annotatorSelector": @{ @"issueModels": @[ ], @"phraseMatchers": @[ ], @"runEntityAnnotator": @NO, @"runIntentAnnotator": @NO, @"runInterruptionAnnotator": @NO, @"runIssueModelAnnotator": @NO, @"runPhraseMatcherAnnotator": @NO, @"runSentimentAnnotator": @NO, @"runSilenceAnnotator": @NO }, @"createTime": @"", @"name": @"", @"requestTime": @"" }, @"medium": @"", @"name": @"", @"obfuscatedUserId": @"", @"runtimeAnnotations": @[ @{ @"annotationId": @"", @"answerFeedback": @{ @"clicked": @NO, @"correctnessLevel": @"", @"displayed": @NO }, @"articleSuggestion": @{ @"confidenceScore": @"", @"metadata": @{ }, @"queryRecord": @"", @"source": @"", @"title": @"", @"uri": @"" }, @"createTime": @"", @"dialogflowInteraction": @{ @"confidence": @"", @"dialogflowIntentId": @"" }, @"endBoundary": @{ }, @"faqAnswer": @{ @"answer": @"", @"confidenceScore": @"", @"metadata": @{ }, @"queryRecord": @"", @"question": @"", @"source": @"" }, @"smartComposeSuggestion": @{ @"confidenceScore": @"", @"metadata": @{ }, @"queryRecord": @"", @"suggestion": @"" }, @"smartReply": @{ @"confidenceScore": @"", @"metadata": @{ }, @"queryRecord": @"", @"reply": @"" }, @"startBoundary": @{ } } ], @"startTime": @"", @"transcript": @{ @"transcriptSegments": @[ @{ @"channelTag": @0, @"confidence": @"", @"dialogflowSegmentMetadata": @{ @"smartReplyAllowlistCovered": @NO }, @"languageCode": @"", @"messageTime": @"", @"segmentParticipant": @{ @"dialogflowParticipant": @"", @"dialogflowParticipantName": @"", @"obfuscatedExternalUserId": @"", @"role": @"", @"userId": @"" }, @"sentiment": @{ }, @"text": @"", @"words": @[ @{ @"confidence": @"", @"endOffset": @"", @"startOffset": @"", @"word": @"" } ] } ] }, @"ttl": @"", @"turnCount": @0, @"updateTime": @"" },
@"conversationId": @"",
@"parent": @"",
@"redactionConfig": @{ @"deidentifyTemplate": @"", @"inspectTemplate": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/conversations:upload"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/conversations:upload" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/conversations:upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conversation' => [
'agentId' => '',
'callMetadata' => [
'agentChannel' => 0,
'customerChannel' => 0
],
'createTime' => '',
'dataSource' => [
'dialogflowSource' => [
'audioUri' => '',
'dialogflowConversation' => ''
],
'gcsSource' => [
'audioUri' => '',
'transcriptUri' => ''
]
],
'dialogflowIntents' => [
],
'duration' => '',
'expireTime' => '',
'labels' => [
],
'languageCode' => '',
'latestAnalysis' => [
'analysisResult' => [
'callAnalysisMetadata' => [
'annotations' => [
[
'annotationEndBoundary' => [
'transcriptIndex' => 0,
'wordIndex' => 0
],
'annotationStartBoundary' => [
],
'channelTag' => 0,
'entityMentionData' => [
'entityUniqueId' => '',
'sentiment' => [
'magnitude' => '',
'score' => ''
],
'type' => ''
],
'holdData' => [
],
'intentMatchData' => [
'intentUniqueId' => ''
],
'interruptionData' => [
],
'issueMatchData' => [
'issueAssignment' => [
'displayName' => '',
'issue' => '',
'score' => ''
]
],
'phraseMatchData' => [
'displayName' => '',
'phraseMatcher' => ''
],
'sentimentData' => [
],
'silenceData' => [
]
]
],
'entities' => [
],
'intents' => [
],
'issueModelResult' => [
'issueModel' => '',
'issues' => [
[
]
]
],
'phraseMatchers' => [
],
'sentiments' => [
[
'channelTag' => 0,
'sentimentData' => [
]
]
]
],
'endTime' => ''
],
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'createTime' => '',
'name' => '',
'requestTime' => ''
],
'medium' => '',
'name' => '',
'obfuscatedUserId' => '',
'runtimeAnnotations' => [
[
'annotationId' => '',
'answerFeedback' => [
'clicked' => null,
'correctnessLevel' => '',
'displayed' => null
],
'articleSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'source' => '',
'title' => '',
'uri' => ''
],
'createTime' => '',
'dialogflowInteraction' => [
'confidence' => '',
'dialogflowIntentId' => ''
],
'endBoundary' => [
],
'faqAnswer' => [
'answer' => '',
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'question' => '',
'source' => ''
],
'smartComposeSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'suggestion' => ''
],
'smartReply' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'reply' => ''
],
'startBoundary' => [
]
]
],
'startTime' => '',
'transcript' => [
'transcriptSegments' => [
[
'channelTag' => 0,
'confidence' => '',
'dialogflowSegmentMetadata' => [
'smartReplyAllowlistCovered' => null
],
'languageCode' => '',
'messageTime' => '',
'segmentParticipant' => [
'dialogflowParticipant' => '',
'dialogflowParticipantName' => '',
'obfuscatedExternalUserId' => '',
'role' => '',
'userId' => ''
],
'sentiment' => [
],
'text' => '',
'words' => [
[
'confidence' => '',
'endOffset' => '',
'startOffset' => '',
'word' => ''
]
]
]
]
],
'ttl' => '',
'turnCount' => 0,
'updateTime' => ''
],
'conversationId' => '',
'parent' => '',
'redactionConfig' => [
'deidentifyTemplate' => '',
'inspectTemplate' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:parent/conversations:upload', [
'body' => '{
"conversation": {
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
},
"conversationId": "",
"parent": "",
"redactionConfig": {
"deidentifyTemplate": "",
"inspectTemplate": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/conversations:upload');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'conversation' => [
'agentId' => '',
'callMetadata' => [
'agentChannel' => 0,
'customerChannel' => 0
],
'createTime' => '',
'dataSource' => [
'dialogflowSource' => [
'audioUri' => '',
'dialogflowConversation' => ''
],
'gcsSource' => [
'audioUri' => '',
'transcriptUri' => ''
]
],
'dialogflowIntents' => [
],
'duration' => '',
'expireTime' => '',
'labels' => [
],
'languageCode' => '',
'latestAnalysis' => [
'analysisResult' => [
'callAnalysisMetadata' => [
'annotations' => [
[
'annotationEndBoundary' => [
'transcriptIndex' => 0,
'wordIndex' => 0
],
'annotationStartBoundary' => [
],
'channelTag' => 0,
'entityMentionData' => [
'entityUniqueId' => '',
'sentiment' => [
'magnitude' => '',
'score' => ''
],
'type' => ''
],
'holdData' => [
],
'intentMatchData' => [
'intentUniqueId' => ''
],
'interruptionData' => [
],
'issueMatchData' => [
'issueAssignment' => [
'displayName' => '',
'issue' => '',
'score' => ''
]
],
'phraseMatchData' => [
'displayName' => '',
'phraseMatcher' => ''
],
'sentimentData' => [
],
'silenceData' => [
]
]
],
'entities' => [
],
'intents' => [
],
'issueModelResult' => [
'issueModel' => '',
'issues' => [
[
]
]
],
'phraseMatchers' => [
],
'sentiments' => [
[
'channelTag' => 0,
'sentimentData' => [
]
]
]
],
'endTime' => ''
],
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'createTime' => '',
'name' => '',
'requestTime' => ''
],
'medium' => '',
'name' => '',
'obfuscatedUserId' => '',
'runtimeAnnotations' => [
[
'annotationId' => '',
'answerFeedback' => [
'clicked' => null,
'correctnessLevel' => '',
'displayed' => null
],
'articleSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'source' => '',
'title' => '',
'uri' => ''
],
'createTime' => '',
'dialogflowInteraction' => [
'confidence' => '',
'dialogflowIntentId' => ''
],
'endBoundary' => [
],
'faqAnswer' => [
'answer' => '',
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'question' => '',
'source' => ''
],
'smartComposeSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'suggestion' => ''
],
'smartReply' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'reply' => ''
],
'startBoundary' => [
]
]
],
'startTime' => '',
'transcript' => [
'transcriptSegments' => [
[
'channelTag' => 0,
'confidence' => '',
'dialogflowSegmentMetadata' => [
'smartReplyAllowlistCovered' => null
],
'languageCode' => '',
'messageTime' => '',
'segmentParticipant' => [
'dialogflowParticipant' => '',
'dialogflowParticipantName' => '',
'obfuscatedExternalUserId' => '',
'role' => '',
'userId' => ''
],
'sentiment' => [
],
'text' => '',
'words' => [
[
'confidence' => '',
'endOffset' => '',
'startOffset' => '',
'word' => ''
]
]
]
]
],
'ttl' => '',
'turnCount' => 0,
'updateTime' => ''
],
'conversationId' => '',
'parent' => '',
'redactionConfig' => [
'deidentifyTemplate' => '',
'inspectTemplate' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'conversation' => [
'agentId' => '',
'callMetadata' => [
'agentChannel' => 0,
'customerChannel' => 0
],
'createTime' => '',
'dataSource' => [
'dialogflowSource' => [
'audioUri' => '',
'dialogflowConversation' => ''
],
'gcsSource' => [
'audioUri' => '',
'transcriptUri' => ''
]
],
'dialogflowIntents' => [
],
'duration' => '',
'expireTime' => '',
'labels' => [
],
'languageCode' => '',
'latestAnalysis' => [
'analysisResult' => [
'callAnalysisMetadata' => [
'annotations' => [
[
'annotationEndBoundary' => [
'transcriptIndex' => 0,
'wordIndex' => 0
],
'annotationStartBoundary' => [
],
'channelTag' => 0,
'entityMentionData' => [
'entityUniqueId' => '',
'sentiment' => [
'magnitude' => '',
'score' => ''
],
'type' => ''
],
'holdData' => [
],
'intentMatchData' => [
'intentUniqueId' => ''
],
'interruptionData' => [
],
'issueMatchData' => [
'issueAssignment' => [
'displayName' => '',
'issue' => '',
'score' => ''
]
],
'phraseMatchData' => [
'displayName' => '',
'phraseMatcher' => ''
],
'sentimentData' => [
],
'silenceData' => [
]
]
],
'entities' => [
],
'intents' => [
],
'issueModelResult' => [
'issueModel' => '',
'issues' => [
[
]
]
],
'phraseMatchers' => [
],
'sentiments' => [
[
'channelTag' => 0,
'sentimentData' => [
]
]
]
],
'endTime' => ''
],
'annotatorSelector' => [
'issueModels' => [
],
'phraseMatchers' => [
],
'runEntityAnnotator' => null,
'runIntentAnnotator' => null,
'runInterruptionAnnotator' => null,
'runIssueModelAnnotator' => null,
'runPhraseMatcherAnnotator' => null,
'runSentimentAnnotator' => null,
'runSilenceAnnotator' => null
],
'createTime' => '',
'name' => '',
'requestTime' => ''
],
'medium' => '',
'name' => '',
'obfuscatedUserId' => '',
'runtimeAnnotations' => [
[
'annotationId' => '',
'answerFeedback' => [
'clicked' => null,
'correctnessLevel' => '',
'displayed' => null
],
'articleSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'source' => '',
'title' => '',
'uri' => ''
],
'createTime' => '',
'dialogflowInteraction' => [
'confidence' => '',
'dialogflowIntentId' => ''
],
'endBoundary' => [
],
'faqAnswer' => [
'answer' => '',
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'question' => '',
'source' => ''
],
'smartComposeSuggestion' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'suggestion' => ''
],
'smartReply' => [
'confidenceScore' => '',
'metadata' => [
],
'queryRecord' => '',
'reply' => ''
],
'startBoundary' => [
]
]
],
'startTime' => '',
'transcript' => [
'transcriptSegments' => [
[
'channelTag' => 0,
'confidence' => '',
'dialogflowSegmentMetadata' => [
'smartReplyAllowlistCovered' => null
],
'languageCode' => '',
'messageTime' => '',
'segmentParticipant' => [
'dialogflowParticipant' => '',
'dialogflowParticipantName' => '',
'obfuscatedExternalUserId' => '',
'role' => '',
'userId' => ''
],
'sentiment' => [
],
'text' => '',
'words' => [
[
'confidence' => '',
'endOffset' => '',
'startOffset' => '',
'word' => ''
]
]
]
]
],
'ttl' => '',
'turnCount' => 0,
'updateTime' => ''
],
'conversationId' => '',
'parent' => '',
'redactionConfig' => [
'deidentifyTemplate' => '',
'inspectTemplate' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1/:parent/conversations:upload');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/conversations:upload' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"conversation": {
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
},
"conversationId": "",
"parent": "",
"redactionConfig": {
"deidentifyTemplate": "",
"inspectTemplate": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/conversations:upload' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"conversation": {
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
},
"conversationId": "",
"parent": "",
"redactionConfig": {
"deidentifyTemplate": "",
"inspectTemplate": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:parent/conversations:upload", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/conversations:upload"
payload = {
"conversation": {
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": { "intentUniqueId": "" },
"interruptionData": {},
"issueMatchData": { "issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
} },
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [{}]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": False,
"runIntentAnnotator": False,
"runInterruptionAnnotator": False,
"runIssueModelAnnotator": False,
"runPhraseMatcherAnnotator": False,
"runSentimentAnnotator": False,
"runSilenceAnnotator": False
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": False,
"correctnessLevel": "",
"displayed": False
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": { "transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": { "smartReplyAllowlistCovered": False },
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
] },
"ttl": "",
"turnCount": 0,
"updateTime": ""
},
"conversationId": "",
"parent": "",
"redactionConfig": {
"deidentifyTemplate": "",
"inspectTemplate": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/conversations:upload"
payload <- "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/conversations:upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:parent/conversations:upload') do |req|
req.body = "{\n \"conversation\": {\n \"agentId\": \"\",\n \"callMetadata\": {\n \"agentChannel\": 0,\n \"customerChannel\": 0\n },\n \"createTime\": \"\",\n \"dataSource\": {\n \"dialogflowSource\": {\n \"audioUri\": \"\",\n \"dialogflowConversation\": \"\"\n },\n \"gcsSource\": {\n \"audioUri\": \"\",\n \"transcriptUri\": \"\"\n }\n },\n \"dialogflowIntents\": {},\n \"duration\": \"\",\n \"expireTime\": \"\",\n \"labels\": {},\n \"languageCode\": \"\",\n \"latestAnalysis\": {\n \"analysisResult\": {\n \"callAnalysisMetadata\": {\n \"annotations\": [\n {\n \"annotationEndBoundary\": {\n \"transcriptIndex\": 0,\n \"wordIndex\": 0\n },\n \"annotationStartBoundary\": {},\n \"channelTag\": 0,\n \"entityMentionData\": {\n \"entityUniqueId\": \"\",\n \"sentiment\": {\n \"magnitude\": \"\",\n \"score\": \"\"\n },\n \"type\": \"\"\n },\n \"holdData\": {},\n \"intentMatchData\": {\n \"intentUniqueId\": \"\"\n },\n \"interruptionData\": {},\n \"issueMatchData\": {\n \"issueAssignment\": {\n \"displayName\": \"\",\n \"issue\": \"\",\n \"score\": \"\"\n }\n },\n \"phraseMatchData\": {\n \"displayName\": \"\",\n \"phraseMatcher\": \"\"\n },\n \"sentimentData\": {},\n \"silenceData\": {}\n }\n ],\n \"entities\": {},\n \"intents\": {},\n \"issueModelResult\": {\n \"issueModel\": \"\",\n \"issues\": [\n {}\n ]\n },\n \"phraseMatchers\": {},\n \"sentiments\": [\n {\n \"channelTag\": 0,\n \"sentimentData\": {}\n }\n ]\n },\n \"endTime\": \"\"\n },\n \"annotatorSelector\": {\n \"issueModels\": [],\n \"phraseMatchers\": [],\n \"runEntityAnnotator\": false,\n \"runIntentAnnotator\": false,\n \"runInterruptionAnnotator\": false,\n \"runIssueModelAnnotator\": false,\n \"runPhraseMatcherAnnotator\": false,\n \"runSentimentAnnotator\": false,\n \"runSilenceAnnotator\": false\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"requestTime\": \"\"\n },\n \"medium\": \"\",\n \"name\": \"\",\n \"obfuscatedUserId\": \"\",\n \"runtimeAnnotations\": [\n {\n \"annotationId\": \"\",\n \"answerFeedback\": {\n \"clicked\": false,\n \"correctnessLevel\": \"\",\n \"displayed\": false\n },\n \"articleSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"source\": \"\",\n \"title\": \"\",\n \"uri\": \"\"\n },\n \"createTime\": \"\",\n \"dialogflowInteraction\": {\n \"confidence\": \"\",\n \"dialogflowIntentId\": \"\"\n },\n \"endBoundary\": {},\n \"faqAnswer\": {\n \"answer\": \"\",\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"question\": \"\",\n \"source\": \"\"\n },\n \"smartComposeSuggestion\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"suggestion\": \"\"\n },\n \"smartReply\": {\n \"confidenceScore\": \"\",\n \"metadata\": {},\n \"queryRecord\": \"\",\n \"reply\": \"\"\n },\n \"startBoundary\": {}\n }\n ],\n \"startTime\": \"\",\n \"transcript\": {\n \"transcriptSegments\": [\n {\n \"channelTag\": 0,\n \"confidence\": \"\",\n \"dialogflowSegmentMetadata\": {\n \"smartReplyAllowlistCovered\": false\n },\n \"languageCode\": \"\",\n \"messageTime\": \"\",\n \"segmentParticipant\": {\n \"dialogflowParticipant\": \"\",\n \"dialogflowParticipantName\": \"\",\n \"obfuscatedExternalUserId\": \"\",\n \"role\": \"\",\n \"userId\": \"\"\n },\n \"sentiment\": {},\n \"text\": \"\",\n \"words\": [\n {\n \"confidence\": \"\",\n \"endOffset\": \"\",\n \"startOffset\": \"\",\n \"word\": \"\"\n }\n ]\n }\n ]\n },\n \"ttl\": \"\",\n \"turnCount\": 0,\n \"updateTime\": \"\"\n },\n \"conversationId\": \"\",\n \"parent\": \"\",\n \"redactionConfig\": {\n \"deidentifyTemplate\": \"\",\n \"inspectTemplate\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/conversations:upload";
let payload = json!({
"conversation": json!({
"agentId": "",
"callMetadata": json!({
"agentChannel": 0,
"customerChannel": 0
}),
"createTime": "",
"dataSource": json!({
"dialogflowSource": json!({
"audioUri": "",
"dialogflowConversation": ""
}),
"gcsSource": json!({
"audioUri": "",
"transcriptUri": ""
})
}),
"dialogflowIntents": json!({}),
"duration": "",
"expireTime": "",
"labels": json!({}),
"languageCode": "",
"latestAnalysis": json!({
"analysisResult": json!({
"callAnalysisMetadata": json!({
"annotations": (
json!({
"annotationEndBoundary": json!({
"transcriptIndex": 0,
"wordIndex": 0
}),
"annotationStartBoundary": json!({}),
"channelTag": 0,
"entityMentionData": json!({
"entityUniqueId": "",
"sentiment": json!({
"magnitude": "",
"score": ""
}),
"type": ""
}),
"holdData": json!({}),
"intentMatchData": json!({"intentUniqueId": ""}),
"interruptionData": json!({}),
"issueMatchData": json!({"issueAssignment": json!({
"displayName": "",
"issue": "",
"score": ""
})}),
"phraseMatchData": json!({
"displayName": "",
"phraseMatcher": ""
}),
"sentimentData": json!({}),
"silenceData": json!({})
})
),
"entities": json!({}),
"intents": json!({}),
"issueModelResult": json!({
"issueModel": "",
"issues": (json!({}))
}),
"phraseMatchers": json!({}),
"sentiments": (
json!({
"channelTag": 0,
"sentimentData": json!({})
})
)
}),
"endTime": ""
}),
"annotatorSelector": json!({
"issueModels": (),
"phraseMatchers": (),
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
}),
"createTime": "",
"name": "",
"requestTime": ""
}),
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": (
json!({
"annotationId": "",
"answerFeedback": json!({
"clicked": false,
"correctnessLevel": "",
"displayed": false
}),
"articleSuggestion": json!({
"confidenceScore": "",
"metadata": json!({}),
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
}),
"createTime": "",
"dialogflowInteraction": json!({
"confidence": "",
"dialogflowIntentId": ""
}),
"endBoundary": json!({}),
"faqAnswer": json!({
"answer": "",
"confidenceScore": "",
"metadata": json!({}),
"queryRecord": "",
"question": "",
"source": ""
}),
"smartComposeSuggestion": json!({
"confidenceScore": "",
"metadata": json!({}),
"queryRecord": "",
"suggestion": ""
}),
"smartReply": json!({
"confidenceScore": "",
"metadata": json!({}),
"queryRecord": "",
"reply": ""
}),
"startBoundary": json!({})
})
),
"startTime": "",
"transcript": json!({"transcriptSegments": (
json!({
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": json!({"smartReplyAllowlistCovered": false}),
"languageCode": "",
"messageTime": "",
"segmentParticipant": json!({
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
}),
"sentiment": json!({}),
"text": "",
"words": (
json!({
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
})
)
})
)}),
"ttl": "",
"turnCount": 0,
"updateTime": ""
}),
"conversationId": "",
"parent": "",
"redactionConfig": json!({
"deidentifyTemplate": "",
"inspectTemplate": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:parent/conversations:upload \
--header 'content-type: application/json' \
--data '{
"conversation": {
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
},
"conversationId": "",
"parent": "",
"redactionConfig": {
"deidentifyTemplate": "",
"inspectTemplate": ""
}
}'
echo '{
"conversation": {
"agentId": "",
"callMetadata": {
"agentChannel": 0,
"customerChannel": 0
},
"createTime": "",
"dataSource": {
"dialogflowSource": {
"audioUri": "",
"dialogflowConversation": ""
},
"gcsSource": {
"audioUri": "",
"transcriptUri": ""
}
},
"dialogflowIntents": {},
"duration": "",
"expireTime": "",
"labels": {},
"languageCode": "",
"latestAnalysis": {
"analysisResult": {
"callAnalysisMetadata": {
"annotations": [
{
"annotationEndBoundary": {
"transcriptIndex": 0,
"wordIndex": 0
},
"annotationStartBoundary": {},
"channelTag": 0,
"entityMentionData": {
"entityUniqueId": "",
"sentiment": {
"magnitude": "",
"score": ""
},
"type": ""
},
"holdData": {},
"intentMatchData": {
"intentUniqueId": ""
},
"interruptionData": {},
"issueMatchData": {
"issueAssignment": {
"displayName": "",
"issue": "",
"score": ""
}
},
"phraseMatchData": {
"displayName": "",
"phraseMatcher": ""
},
"sentimentData": {},
"silenceData": {}
}
],
"entities": {},
"intents": {},
"issueModelResult": {
"issueModel": "",
"issues": [
{}
]
},
"phraseMatchers": {},
"sentiments": [
{
"channelTag": 0,
"sentimentData": {}
}
]
},
"endTime": ""
},
"annotatorSelector": {
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
},
"createTime": "",
"name": "",
"requestTime": ""
},
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
{
"annotationId": "",
"answerFeedback": {
"clicked": false,
"correctnessLevel": "",
"displayed": false
},
"articleSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
},
"createTime": "",
"dialogflowInteraction": {
"confidence": "",
"dialogflowIntentId": ""
},
"endBoundary": {},
"faqAnswer": {
"answer": "",
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"question": "",
"source": ""
},
"smartComposeSuggestion": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"suggestion": ""
},
"smartReply": {
"confidenceScore": "",
"metadata": {},
"queryRecord": "",
"reply": ""
},
"startBoundary": {}
}
],
"startTime": "",
"transcript": {
"transcriptSegments": [
{
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": {
"smartReplyAllowlistCovered": false
},
"languageCode": "",
"messageTime": "",
"segmentParticipant": {
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
},
"sentiment": {},
"text": "",
"words": [
{
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
}
]
}
]
},
"ttl": "",
"turnCount": 0,
"updateTime": ""
},
"conversationId": "",
"parent": "",
"redactionConfig": {
"deidentifyTemplate": "",
"inspectTemplate": ""
}
}' | \
http POST {{baseUrl}}/v1/:parent/conversations:upload \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "conversation": {\n "agentId": "",\n "callMetadata": {\n "agentChannel": 0,\n "customerChannel": 0\n },\n "createTime": "",\n "dataSource": {\n "dialogflowSource": {\n "audioUri": "",\n "dialogflowConversation": ""\n },\n "gcsSource": {\n "audioUri": "",\n "transcriptUri": ""\n }\n },\n "dialogflowIntents": {},\n "duration": "",\n "expireTime": "",\n "labels": {},\n "languageCode": "",\n "latestAnalysis": {\n "analysisResult": {\n "callAnalysisMetadata": {\n "annotations": [\n {\n "annotationEndBoundary": {\n "transcriptIndex": 0,\n "wordIndex": 0\n },\n "annotationStartBoundary": {},\n "channelTag": 0,\n "entityMentionData": {\n "entityUniqueId": "",\n "sentiment": {\n "magnitude": "",\n "score": ""\n },\n "type": ""\n },\n "holdData": {},\n "intentMatchData": {\n "intentUniqueId": ""\n },\n "interruptionData": {},\n "issueMatchData": {\n "issueAssignment": {\n "displayName": "",\n "issue": "",\n "score": ""\n }\n },\n "phraseMatchData": {\n "displayName": "",\n "phraseMatcher": ""\n },\n "sentimentData": {},\n "silenceData": {}\n }\n ],\n "entities": {},\n "intents": {},\n "issueModelResult": {\n "issueModel": "",\n "issues": [\n {}\n ]\n },\n "phraseMatchers": {},\n "sentiments": [\n {\n "channelTag": 0,\n "sentimentData": {}\n }\n ]\n },\n "endTime": ""\n },\n "annotatorSelector": {\n "issueModels": [],\n "phraseMatchers": [],\n "runEntityAnnotator": false,\n "runIntentAnnotator": false,\n "runInterruptionAnnotator": false,\n "runIssueModelAnnotator": false,\n "runPhraseMatcherAnnotator": false,\n "runSentimentAnnotator": false,\n "runSilenceAnnotator": false\n },\n "createTime": "",\n "name": "",\n "requestTime": ""\n },\n "medium": "",\n "name": "",\n "obfuscatedUserId": "",\n "runtimeAnnotations": [\n {\n "annotationId": "",\n "answerFeedback": {\n "clicked": false,\n "correctnessLevel": "",\n "displayed": false\n },\n "articleSuggestion": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "source": "",\n "title": "",\n "uri": ""\n },\n "createTime": "",\n "dialogflowInteraction": {\n "confidence": "",\n "dialogflowIntentId": ""\n },\n "endBoundary": {},\n "faqAnswer": {\n "answer": "",\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "question": "",\n "source": ""\n },\n "smartComposeSuggestion": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "suggestion": ""\n },\n "smartReply": {\n "confidenceScore": "",\n "metadata": {},\n "queryRecord": "",\n "reply": ""\n },\n "startBoundary": {}\n }\n ],\n "startTime": "",\n "transcript": {\n "transcriptSegments": [\n {\n "channelTag": 0,\n "confidence": "",\n "dialogflowSegmentMetadata": {\n "smartReplyAllowlistCovered": false\n },\n "languageCode": "",\n "messageTime": "",\n "segmentParticipant": {\n "dialogflowParticipant": "",\n "dialogflowParticipantName": "",\n "obfuscatedExternalUserId": "",\n "role": "",\n "userId": ""\n },\n "sentiment": {},\n "text": "",\n "words": [\n {\n "confidence": "",\n "endOffset": "",\n "startOffset": "",\n "word": ""\n }\n ]\n }\n ]\n },\n "ttl": "",\n "turnCount": 0,\n "updateTime": ""\n },\n "conversationId": "",\n "parent": "",\n "redactionConfig": {\n "deidentifyTemplate": "",\n "inspectTemplate": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v1/:parent/conversations:upload
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"conversation": [
"agentId": "",
"callMetadata": [
"agentChannel": 0,
"customerChannel": 0
],
"createTime": "",
"dataSource": [
"dialogflowSource": [
"audioUri": "",
"dialogflowConversation": ""
],
"gcsSource": [
"audioUri": "",
"transcriptUri": ""
]
],
"dialogflowIntents": [],
"duration": "",
"expireTime": "",
"labels": [],
"languageCode": "",
"latestAnalysis": [
"analysisResult": [
"callAnalysisMetadata": [
"annotations": [
[
"annotationEndBoundary": [
"transcriptIndex": 0,
"wordIndex": 0
],
"annotationStartBoundary": [],
"channelTag": 0,
"entityMentionData": [
"entityUniqueId": "",
"sentiment": [
"magnitude": "",
"score": ""
],
"type": ""
],
"holdData": [],
"intentMatchData": ["intentUniqueId": ""],
"interruptionData": [],
"issueMatchData": ["issueAssignment": [
"displayName": "",
"issue": "",
"score": ""
]],
"phraseMatchData": [
"displayName": "",
"phraseMatcher": ""
],
"sentimentData": [],
"silenceData": []
]
],
"entities": [],
"intents": [],
"issueModelResult": [
"issueModel": "",
"issues": [[]]
],
"phraseMatchers": [],
"sentiments": [
[
"channelTag": 0,
"sentimentData": []
]
]
],
"endTime": ""
],
"annotatorSelector": [
"issueModels": [],
"phraseMatchers": [],
"runEntityAnnotator": false,
"runIntentAnnotator": false,
"runInterruptionAnnotator": false,
"runIssueModelAnnotator": false,
"runPhraseMatcherAnnotator": false,
"runSentimentAnnotator": false,
"runSilenceAnnotator": false
],
"createTime": "",
"name": "",
"requestTime": ""
],
"medium": "",
"name": "",
"obfuscatedUserId": "",
"runtimeAnnotations": [
[
"annotationId": "",
"answerFeedback": [
"clicked": false,
"correctnessLevel": "",
"displayed": false
],
"articleSuggestion": [
"confidenceScore": "",
"metadata": [],
"queryRecord": "",
"source": "",
"title": "",
"uri": ""
],
"createTime": "",
"dialogflowInteraction": [
"confidence": "",
"dialogflowIntentId": ""
],
"endBoundary": [],
"faqAnswer": [
"answer": "",
"confidenceScore": "",
"metadata": [],
"queryRecord": "",
"question": "",
"source": ""
],
"smartComposeSuggestion": [
"confidenceScore": "",
"metadata": [],
"queryRecord": "",
"suggestion": ""
],
"smartReply": [
"confidenceScore": "",
"metadata": [],
"queryRecord": "",
"reply": ""
],
"startBoundary": []
]
],
"startTime": "",
"transcript": ["transcriptSegments": [
[
"channelTag": 0,
"confidence": "",
"dialogflowSegmentMetadata": ["smartReplyAllowlistCovered": false],
"languageCode": "",
"messageTime": "",
"segmentParticipant": [
"dialogflowParticipant": "",
"dialogflowParticipantName": "",
"obfuscatedExternalUserId": "",
"role": "",
"userId": ""
],
"sentiment": [],
"text": "",
"words": [
[
"confidence": "",
"endOffset": "",
"startOffset": "",
"word": ""
]
]
]
]],
"ttl": "",
"turnCount": 0,
"updateTime": ""
],
"conversationId": "",
"parent": "",
"redactionConfig": [
"deidentifyTemplate": "",
"inspectTemplate": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/conversations:upload")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.insightsdata.export
{{baseUrl}}/v1/:parent/insightsdata:export
QUERY PARAMS
parent
BODY json
{
"bigQueryDestination": {
"dataset": "",
"projectId": "",
"table": ""
},
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/insightsdata:export");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:parent/insightsdata:export" {:content-type :json
:form-params {:bigQueryDestination {:dataset ""
:projectId ""
:table ""}
:filter ""
:kmsKey ""
:parent ""
:writeDisposition ""}})
require "http/client"
url = "{{baseUrl}}/v1/:parent/insightsdata:export"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/insightsdata:export"),
Content = new StringContent("{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/insightsdata:export");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/insightsdata:export"
payload := strings.NewReader("{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:parent/insightsdata:export HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 164
{
"bigQueryDestination": {
"dataset": "",
"projectId": "",
"table": ""
},
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:parent/insightsdata:export")
.setHeader("content-type", "application/json")
.setBody("{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/insightsdata:export"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/insightsdata:export")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:parent/insightsdata:export")
.header("content-type", "application/json")
.body("{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}")
.asString();
const data = JSON.stringify({
bigQueryDestination: {
dataset: '',
projectId: '',
table: ''
},
filter: '',
kmsKey: '',
parent: '',
writeDisposition: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:parent/insightsdata:export');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/insightsdata:export',
headers: {'content-type': 'application/json'},
data: {
bigQueryDestination: {dataset: '', projectId: '', table: ''},
filter: '',
kmsKey: '',
parent: '',
writeDisposition: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/insightsdata:export';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bigQueryDestination":{"dataset":"","projectId":"","table":""},"filter":"","kmsKey":"","parent":"","writeDisposition":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/insightsdata:export',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "bigQueryDestination": {\n "dataset": "",\n "projectId": "",\n "table": ""\n },\n "filter": "",\n "kmsKey": "",\n "parent": "",\n "writeDisposition": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/insightsdata:export")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/insightsdata:export',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
bigQueryDestination: {dataset: '', projectId: '', table: ''},
filter: '',
kmsKey: '',
parent: '',
writeDisposition: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/insightsdata:export',
headers: {'content-type': 'application/json'},
body: {
bigQueryDestination: {dataset: '', projectId: '', table: ''},
filter: '',
kmsKey: '',
parent: '',
writeDisposition: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:parent/insightsdata:export');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
bigQueryDestination: {
dataset: '',
projectId: '',
table: ''
},
filter: '',
kmsKey: '',
parent: '',
writeDisposition: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/insightsdata:export',
headers: {'content-type': 'application/json'},
data: {
bigQueryDestination: {dataset: '', projectId: '', table: ''},
filter: '',
kmsKey: '',
parent: '',
writeDisposition: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/insightsdata:export';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"bigQueryDestination":{"dataset":"","projectId":"","table":""},"filter":"","kmsKey":"","parent":"","writeDisposition":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"bigQueryDestination": @{ @"dataset": @"", @"projectId": @"", @"table": @"" },
@"filter": @"",
@"kmsKey": @"",
@"parent": @"",
@"writeDisposition": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/insightsdata:export"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/insightsdata:export" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/insightsdata:export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'bigQueryDestination' => [
'dataset' => '',
'projectId' => '',
'table' => ''
],
'filter' => '',
'kmsKey' => '',
'parent' => '',
'writeDisposition' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:parent/insightsdata:export', [
'body' => '{
"bigQueryDestination": {
"dataset": "",
"projectId": "",
"table": ""
},
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/insightsdata:export');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'bigQueryDestination' => [
'dataset' => '',
'projectId' => '',
'table' => ''
],
'filter' => '',
'kmsKey' => '',
'parent' => '',
'writeDisposition' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'bigQueryDestination' => [
'dataset' => '',
'projectId' => '',
'table' => ''
],
'filter' => '',
'kmsKey' => '',
'parent' => '',
'writeDisposition' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:parent/insightsdata:export');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/insightsdata:export' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bigQueryDestination": {
"dataset": "",
"projectId": "",
"table": ""
},
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/insightsdata:export' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"bigQueryDestination": {
"dataset": "",
"projectId": "",
"table": ""
},
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:parent/insightsdata:export", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/insightsdata:export"
payload = {
"bigQueryDestination": {
"dataset": "",
"projectId": "",
"table": ""
},
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/insightsdata:export"
payload <- "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/insightsdata:export")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:parent/insightsdata:export') do |req|
req.body = "{\n \"bigQueryDestination\": {\n \"dataset\": \"\",\n \"projectId\": \"\",\n \"table\": \"\"\n },\n \"filter\": \"\",\n \"kmsKey\": \"\",\n \"parent\": \"\",\n \"writeDisposition\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/insightsdata:export";
let payload = json!({
"bigQueryDestination": json!({
"dataset": "",
"projectId": "",
"table": ""
}),
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:parent/insightsdata:export \
--header 'content-type: application/json' \
--data '{
"bigQueryDestination": {
"dataset": "",
"projectId": "",
"table": ""
},
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
}'
echo '{
"bigQueryDestination": {
"dataset": "",
"projectId": "",
"table": ""
},
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
}' | \
http POST {{baseUrl}}/v1/:parent/insightsdata:export \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "bigQueryDestination": {\n "dataset": "",\n "projectId": "",\n "table": ""\n },\n "filter": "",\n "kmsKey": "",\n "parent": "",\n "writeDisposition": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:parent/insightsdata:export
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"bigQueryDestination": [
"dataset": "",
"projectId": "",
"table": ""
],
"filter": "",
"kmsKey": "",
"parent": "",
"writeDisposition": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/insightsdata:export")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.issueModels.calculateIssueModelStats
{{baseUrl}}/v1/:issueModel:calculateIssueModelStats
QUERY PARAMS
issueModel
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats")
require "http/client"
url = "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:issueModel:calculateIssueModelStats"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:issueModel:calculateIssueModelStats");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:issueModel:calculateIssueModelStats HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:issueModel:calculateIssueModelStats"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:issueModel:calculateIssueModelStats")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:issueModel:calculateIssueModelStats")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:issueModel:calculateIssueModelStats")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:issueModel:calculateIssueModelStats',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:issueModel:calculateIssueModelStats"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:issueModel:calculateIssueModelStats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:issueModel:calculateIssueModelStats');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:issueModel:calculateIssueModelStats');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:issueModel:calculateIssueModelStats' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:issueModel:calculateIssueModelStats")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:issueModel:calculateIssueModelStats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:issueModel:calculateIssueModelStats') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:issueModel:calculateIssueModelStats
http GET {{baseUrl}}/v1/:issueModel:calculateIssueModelStats
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:issueModel:calculateIssueModelStats
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:issueModel:calculateIssueModelStats")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.issueModels.create
{{baseUrl}}/v1/:parent/issueModels
QUERY PARAMS
parent
BODY json
{
"createTime": "",
"displayName": "",
"inputDataConfig": {
"filter": "",
"medium": "",
"trainingConversationsCount": ""
},
"issueCount": "",
"name": "",
"state": "",
"trainingStats": {
"analyzedConversationsCount": "",
"issueStats": {},
"unclassifiedConversationsCount": ""
},
"updateTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/issueModels");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:parent/issueModels" {:content-type :json
:form-params {:createTime ""
:displayName ""
:inputDataConfig {:filter ""
:medium ""
:trainingConversationsCount ""}
:issueCount ""
:name ""
:state ""
:trainingStats {:analyzedConversationsCount ""
:issueStats {}
:unclassifiedConversationsCount ""}
:updateTime ""}})
require "http/client"
url = "{{baseUrl}}/v1/:parent/issueModels"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/issueModels"),
Content = new StringContent("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/issueModels");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/issueModels"
payload := strings.NewReader("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:parent/issueModels HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 340
{
"createTime": "",
"displayName": "",
"inputDataConfig": {
"filter": "",
"medium": "",
"trainingConversationsCount": ""
},
"issueCount": "",
"name": "",
"state": "",
"trainingStats": {
"analyzedConversationsCount": "",
"issueStats": {},
"unclassifiedConversationsCount": ""
},
"updateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:parent/issueModels")
.setHeader("content-type", "application/json")
.setBody("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/issueModels"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/issueModels")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:parent/issueModels")
.header("content-type", "application/json")
.body("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
createTime: '',
displayName: '',
inputDataConfig: {
filter: '',
medium: '',
trainingConversationsCount: ''
},
issueCount: '',
name: '',
state: '',
trainingStats: {
analyzedConversationsCount: '',
issueStats: {},
unclassifiedConversationsCount: ''
},
updateTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:parent/issueModels');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/issueModels',
headers: {'content-type': 'application/json'},
data: {
createTime: '',
displayName: '',
inputDataConfig: {filter: '', medium: '', trainingConversationsCount: ''},
issueCount: '',
name: '',
state: '',
trainingStats: {
analyzedConversationsCount: '',
issueStats: {},
unclassifiedConversationsCount: ''
},
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/issueModels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","displayName":"","inputDataConfig":{"filter":"","medium":"","trainingConversationsCount":""},"issueCount":"","name":"","state":"","trainingStats":{"analyzedConversationsCount":"","issueStats":{},"unclassifiedConversationsCount":""},"updateTime":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/issueModels',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "createTime": "",\n "displayName": "",\n "inputDataConfig": {\n "filter": "",\n "medium": "",\n "trainingConversationsCount": ""\n },\n "issueCount": "",\n "name": "",\n "state": "",\n "trainingStats": {\n "analyzedConversationsCount": "",\n "issueStats": {},\n "unclassifiedConversationsCount": ""\n },\n "updateTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/issueModels")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/issueModels',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
createTime: '',
displayName: '',
inputDataConfig: {filter: '', medium: '', trainingConversationsCount: ''},
issueCount: '',
name: '',
state: '',
trainingStats: {
analyzedConversationsCount: '',
issueStats: {},
unclassifiedConversationsCount: ''
},
updateTime: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/issueModels',
headers: {'content-type': 'application/json'},
body: {
createTime: '',
displayName: '',
inputDataConfig: {filter: '', medium: '', trainingConversationsCount: ''},
issueCount: '',
name: '',
state: '',
trainingStats: {
analyzedConversationsCount: '',
issueStats: {},
unclassifiedConversationsCount: ''
},
updateTime: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:parent/issueModels');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
createTime: '',
displayName: '',
inputDataConfig: {
filter: '',
medium: '',
trainingConversationsCount: ''
},
issueCount: '',
name: '',
state: '',
trainingStats: {
analyzedConversationsCount: '',
issueStats: {},
unclassifiedConversationsCount: ''
},
updateTime: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/issueModels',
headers: {'content-type': 'application/json'},
data: {
createTime: '',
displayName: '',
inputDataConfig: {filter: '', medium: '', trainingConversationsCount: ''},
issueCount: '',
name: '',
state: '',
trainingStats: {
analyzedConversationsCount: '',
issueStats: {},
unclassifiedConversationsCount: ''
},
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/issueModels';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","displayName":"","inputDataConfig":{"filter":"","medium":"","trainingConversationsCount":""},"issueCount":"","name":"","state":"","trainingStats":{"analyzedConversationsCount":"","issueStats":{},"unclassifiedConversationsCount":""},"updateTime":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"createTime": @"",
@"displayName": @"",
@"inputDataConfig": @{ @"filter": @"", @"medium": @"", @"trainingConversationsCount": @"" },
@"issueCount": @"",
@"name": @"",
@"state": @"",
@"trainingStats": @{ @"analyzedConversationsCount": @"", @"issueStats": @{ }, @"unclassifiedConversationsCount": @"" },
@"updateTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/issueModels"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/issueModels" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/issueModels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'createTime' => '',
'displayName' => '',
'inputDataConfig' => [
'filter' => '',
'medium' => '',
'trainingConversationsCount' => ''
],
'issueCount' => '',
'name' => '',
'state' => '',
'trainingStats' => [
'analyzedConversationsCount' => '',
'issueStats' => [
],
'unclassifiedConversationsCount' => ''
],
'updateTime' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:parent/issueModels', [
'body' => '{
"createTime": "",
"displayName": "",
"inputDataConfig": {
"filter": "",
"medium": "",
"trainingConversationsCount": ""
},
"issueCount": "",
"name": "",
"state": "",
"trainingStats": {
"analyzedConversationsCount": "",
"issueStats": {},
"unclassifiedConversationsCount": ""
},
"updateTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/issueModels');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'createTime' => '',
'displayName' => '',
'inputDataConfig' => [
'filter' => '',
'medium' => '',
'trainingConversationsCount' => ''
],
'issueCount' => '',
'name' => '',
'state' => '',
'trainingStats' => [
'analyzedConversationsCount' => '',
'issueStats' => [
],
'unclassifiedConversationsCount' => ''
],
'updateTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'createTime' => '',
'displayName' => '',
'inputDataConfig' => [
'filter' => '',
'medium' => '',
'trainingConversationsCount' => ''
],
'issueCount' => '',
'name' => '',
'state' => '',
'trainingStats' => [
'analyzedConversationsCount' => '',
'issueStats' => [
],
'unclassifiedConversationsCount' => ''
],
'updateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:parent/issueModels');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/issueModels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"displayName": "",
"inputDataConfig": {
"filter": "",
"medium": "",
"trainingConversationsCount": ""
},
"issueCount": "",
"name": "",
"state": "",
"trainingStats": {
"analyzedConversationsCount": "",
"issueStats": {},
"unclassifiedConversationsCount": ""
},
"updateTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/issueModels' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"displayName": "",
"inputDataConfig": {
"filter": "",
"medium": "",
"trainingConversationsCount": ""
},
"issueCount": "",
"name": "",
"state": "",
"trainingStats": {
"analyzedConversationsCount": "",
"issueStats": {},
"unclassifiedConversationsCount": ""
},
"updateTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:parent/issueModels", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/issueModels"
payload = {
"createTime": "",
"displayName": "",
"inputDataConfig": {
"filter": "",
"medium": "",
"trainingConversationsCount": ""
},
"issueCount": "",
"name": "",
"state": "",
"trainingStats": {
"analyzedConversationsCount": "",
"issueStats": {},
"unclassifiedConversationsCount": ""
},
"updateTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/issueModels"
payload <- "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/issueModels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:parent/issueModels') do |req|
req.body = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"inputDataConfig\": {\n \"filter\": \"\",\n \"medium\": \"\",\n \"trainingConversationsCount\": \"\"\n },\n \"issueCount\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"trainingStats\": {\n \"analyzedConversationsCount\": \"\",\n \"issueStats\": {},\n \"unclassifiedConversationsCount\": \"\"\n },\n \"updateTime\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/issueModels";
let payload = json!({
"createTime": "",
"displayName": "",
"inputDataConfig": json!({
"filter": "",
"medium": "",
"trainingConversationsCount": ""
}),
"issueCount": "",
"name": "",
"state": "",
"trainingStats": json!({
"analyzedConversationsCount": "",
"issueStats": json!({}),
"unclassifiedConversationsCount": ""
}),
"updateTime": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:parent/issueModels \
--header 'content-type: application/json' \
--data '{
"createTime": "",
"displayName": "",
"inputDataConfig": {
"filter": "",
"medium": "",
"trainingConversationsCount": ""
},
"issueCount": "",
"name": "",
"state": "",
"trainingStats": {
"analyzedConversationsCount": "",
"issueStats": {},
"unclassifiedConversationsCount": ""
},
"updateTime": ""
}'
echo '{
"createTime": "",
"displayName": "",
"inputDataConfig": {
"filter": "",
"medium": "",
"trainingConversationsCount": ""
},
"issueCount": "",
"name": "",
"state": "",
"trainingStats": {
"analyzedConversationsCount": "",
"issueStats": {},
"unclassifiedConversationsCount": ""
},
"updateTime": ""
}' | \
http POST {{baseUrl}}/v1/:parent/issueModels \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "createTime": "",\n "displayName": "",\n "inputDataConfig": {\n "filter": "",\n "medium": "",\n "trainingConversationsCount": ""\n },\n "issueCount": "",\n "name": "",\n "state": "",\n "trainingStats": {\n "analyzedConversationsCount": "",\n "issueStats": {},\n "unclassifiedConversationsCount": ""\n },\n "updateTime": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:parent/issueModels
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"createTime": "",
"displayName": "",
"inputDataConfig": [
"filter": "",
"medium": "",
"trainingConversationsCount": ""
],
"issueCount": "",
"name": "",
"state": "",
"trainingStats": [
"analyzedConversationsCount": "",
"issueStats": [],
"unclassifiedConversationsCount": ""
],
"updateTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/issueModels")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.issueModels.deploy
{{baseUrl}}/v1/:name:deploy
QUERY PARAMS
name
BODY json
{
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:name:deploy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:name:deploy" {:content-type :json
:form-params {:name ""}})
require "http/client"
url = "{{baseUrl}}/v1/:name:deploy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:name:deploy"),
Content = new StringContent("{\n \"name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:name:deploy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:name:deploy"
payload := strings.NewReader("{\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:name:deploy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:name:deploy")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:name:deploy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:name:deploy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:name:deploy")
.header("content-type", "application/json")
.body("{\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:name:deploy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:name:deploy',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:name:deploy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:name:deploy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:name:deploy")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:name:deploy',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:name:deploy',
headers: {'content-type': 'application/json'},
body: {name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:name:deploy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:name:deploy',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:name:deploy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:name:deploy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:name:deploy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:name:deploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:name:deploy', [
'body' => '{
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:name:deploy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:name:deploy');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:name:deploy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:name:deploy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:name:deploy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:name:deploy"
payload = { "name": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:name:deploy"
payload <- "{\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:name:deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:name:deploy') do |req|
req.body = "{\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:name:deploy";
let payload = json!({"name": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:name:deploy \
--header 'content-type: application/json' \
--data '{
"name": ""
}'
echo '{
"name": ""
}' | \
http POST {{baseUrl}}/v1/:name:deploy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:name:deploy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["name": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:name:deploy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.issueModels.issues.list
{{baseUrl}}/v1/:parent/issues
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/issues");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:parent/issues")
require "http/client"
url = "{{baseUrl}}/v1/:parent/issues"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/issues"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/issues");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/issues"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:parent/issues HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:parent/issues")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/issues"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/issues")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:parent/issues")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:parent/issues');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/issues'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/issues';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/issues',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/issues")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/issues',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/issues'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:parent/issues');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/issues'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/issues';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/issues"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/issues" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/issues",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:parent/issues');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/issues');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:parent/issues');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/issues' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/issues' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:parent/issues")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/issues"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/issues"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/issues")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:parent/issues') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/issues";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:parent/issues
http GET {{baseUrl}}/v1/:parent/issues
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:parent/issues
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/issues")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.issueModels.list
{{baseUrl}}/v1/:parent/issueModels
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/issueModels");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:parent/issueModels")
require "http/client"
url = "{{baseUrl}}/v1/:parent/issueModels"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/issueModels"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/issueModels");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/issueModels"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:parent/issueModels HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:parent/issueModels")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/issueModels"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/issueModels")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:parent/issueModels")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:parent/issueModels');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/issueModels'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/issueModels';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/issueModels',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/issueModels")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/issueModels',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/issueModels'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:parent/issueModels');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/issueModels'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/issueModels';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/issueModels"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/issueModels" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/issueModels",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:parent/issueModels');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/issueModels');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:parent/issueModels');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/issueModels' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/issueModels' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:parent/issueModels")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/issueModels"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/issueModels"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/issueModels")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:parent/issueModels') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/issueModels";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:parent/issueModels
http GET {{baseUrl}}/v1/:parent/issueModels
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:parent/issueModels
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/issueModels")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.issueModels.undeploy
{{baseUrl}}/v1/:name:undeploy
QUERY PARAMS
name
BODY json
{
"name": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:name:undeploy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"name\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:name:undeploy" {:content-type :json
:form-params {:name ""}})
require "http/client"
url = "{{baseUrl}}/v1/:name:undeploy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:name:undeploy"),
Content = new StringContent("{\n \"name\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:name:undeploy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:name:undeploy"
payload := strings.NewReader("{\n \"name\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:name:undeploy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"name": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:name:undeploy")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:name:undeploy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:name:undeploy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:name:undeploy")
.header("content-type", "application/json")
.body("{\n \"name\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:name:undeploy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:name:undeploy',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:name:undeploy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:name:undeploy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:name:undeploy")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:name:undeploy',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({name: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:name:undeploy',
headers: {'content-type': 'application/json'},
body: {name: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:name:undeploy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:name:undeploy',
headers: {'content-type': 'application/json'},
data: {name: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:name:undeploy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:name:undeploy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:name:undeploy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:name:undeploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:name:undeploy', [
'body' => '{
"name": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:name:undeploy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:name:undeploy');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:name:undeploy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:name:undeploy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:name:undeploy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:name:undeploy"
payload = { "name": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:name:undeploy"
payload <- "{\n \"name\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:name:undeploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:name:undeploy') do |req|
req.body = "{\n \"name\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:name:undeploy";
let payload = json!({"name": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:name:undeploy \
--header 'content-type: application/json' \
--data '{
"name": ""
}'
echo '{
"name": ""
}' | \
http POST {{baseUrl}}/v1/:name:undeploy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:name:undeploy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["name": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:name:undeploy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.operations.cancel
{{baseUrl}}/v1/:name:cancel
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:name:cancel");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:name:cancel")
require "http/client"
url = "{{baseUrl}}/v1/:name:cancel"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:name:cancel"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:name:cancel");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:name:cancel"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:name:cancel HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:name:cancel")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:name:cancel"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:name:cancel")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:name:cancel")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:name:cancel');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/v1/:name:cancel'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:name:cancel';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:name:cancel',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:name:cancel")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:name:cancel',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/v1/:name:cancel'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:name:cancel');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'POST', url: '{{baseUrl}}/v1/:name:cancel'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:name:cancel';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:name:cancel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:name:cancel" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:name:cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:name:cancel');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:name:cancel');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:name:cancel');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:name:cancel' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:name:cancel' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/v1/:name:cancel")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:name:cancel"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:name:cancel"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:name:cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/v1/:name:cancel') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:name:cancel";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:name:cancel
http POST {{baseUrl}}/v1/:name:cancel
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/v1/:name:cancel
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:name:cancel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.operations.list
{{baseUrl}}/v1/:name/operations
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:name/operations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:name/operations")
require "http/client"
url = "{{baseUrl}}/v1/:name/operations"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:name/operations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:name/operations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:name/operations"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:name/operations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:name/operations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:name/operations"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:name/operations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:name/operations")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:name/operations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/:name/operations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:name/operations';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:name/operations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:name/operations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:name/operations',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/:name/operations'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:name/operations');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/:name/operations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:name/operations';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:name/operations"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:name/operations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:name/operations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:name/operations');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:name/operations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:name/operations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:name/operations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:name/operations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:name/operations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:name/operations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:name/operations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:name/operations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:name/operations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:name/operations";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:name/operations
http GET {{baseUrl}}/v1/:name/operations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:name/operations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:name/operations")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.phraseMatchers.create
{{baseUrl}}/v1/:parent/phraseMatchers
QUERY PARAMS
parent
BODY json
{
"activationUpdateTime": "",
"active": false,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": [
{
"phraseMatchRules": [
{
"config": {
"exactMatchConfig": {
"caseSensitive": false
}
},
"negated": false,
"query": ""
}
],
"type": ""
}
],
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/phraseMatchers");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:parent/phraseMatchers" {:content-type :json
:form-params {:activationUpdateTime ""
:active false
:displayName ""
:name ""
:phraseMatchRuleGroups [{:phraseMatchRules [{:config {:exactMatchConfig {:caseSensitive false}}
:negated false
:query ""}]
:type ""}]
:revisionCreateTime ""
:revisionId ""
:roleMatch ""
:type ""
:updateTime ""
:versionTag ""}})
require "http/client"
url = "{{baseUrl}}/v1/:parent/phraseMatchers"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/phraseMatchers"),
Content = new StringContent("{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/phraseMatchers");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/phraseMatchers"
payload := strings.NewReader("{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:parent/phraseMatchers HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 497
{
"activationUpdateTime": "",
"active": false,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": [
{
"phraseMatchRules": [
{
"config": {
"exactMatchConfig": {
"caseSensitive": false
}
},
"negated": false,
"query": ""
}
],
"type": ""
}
],
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:parent/phraseMatchers")
.setHeader("content-type", "application/json")
.setBody("{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/phraseMatchers"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/phraseMatchers")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:parent/phraseMatchers")
.header("content-type", "application/json")
.body("{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}")
.asString();
const data = JSON.stringify({
activationUpdateTime: '',
active: false,
displayName: '',
name: '',
phraseMatchRuleGroups: [
{
phraseMatchRules: [
{
config: {
exactMatchConfig: {
caseSensitive: false
}
},
negated: false,
query: ''
}
],
type: ''
}
],
revisionCreateTime: '',
revisionId: '',
roleMatch: '',
type: '',
updateTime: '',
versionTag: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:parent/phraseMatchers');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/phraseMatchers',
headers: {'content-type': 'application/json'},
data: {
activationUpdateTime: '',
active: false,
displayName: '',
name: '',
phraseMatchRuleGroups: [
{
phraseMatchRules: [
{config: {exactMatchConfig: {caseSensitive: false}}, negated: false, query: ''}
],
type: ''
}
],
revisionCreateTime: '',
revisionId: '',
roleMatch: '',
type: '',
updateTime: '',
versionTag: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/phraseMatchers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"activationUpdateTime":"","active":false,"displayName":"","name":"","phraseMatchRuleGroups":[{"phraseMatchRules":[{"config":{"exactMatchConfig":{"caseSensitive":false}},"negated":false,"query":""}],"type":""}],"revisionCreateTime":"","revisionId":"","roleMatch":"","type":"","updateTime":"","versionTag":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/phraseMatchers',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "activationUpdateTime": "",\n "active": false,\n "displayName": "",\n "name": "",\n "phraseMatchRuleGroups": [\n {\n "phraseMatchRules": [\n {\n "config": {\n "exactMatchConfig": {\n "caseSensitive": false\n }\n },\n "negated": false,\n "query": ""\n }\n ],\n "type": ""\n }\n ],\n "revisionCreateTime": "",\n "revisionId": "",\n "roleMatch": "",\n "type": "",\n "updateTime": "",\n "versionTag": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/phraseMatchers")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/phraseMatchers',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
activationUpdateTime: '',
active: false,
displayName: '',
name: '',
phraseMatchRuleGroups: [
{
phraseMatchRules: [
{config: {exactMatchConfig: {caseSensitive: false}}, negated: false, query: ''}
],
type: ''
}
],
revisionCreateTime: '',
revisionId: '',
roleMatch: '',
type: '',
updateTime: '',
versionTag: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/phraseMatchers',
headers: {'content-type': 'application/json'},
body: {
activationUpdateTime: '',
active: false,
displayName: '',
name: '',
phraseMatchRuleGroups: [
{
phraseMatchRules: [
{config: {exactMatchConfig: {caseSensitive: false}}, negated: false, query: ''}
],
type: ''
}
],
revisionCreateTime: '',
revisionId: '',
roleMatch: '',
type: '',
updateTime: '',
versionTag: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:parent/phraseMatchers');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
activationUpdateTime: '',
active: false,
displayName: '',
name: '',
phraseMatchRuleGroups: [
{
phraseMatchRules: [
{
config: {
exactMatchConfig: {
caseSensitive: false
}
},
negated: false,
query: ''
}
],
type: ''
}
],
revisionCreateTime: '',
revisionId: '',
roleMatch: '',
type: '',
updateTime: '',
versionTag: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/phraseMatchers',
headers: {'content-type': 'application/json'},
data: {
activationUpdateTime: '',
active: false,
displayName: '',
name: '',
phraseMatchRuleGroups: [
{
phraseMatchRules: [
{config: {exactMatchConfig: {caseSensitive: false}}, negated: false, query: ''}
],
type: ''
}
],
revisionCreateTime: '',
revisionId: '',
roleMatch: '',
type: '',
updateTime: '',
versionTag: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/phraseMatchers';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"activationUpdateTime":"","active":false,"displayName":"","name":"","phraseMatchRuleGroups":[{"phraseMatchRules":[{"config":{"exactMatchConfig":{"caseSensitive":false}},"negated":false,"query":""}],"type":""}],"revisionCreateTime":"","revisionId":"","roleMatch":"","type":"","updateTime":"","versionTag":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"activationUpdateTime": @"",
@"active": @NO,
@"displayName": @"",
@"name": @"",
@"phraseMatchRuleGroups": @[ @{ @"phraseMatchRules": @[ @{ @"config": @{ @"exactMatchConfig": @{ @"caseSensitive": @NO } }, @"negated": @NO, @"query": @"" } ], @"type": @"" } ],
@"revisionCreateTime": @"",
@"revisionId": @"",
@"roleMatch": @"",
@"type": @"",
@"updateTime": @"",
@"versionTag": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/phraseMatchers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/phraseMatchers" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/phraseMatchers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'activationUpdateTime' => '',
'active' => null,
'displayName' => '',
'name' => '',
'phraseMatchRuleGroups' => [
[
'phraseMatchRules' => [
[
'config' => [
'exactMatchConfig' => [
'caseSensitive' => null
]
],
'negated' => null,
'query' => ''
]
],
'type' => ''
]
],
'revisionCreateTime' => '',
'revisionId' => '',
'roleMatch' => '',
'type' => '',
'updateTime' => '',
'versionTag' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:parent/phraseMatchers', [
'body' => '{
"activationUpdateTime": "",
"active": false,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": [
{
"phraseMatchRules": [
{
"config": {
"exactMatchConfig": {
"caseSensitive": false
}
},
"negated": false,
"query": ""
}
],
"type": ""
}
],
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/phraseMatchers');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'activationUpdateTime' => '',
'active' => null,
'displayName' => '',
'name' => '',
'phraseMatchRuleGroups' => [
[
'phraseMatchRules' => [
[
'config' => [
'exactMatchConfig' => [
'caseSensitive' => null
]
],
'negated' => null,
'query' => ''
]
],
'type' => ''
]
],
'revisionCreateTime' => '',
'revisionId' => '',
'roleMatch' => '',
'type' => '',
'updateTime' => '',
'versionTag' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'activationUpdateTime' => '',
'active' => null,
'displayName' => '',
'name' => '',
'phraseMatchRuleGroups' => [
[
'phraseMatchRules' => [
[
'config' => [
'exactMatchConfig' => [
'caseSensitive' => null
]
],
'negated' => null,
'query' => ''
]
],
'type' => ''
]
],
'revisionCreateTime' => '',
'revisionId' => '',
'roleMatch' => '',
'type' => '',
'updateTime' => '',
'versionTag' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:parent/phraseMatchers');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/phraseMatchers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"activationUpdateTime": "",
"active": false,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": [
{
"phraseMatchRules": [
{
"config": {
"exactMatchConfig": {
"caseSensitive": false
}
},
"negated": false,
"query": ""
}
],
"type": ""
}
],
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/phraseMatchers' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"activationUpdateTime": "",
"active": false,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": [
{
"phraseMatchRules": [
{
"config": {
"exactMatchConfig": {
"caseSensitive": false
}
},
"negated": false,
"query": ""
}
],
"type": ""
}
],
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:parent/phraseMatchers", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/phraseMatchers"
payload = {
"activationUpdateTime": "",
"active": False,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": [
{
"phraseMatchRules": [
{
"config": { "exactMatchConfig": { "caseSensitive": False } },
"negated": False,
"query": ""
}
],
"type": ""
}
],
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/phraseMatchers"
payload <- "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/phraseMatchers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:parent/phraseMatchers') do |req|
req.body = "{\n \"activationUpdateTime\": \"\",\n \"active\": false,\n \"displayName\": \"\",\n \"name\": \"\",\n \"phraseMatchRuleGroups\": [\n {\n \"phraseMatchRules\": [\n {\n \"config\": {\n \"exactMatchConfig\": {\n \"caseSensitive\": false\n }\n },\n \"negated\": false,\n \"query\": \"\"\n }\n ],\n \"type\": \"\"\n }\n ],\n \"revisionCreateTime\": \"\",\n \"revisionId\": \"\",\n \"roleMatch\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\",\n \"versionTag\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/phraseMatchers";
let payload = json!({
"activationUpdateTime": "",
"active": false,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": (
json!({
"phraseMatchRules": (
json!({
"config": json!({"exactMatchConfig": json!({"caseSensitive": false})}),
"negated": false,
"query": ""
})
),
"type": ""
})
),
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:parent/phraseMatchers \
--header 'content-type: application/json' \
--data '{
"activationUpdateTime": "",
"active": false,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": [
{
"phraseMatchRules": [
{
"config": {
"exactMatchConfig": {
"caseSensitive": false
}
},
"negated": false,
"query": ""
}
],
"type": ""
}
],
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
}'
echo '{
"activationUpdateTime": "",
"active": false,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": [
{
"phraseMatchRules": [
{
"config": {
"exactMatchConfig": {
"caseSensitive": false
}
},
"negated": false,
"query": ""
}
],
"type": ""
}
],
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
}' | \
http POST {{baseUrl}}/v1/:parent/phraseMatchers \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "activationUpdateTime": "",\n "active": false,\n "displayName": "",\n "name": "",\n "phraseMatchRuleGroups": [\n {\n "phraseMatchRules": [\n {\n "config": {\n "exactMatchConfig": {\n "caseSensitive": false\n }\n },\n "negated": false,\n "query": ""\n }\n ],\n "type": ""\n }\n ],\n "revisionCreateTime": "",\n "revisionId": "",\n "roleMatch": "",\n "type": "",\n "updateTime": "",\n "versionTag": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:parent/phraseMatchers
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"activationUpdateTime": "",
"active": false,
"displayName": "",
"name": "",
"phraseMatchRuleGroups": [
[
"phraseMatchRules": [
[
"config": ["exactMatchConfig": ["caseSensitive": false]],
"negated": false,
"query": ""
]
],
"type": ""
]
],
"revisionCreateTime": "",
"revisionId": "",
"roleMatch": "",
"type": "",
"updateTime": "",
"versionTag": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/phraseMatchers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.phraseMatchers.list
{{baseUrl}}/v1/:parent/phraseMatchers
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/phraseMatchers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:parent/phraseMatchers")
require "http/client"
url = "{{baseUrl}}/v1/:parent/phraseMatchers"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/phraseMatchers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/phraseMatchers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/phraseMatchers"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:parent/phraseMatchers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:parent/phraseMatchers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/phraseMatchers"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/phraseMatchers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:parent/phraseMatchers")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:parent/phraseMatchers');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/phraseMatchers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/phraseMatchers';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/phraseMatchers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/phraseMatchers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/phraseMatchers',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/phraseMatchers'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:parent/phraseMatchers');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/phraseMatchers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/phraseMatchers';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/phraseMatchers"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/phraseMatchers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/phraseMatchers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:parent/phraseMatchers');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/phraseMatchers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:parent/phraseMatchers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/phraseMatchers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/phraseMatchers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:parent/phraseMatchers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/phraseMatchers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/phraseMatchers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/phraseMatchers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:parent/phraseMatchers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/phraseMatchers";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:parent/phraseMatchers
http GET {{baseUrl}}/v1/:parent/phraseMatchers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:parent/phraseMatchers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/phraseMatchers")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
contactcenterinsights.projects.locations.views.create
{{baseUrl}}/v1/:parent/views
QUERY PARAMS
parent
BODY json
{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/views");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1/:parent/views" {:content-type :json
:form-params {:createTime ""
:displayName ""
:name ""
:updateTime ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/v1/:parent/views"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/views"),
Content = new StringContent("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/views");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/views"
payload := strings.NewReader("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1/:parent/views HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 92
{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1/:parent/views")
.setHeader("content-type", "application/json")
.setBody("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/views"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/views")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1/:parent/views")
.header("content-type", "application/json")
.body("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
createTime: '',
displayName: '',
name: '',
updateTime: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1/:parent/views');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/views',
headers: {'content-type': 'application/json'},
data: {createTime: '', displayName: '', name: '', updateTime: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/views';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","displayName":"","name":"","updateTime":"","value":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/views',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "createTime": "",\n "displayName": "",\n "name": "",\n "updateTime": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/views")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/views',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({createTime: '', displayName: '', name: '', updateTime: '', value: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/views',
headers: {'content-type': 'application/json'},
body: {createTime: '', displayName: '', name: '', updateTime: '', value: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1/:parent/views');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
createTime: '',
displayName: '',
name: '',
updateTime: '',
value: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1/:parent/views',
headers: {'content-type': 'application/json'},
data: {createTime: '', displayName: '', name: '', updateTime: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/views';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","displayName":"","name":"","updateTime":"","value":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"createTime": @"",
@"displayName": @"",
@"name": @"",
@"updateTime": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/views"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/views" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/views",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'createTime' => '',
'displayName' => '',
'name' => '',
'updateTime' => '',
'value' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1/:parent/views', [
'body' => '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/views');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'createTime' => '',
'displayName' => '',
'name' => '',
'updateTime' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'createTime' => '',
'displayName' => '',
'name' => '',
'updateTime' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:parent/views');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/views' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/views' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1/:parent/views", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/views"
payload = {
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/views"
payload <- "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/views")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1/:parent/views') do |req|
req.body = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/views";
let payload = json!({
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1/:parent/views \
--header 'content-type: application/json' \
--data '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}'
echo '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}' | \
http POST {{baseUrl}}/v1/:parent/views \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "createTime": "",\n "displayName": "",\n "name": "",\n "updateTime": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:parent/views
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/views")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
contactcenterinsights.projects.locations.views.delete
{{baseUrl}}/v1/:name
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1/:name")
require "http/client"
url = "{{baseUrl}}/v1/:name"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/v1/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:name");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:name"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/v1/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:name"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:name")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1/:name")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/v1/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v1/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:name';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:name',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:name")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:name',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'DELETE', url: '{{baseUrl}}/v1/:name'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v1/:name');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'DELETE', url: '{{baseUrl}}/v1/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:name';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:name"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:name" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:name",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/v1/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:name');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:name');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:name' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:name' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:name"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:name"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:name")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/v1/:name') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:name";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/v1/:name
http DELETE {{baseUrl}}/v1/:name
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v1/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:name")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.views.get
{{baseUrl}}/v1/:name
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:name")
require "http/client"
url = "{{baseUrl}}/v1/:name"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:name");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:name"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:name"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:name")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:name")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:name';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:name',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:name")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:name',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/:name'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:name');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:name';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:name"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:name" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:name",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:name');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:name');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:name' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:name' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:name"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:name"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:name")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:name') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:name";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:name
http GET {{baseUrl}}/v1/:name
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:name")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
contactcenterinsights.projects.locations.views.list
{{baseUrl}}/v1/:parent/views
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:parent/views");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1/:parent/views")
require "http/client"
url = "{{baseUrl}}/v1/:parent/views"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/v1/:parent/views"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:parent/views");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:parent/views"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/v1/:parent/views HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1/:parent/views")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:parent/views"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:parent/views")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1/:parent/views")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/v1/:parent/views');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/views'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:parent/views';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:parent/views',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1/:parent/views")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:parent/views',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/views'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1/:parent/views');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/v1/:parent/views'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:parent/views';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:parent/views"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:parent/views" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:parent/views",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/v1/:parent/views');
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:parent/views');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1/:parent/views');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:parent/views' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:parent/views' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1/:parent/views")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:parent/views"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:parent/views"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:parent/views")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/v1/:parent/views') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:parent/views";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/v1/:parent/views
http GET {{baseUrl}}/v1/:parent/views
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1/:parent/views
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:parent/views")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
PATCH
contactcenterinsights.projects.locations.views.patch
{{baseUrl}}/v1/:name
QUERY PARAMS
name
BODY json
{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1/:name");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/v1/:name" {:content-type :json
:form-params {:createTime ""
:displayName ""
:name ""
:updateTime ""
:value ""}})
require "http/client"
url = "{{baseUrl}}/v1/:name"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/v1/:name"),
Content = new StringContent("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1/:name");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1/:name"
payload := strings.NewReader("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
PATCH /baseUrl/v1/:name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 92
{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/v1/:name")
.setHeader("content-type", "application/json")
.setBody("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1/:name"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1/:name")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/v1/:name")
.header("content-type", "application/json")
.body("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
.asString();
const data = JSON.stringify({
createTime: '',
displayName: '',
name: '',
updateTime: '',
value: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/v1/:name');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v1/:name',
headers: {'content-type': 'application/json'},
data: {createTime: '', displayName: '', name: '', updateTime: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","displayName":"","name":"","updateTime":"","value":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1/:name',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "createTime": "",\n "displayName": "",\n "name": "",\n "updateTime": "",\n "value": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1/:name")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1/:name',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({createTime: '', displayName: '', name: '', updateTime: '', value: ''}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v1/:name',
headers: {'content-type': 'application/json'},
body: {createTime: '', displayName: '', name: '', updateTime: '', value: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/v1/:name');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
createTime: '',
displayName: '',
name: '',
updateTime: '',
value: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v1/:name',
headers: {'content-type': 'application/json'},
data: {createTime: '', displayName: '', name: '', updateTime: '', value: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","displayName":"","name":"","updateTime":"","value":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"createTime": @"",
@"displayName": @"",
@"name": @"",
@"updateTime": @"",
@"value": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1/:name"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1/:name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1/:name",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'createTime' => '',
'displayName' => '',
'name' => '',
'updateTime' => '',
'value' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('PATCH', '{{baseUrl}}/v1/:name', [
'body' => '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1/:name');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'createTime' => '',
'displayName' => '',
'name' => '',
'updateTime' => '',
'value' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'createTime' => '',
'displayName' => '',
'name' => '',
'updateTime' => '',
'value' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1/:name');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/v1/:name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1/:name"
payload = {
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1/:name"
payload <- "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1/:name")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/v1/:name') do |req|
req.body = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\",\n \"value\": \"\"\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1/:name";
let payload = json!({
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PATCH").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/v1/:name \
--header 'content-type: application/json' \
--data '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}'
echo '{
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
}' | \
http PATCH {{baseUrl}}/v1/:name \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "createTime": "",\n "displayName": "",\n "name": "",\n "updateTime": "",\n "value": ""\n}' \
--output-document \
- {{baseUrl}}/v1/:name
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"createTime": "",
"displayName": "",
"name": "",
"updateTime": "",
"value": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1/:name")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()