Recommendations AI (Beta)
POST
recommendationengine.projects.locations.catalogs.catalogItems.create
{{baseUrl}}/v1beta1/:+parent/catalogItems
QUERY PARAMS
parent
BODY json
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/catalogItems");
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 \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta1/:+parent/catalogItems" {:content-type :json
:form-params {:tags []
:categoryHierarchies [{:categories []}]
:description ""
:id ""
:itemAttributes {:categoricalFeatures {}
:numericalFeatures {}}
:itemGroupId ""
:languageCode ""
:productMetadata {:availableQuantity ""
:canonicalProductUri ""
:costs {}
:currencyCode ""
:exactPrice {:displayPrice ""
:originalPrice ""}
:images [{:height 0
:uri ""
:width 0}]
:priceRange {:max ""
:min ""}
:stockState ""}
:title ""}})
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/catalogItems"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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}}/v1beta1/:+parent/catalogItems"),
Content = new StringContent("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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}}/v1beta1/:+parent/catalogItems");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/catalogItems"
payload := strings.NewReader("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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/v1beta1/:+parent/catalogItems HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 647
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta1/:+parent/catalogItems")
.setHeader("content-type", "application/json")
.setBody("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/catalogItems"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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 \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/catalogItems")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta1/:+parent/catalogItems")
.header("content-type", "application/json")
.body("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}")
.asString();
const data = JSON.stringify({
tags: [],
categoryHierarchies: [
{
categories: []
}
],
description: '',
id: '',
itemAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {
displayPrice: '',
originalPrice: ''
},
images: [
{
height: 0,
uri: '',
width: 0
}
],
priceRange: {
max: '',
min: ''
},
stockState: ''
},
title: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta1/:+parent/catalogItems');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/catalogItems',
headers: {'content-type': 'application/json'},
data: {
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/catalogItems';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"tags":[],"categoryHierarchies":[{"categories":[]}],"description":"","id":"","itemAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"itemGroupId":"","languageCode":"","productMetadata":{"availableQuantity":"","canonicalProductUri":"","costs":{},"currencyCode":"","exactPrice":{"displayPrice":"","originalPrice":""},"images":[{"height":0,"uri":"","width":0}],"priceRange":{"max":"","min":""},"stockState":""},"title":""}'
};
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}}/v1beta1/:+parent/catalogItems',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "tags": [],\n "categoryHierarchies": [\n {\n "categories": []\n }\n ],\n "description": "",\n "id": "",\n "itemAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "itemGroupId": "",\n "languageCode": "",\n "productMetadata": {\n "availableQuantity": "",\n "canonicalProductUri": "",\n "costs": {},\n "currencyCode": "",\n "exactPrice": {\n "displayPrice": "",\n "originalPrice": ""\n },\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "priceRange": {\n "max": "",\n "min": ""\n },\n "stockState": ""\n },\n "title": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/catalogItems")
.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/v1beta1/:+parent/catalogItems',
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({
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/catalogItems',
headers: {'content-type': 'application/json'},
body: {
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
},
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}}/v1beta1/:+parent/catalogItems');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
tags: [],
categoryHierarchies: [
{
categories: []
}
],
description: '',
id: '',
itemAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {
displayPrice: '',
originalPrice: ''
},
images: [
{
height: 0,
uri: '',
width: 0
}
],
priceRange: {
max: '',
min: ''
},
stockState: ''
},
title: ''
});
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}}/v1beta1/:+parent/catalogItems',
headers: {'content-type': 'application/json'},
data: {
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/catalogItems';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"tags":[],"categoryHierarchies":[{"categories":[]}],"description":"","id":"","itemAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"itemGroupId":"","languageCode":"","productMetadata":{"availableQuantity":"","canonicalProductUri":"","costs":{},"currencyCode":"","exactPrice":{"displayPrice":"","originalPrice":""},"images":[{"height":0,"uri":"","width":0}],"priceRange":{"max":"","min":""},"stockState":""},"title":""}'
};
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 = @{ @"tags": @[ ],
@"categoryHierarchies": @[ @{ @"categories": @[ ] } ],
@"description": @"",
@"id": @"",
@"itemAttributes": @{ @"categoricalFeatures": @{ }, @"numericalFeatures": @{ } },
@"itemGroupId": @"",
@"languageCode": @"",
@"productMetadata": @{ @"availableQuantity": @"", @"canonicalProductUri": @"", @"costs": @{ }, @"currencyCode": @"", @"exactPrice": @{ @"displayPrice": @"", @"originalPrice": @"" }, @"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ], @"priceRange": @{ @"max": @"", @"min": @"" }, @"stockState": @"" },
@"title": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta1/:+parent/catalogItems"]
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}}/v1beta1/:+parent/catalogItems" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/catalogItems",
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([
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]),
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}}/v1beta1/:+parent/catalogItems', [
'body' => '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/catalogItems');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1beta1/:+parent/catalogItems');
$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}}/v1beta1/:+parent/catalogItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/catalogItems' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta1/:+parent/catalogItems", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/catalogItems"
payload = {
"tags": [],
"categoryHierarchies": [{ "categories": [] }],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/catalogItems"
payload <- "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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}}/v1beta1/:+parent/catalogItems")
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 \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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/v1beta1/:+parent/catalogItems') do |req|
req.body = "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/catalogItems";
let payload = json!({
"tags": (),
"categoryHierarchies": (json!({"categories": ()})),
"description": "",
"id": "",
"itemAttributes": json!({
"categoricalFeatures": json!({}),
"numericalFeatures": json!({})
}),
"itemGroupId": "",
"languageCode": "",
"productMetadata": json!({
"availableQuantity": "",
"canonicalProductUri": "",
"costs": json!({}),
"currencyCode": "",
"exactPrice": json!({
"displayPrice": "",
"originalPrice": ""
}),
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"priceRange": json!({
"max": "",
"min": ""
}),
"stockState": ""
}),
"title": ""
});
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}}/v1beta1/:+parent/catalogItems' \
--header 'content-type: application/json' \
--data '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}'
echo '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}' | \
http POST '{{baseUrl}}/v1beta1/:+parent/catalogItems' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "tags": [],\n "categoryHierarchies": [\n {\n "categories": []\n }\n ],\n "description": "",\n "id": "",\n "itemAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "itemGroupId": "",\n "languageCode": "",\n "productMetadata": {\n "availableQuantity": "",\n "canonicalProductUri": "",\n "costs": {},\n "currencyCode": "",\n "exactPrice": {\n "displayPrice": "",\n "originalPrice": ""\n },\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "priceRange": {\n "max": "",\n "min": ""\n },\n "stockState": ""\n },\n "title": ""\n}' \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/catalogItems'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"tags": [],
"categoryHierarchies": [["categories": []]],
"description": "",
"id": "",
"itemAttributes": [
"categoricalFeatures": [],
"numericalFeatures": []
],
"itemGroupId": "",
"languageCode": "",
"productMetadata": [
"availableQuantity": "",
"canonicalProductUri": "",
"costs": [],
"currencyCode": "",
"exactPrice": [
"displayPrice": "",
"originalPrice": ""
],
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"priceRange": [
"max": "",
"min": ""
],
"stockState": ""
],
"title": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/catalogItems")! 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
recommendationengine.projects.locations.catalogs.catalogItems.delete
{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1beta1/:+name")
require "http/client"
url = "{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta1/:+name");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+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/v1beta1/:+name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1beta1/:+name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v1beta1/:+name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+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/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+name" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+name');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta1/:+name');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta1/:+name' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+name' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1beta1/:+name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+name"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+name"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta1/:+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/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+name'
http DELETE '{{baseUrl}}/v1beta1/:+name'
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/v1beta1/:+name'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+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
recommendationengine.projects.locations.catalogs.catalogItems.get
{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta1/:+name")
require "http/client"
url = "{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta1/:+name");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+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/v1beta1/:+name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta1/:+name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1beta1/:+name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+name")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+name" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+name');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta1/:+name');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta1/:+name' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+name' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta1/:+name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+name"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+name"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta1/:+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/v1beta1/:+name') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name'
http GET '{{baseUrl}}/v1beta1/:+name'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/v1beta1/:+name'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+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()
POST
recommendationengine.projects.locations.catalogs.catalogItems.import
{{baseUrl}}/v1beta1/:+parent/catalogItems:import
QUERY PARAMS
parent
BODY json
{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": "",
"updateMask": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/catalogItems:import");
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 \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta1/:+parent/catalogItems:import" {:content-type :json
:form-params {:errorsConfig {:gcsPrefix ""}
:inputConfig {:bigQuerySource {:dataSchema ""
:datasetId ""
:gcsStagingDir ""
:projectId ""
:tableId ""}
:catalogInlineSource {:catalogItems [{:tags []
:categoryHierarchies [{:categories []}]
:description ""
:id ""
:itemAttributes {:categoricalFeatures {}
:numericalFeatures {}}
:itemGroupId ""
:languageCode ""
:productMetadata {:availableQuantity ""
:canonicalProductUri ""
:costs {}
:currencyCode ""
:exactPrice {:displayPrice ""
:originalPrice ""}
:images [{:height 0
:uri ""
:width 0}]
:priceRange {:max ""
:min ""}
:stockState ""}
:title ""}]}
:gcsSource {:inputUris []
:jsonSchema ""}
:userEventInlineSource {:userEvents [{:eventDetail {:eventAttributes {}
:experimentIds []
:pageViewId ""
:recommendationToken ""
:referrerUri ""
:uri ""}
:eventSource ""
:eventTime ""
:eventType ""
:productEventDetail {:cartId ""
:listId ""
:pageCategories [{}]
:productDetails [{:availableQuantity 0
:currencyCode ""
:displayPrice ""
:id ""
:itemAttributes {}
:originalPrice ""
:quantity 0
:stockState ""}]
:purchaseTransaction {:costs {}
:currencyCode ""
:id ""
:revenue ""
:taxes {}}
:searchQuery ""}
:userInfo {:directUserRequest false
:ipAddress ""
:userAgent ""
:userId ""
:visitorId ""}}]}}
:requestId ""
:updateMask ""}})
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/catalogItems:import"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\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}}/v1beta1/:+parent/catalogItems:import"),
Content = new StringContent("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\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}}/v1beta1/:+parent/catalogItems:import");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/catalogItems:import"
payload := strings.NewReader("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\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/v1beta1/:+parent/catalogItems:import HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2687
{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": "",
"updateMask": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta1/:+parent/catalogItems:import")
.setHeader("content-type", "application/json")
.setBody("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/catalogItems:import"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\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 \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/catalogItems:import")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta1/:+parent/catalogItems:import")
.header("content-type", "application/json")
.body("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\n}")
.asString();
const data = JSON.stringify({
errorsConfig: {
gcsPrefix: ''
},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
projectId: '',
tableId: ''
},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [
{
categories: []
}
],
description: '',
id: '',
itemAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {
displayPrice: '',
originalPrice: ''
},
images: [
{
height: 0,
uri: '',
width: 0
}
],
priceRange: {
max: '',
min: ''
},
stockState: ''
},
title: ''
}
]
},
gcsSource: {
inputUris: [],
jsonSchema: ''
},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [
{}
],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {
costs: {},
currencyCode: '',
id: '',
revenue: '',
taxes: {}
},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: '',
updateMask: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta1/:+parent/catalogItems:import');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/catalogItems:import',
headers: {'content-type': 'application/json'},
data: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {dataSchema: '', datasetId: '', gcsStagingDir: '', projectId: '', tableId: ''},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
]
},
gcsSource: {inputUris: [], jsonSchema: ''},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: '',
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/catalogItems:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"errorsConfig":{"gcsPrefix":""},"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","projectId":"","tableId":""},"catalogInlineSource":{"catalogItems":[{"tags":[],"categoryHierarchies":[{"categories":[]}],"description":"","id":"","itemAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"itemGroupId":"","languageCode":"","productMetadata":{"availableQuantity":"","canonicalProductUri":"","costs":{},"currencyCode":"","exactPrice":{"displayPrice":"","originalPrice":""},"images":[{"height":0,"uri":"","width":0}],"priceRange":{"max":"","min":""},"stockState":""},"title":""}]},"gcsSource":{"inputUris":[],"jsonSchema":""},"userEventInlineSource":{"userEvents":[{"eventDetail":{"eventAttributes":{},"experimentIds":[],"pageViewId":"","recommendationToken":"","referrerUri":"","uri":""},"eventSource":"","eventTime":"","eventType":"","productEventDetail":{"cartId":"","listId":"","pageCategories":[{}],"productDetails":[{"availableQuantity":0,"currencyCode":"","displayPrice":"","id":"","itemAttributes":{},"originalPrice":"","quantity":0,"stockState":""}],"purchaseTransaction":{"costs":{},"currencyCode":"","id":"","revenue":"","taxes":{}},"searchQuery":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":"","visitorId":""}}]}},"requestId":"","updateMask":""}'
};
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}}/v1beta1/:+parent/catalogItems:import',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "errorsConfig": {\n "gcsPrefix": ""\n },\n "inputConfig": {\n "bigQuerySource": {\n "dataSchema": "",\n "datasetId": "",\n "gcsStagingDir": "",\n "projectId": "",\n "tableId": ""\n },\n "catalogInlineSource": {\n "catalogItems": [\n {\n "tags": [],\n "categoryHierarchies": [\n {\n "categories": []\n }\n ],\n "description": "",\n "id": "",\n "itemAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "itemGroupId": "",\n "languageCode": "",\n "productMetadata": {\n "availableQuantity": "",\n "canonicalProductUri": "",\n "costs": {},\n "currencyCode": "",\n "exactPrice": {\n "displayPrice": "",\n "originalPrice": ""\n },\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "priceRange": {\n "max": "",\n "min": ""\n },\n "stockState": ""\n },\n "title": ""\n }\n ]\n },\n "gcsSource": {\n "inputUris": [],\n "jsonSchema": ""\n },\n "userEventInlineSource": {\n "userEvents": [\n {\n "eventDetail": {\n "eventAttributes": {},\n "experimentIds": [],\n "pageViewId": "",\n "recommendationToken": "",\n "referrerUri": "",\n "uri": ""\n },\n "eventSource": "",\n "eventTime": "",\n "eventType": "",\n "productEventDetail": {\n "cartId": "",\n "listId": "",\n "pageCategories": [\n {}\n ],\n "productDetails": [\n {\n "availableQuantity": 0,\n "currencyCode": "",\n "displayPrice": "",\n "id": "",\n "itemAttributes": {},\n "originalPrice": "",\n "quantity": 0,\n "stockState": ""\n }\n ],\n "purchaseTransaction": {\n "costs": {},\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "taxes": {}\n },\n "searchQuery": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": "",\n "visitorId": ""\n }\n }\n ]\n }\n },\n "requestId": "",\n "updateMask": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/catalogItems:import")
.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/v1beta1/:+parent/catalogItems:import',
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({
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {dataSchema: '', datasetId: '', gcsStagingDir: '', projectId: '', tableId: ''},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
]
},
gcsSource: {inputUris: [], jsonSchema: ''},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: '',
updateMask: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/catalogItems:import',
headers: {'content-type': 'application/json'},
body: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {dataSchema: '', datasetId: '', gcsStagingDir: '', projectId: '', tableId: ''},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
]
},
gcsSource: {inputUris: [], jsonSchema: ''},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: '',
updateMask: ''
},
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}}/v1beta1/:+parent/catalogItems:import');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
errorsConfig: {
gcsPrefix: ''
},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
projectId: '',
tableId: ''
},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [
{
categories: []
}
],
description: '',
id: '',
itemAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {
displayPrice: '',
originalPrice: ''
},
images: [
{
height: 0,
uri: '',
width: 0
}
],
priceRange: {
max: '',
min: ''
},
stockState: ''
},
title: ''
}
]
},
gcsSource: {
inputUris: [],
jsonSchema: ''
},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [
{}
],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {
costs: {},
currencyCode: '',
id: '',
revenue: '',
taxes: {}
},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: '',
updateMask: ''
});
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}}/v1beta1/:+parent/catalogItems:import',
headers: {'content-type': 'application/json'},
data: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {dataSchema: '', datasetId: '', gcsStagingDir: '', projectId: '', tableId: ''},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
]
},
gcsSource: {inputUris: [], jsonSchema: ''},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: '',
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/catalogItems:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"errorsConfig":{"gcsPrefix":""},"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","projectId":"","tableId":""},"catalogInlineSource":{"catalogItems":[{"tags":[],"categoryHierarchies":[{"categories":[]}],"description":"","id":"","itemAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"itemGroupId":"","languageCode":"","productMetadata":{"availableQuantity":"","canonicalProductUri":"","costs":{},"currencyCode":"","exactPrice":{"displayPrice":"","originalPrice":""},"images":[{"height":0,"uri":"","width":0}],"priceRange":{"max":"","min":""},"stockState":""},"title":""}]},"gcsSource":{"inputUris":[],"jsonSchema":""},"userEventInlineSource":{"userEvents":[{"eventDetail":{"eventAttributes":{},"experimentIds":[],"pageViewId":"","recommendationToken":"","referrerUri":"","uri":""},"eventSource":"","eventTime":"","eventType":"","productEventDetail":{"cartId":"","listId":"","pageCategories":[{}],"productDetails":[{"availableQuantity":0,"currencyCode":"","displayPrice":"","id":"","itemAttributes":{},"originalPrice":"","quantity":0,"stockState":""}],"purchaseTransaction":{"costs":{},"currencyCode":"","id":"","revenue":"","taxes":{}},"searchQuery":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":"","visitorId":""}}]}},"requestId":"","updateMask":""}'
};
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 = @{ @"errorsConfig": @{ @"gcsPrefix": @"" },
@"inputConfig": @{ @"bigQuerySource": @{ @"dataSchema": @"", @"datasetId": @"", @"gcsStagingDir": @"", @"projectId": @"", @"tableId": @"" }, @"catalogInlineSource": @{ @"catalogItems": @[ @{ @"tags": @[ ], @"categoryHierarchies": @[ @{ @"categories": @[ ] } ], @"description": @"", @"id": @"", @"itemAttributes": @{ @"categoricalFeatures": @{ }, @"numericalFeatures": @{ } }, @"itemGroupId": @"", @"languageCode": @"", @"productMetadata": @{ @"availableQuantity": @"", @"canonicalProductUri": @"", @"costs": @{ }, @"currencyCode": @"", @"exactPrice": @{ @"displayPrice": @"", @"originalPrice": @"" }, @"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ], @"priceRange": @{ @"max": @"", @"min": @"" }, @"stockState": @"" }, @"title": @"" } ] }, @"gcsSource": @{ @"inputUris": @[ ], @"jsonSchema": @"" }, @"userEventInlineSource": @{ @"userEvents": @[ @{ @"eventDetail": @{ @"eventAttributes": @{ }, @"experimentIds": @[ ], @"pageViewId": @"", @"recommendationToken": @"", @"referrerUri": @"", @"uri": @"" }, @"eventSource": @"", @"eventTime": @"", @"eventType": @"", @"productEventDetail": @{ @"cartId": @"", @"listId": @"", @"pageCategories": @[ @{ } ], @"productDetails": @[ @{ @"availableQuantity": @0, @"currencyCode": @"", @"displayPrice": @"", @"id": @"", @"itemAttributes": @{ }, @"originalPrice": @"", @"quantity": @0, @"stockState": @"" } ], @"purchaseTransaction": @{ @"costs": @{ }, @"currencyCode": @"", @"id": @"", @"revenue": @"", @"taxes": @{ } }, @"searchQuery": @"" }, @"userInfo": @{ @"directUserRequest": @NO, @"ipAddress": @"", @"userAgent": @"", @"userId": @"", @"visitorId": @"" } } ] } },
@"requestId": @"",
@"updateMask": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta1/:+parent/catalogItems:import"]
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}}/v1beta1/:+parent/catalogItems:import" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/catalogItems:import",
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([
'errorsConfig' => [
'gcsPrefix' => ''
],
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'projectId' => '',
'tableId' => ''
],
'catalogInlineSource' => [
'catalogItems' => [
[
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]
]
],
'gcsSource' => [
'inputUris' => [
],
'jsonSchema' => ''
],
'userEventInlineSource' => [
'userEvents' => [
[
'eventDetail' => [
'eventAttributes' => [
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]
]
]
],
'requestId' => '',
'updateMask' => ''
]),
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}}/v1beta1/:+parent/catalogItems:import', [
'body' => '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": "",
"updateMask": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/catalogItems:import');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'errorsConfig' => [
'gcsPrefix' => ''
],
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'projectId' => '',
'tableId' => ''
],
'catalogInlineSource' => [
'catalogItems' => [
[
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]
]
],
'gcsSource' => [
'inputUris' => [
],
'jsonSchema' => ''
],
'userEventInlineSource' => [
'userEvents' => [
[
'eventDetail' => [
'eventAttributes' => [
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]
]
]
],
'requestId' => '',
'updateMask' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'errorsConfig' => [
'gcsPrefix' => ''
],
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'projectId' => '',
'tableId' => ''
],
'catalogInlineSource' => [
'catalogItems' => [
[
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]
]
],
'gcsSource' => [
'inputUris' => [
],
'jsonSchema' => ''
],
'userEventInlineSource' => [
'userEvents' => [
[
'eventDetail' => [
'eventAttributes' => [
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]
]
]
],
'requestId' => '',
'updateMask' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1beta1/:+parent/catalogItems:import');
$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}}/v1beta1/:+parent/catalogItems:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": "",
"updateMask": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/catalogItems:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": "",
"updateMask": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta1/:+parent/catalogItems:import", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/catalogItems:import"
payload = {
"errorsConfig": { "gcsPrefix": "" },
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": { "catalogItems": [
{
"tags": [],
"categoryHierarchies": [{ "categories": [] }],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
] },
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": { "userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [{}],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": False,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
] }
},
"requestId": "",
"updateMask": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/catalogItems:import"
payload <- "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\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}}/v1beta1/:+parent/catalogItems:import")
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 \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\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/v1beta1/:+parent/catalogItems:import') do |req|
req.body = "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\",\n \"updateMask\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/catalogItems:import";
let payload = json!({
"errorsConfig": json!({"gcsPrefix": ""}),
"inputConfig": json!({
"bigQuerySource": json!({
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
}),
"catalogInlineSource": json!({"catalogItems": (
json!({
"tags": (),
"categoryHierarchies": (json!({"categories": ()})),
"description": "",
"id": "",
"itemAttributes": json!({
"categoricalFeatures": json!({}),
"numericalFeatures": json!({})
}),
"itemGroupId": "",
"languageCode": "",
"productMetadata": json!({
"availableQuantity": "",
"canonicalProductUri": "",
"costs": json!({}),
"currencyCode": "",
"exactPrice": json!({
"displayPrice": "",
"originalPrice": ""
}),
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"priceRange": json!({
"max": "",
"min": ""
}),
"stockState": ""
}),
"title": ""
})
)}),
"gcsSource": json!({
"inputUris": (),
"jsonSchema": ""
}),
"userEventInlineSource": json!({"userEvents": (
json!({
"eventDetail": json!({
"eventAttributes": json!({}),
"experimentIds": (),
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
}),
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": json!({
"cartId": "",
"listId": "",
"pageCategories": (json!({})),
"productDetails": (
json!({
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": json!({}),
"originalPrice": "",
"quantity": 0,
"stockState": ""
})
),
"purchaseTransaction": json!({
"costs": json!({}),
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": json!({})
}),
"searchQuery": ""
}),
"userInfo": json!({
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
})
})
)})
}),
"requestId": "",
"updateMask": ""
});
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}}/v1beta1/:+parent/catalogItems:import' \
--header 'content-type: application/json' \
--data '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": "",
"updateMask": ""
}'
echo '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": "",
"updateMask": ""
}' | \
http POST '{{baseUrl}}/v1beta1/:+parent/catalogItems:import' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "errorsConfig": {\n "gcsPrefix": ""\n },\n "inputConfig": {\n "bigQuerySource": {\n "dataSchema": "",\n "datasetId": "",\n "gcsStagingDir": "",\n "projectId": "",\n "tableId": ""\n },\n "catalogInlineSource": {\n "catalogItems": [\n {\n "tags": [],\n "categoryHierarchies": [\n {\n "categories": []\n }\n ],\n "description": "",\n "id": "",\n "itemAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "itemGroupId": "",\n "languageCode": "",\n "productMetadata": {\n "availableQuantity": "",\n "canonicalProductUri": "",\n "costs": {},\n "currencyCode": "",\n "exactPrice": {\n "displayPrice": "",\n "originalPrice": ""\n },\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "priceRange": {\n "max": "",\n "min": ""\n },\n "stockState": ""\n },\n "title": ""\n }\n ]\n },\n "gcsSource": {\n "inputUris": [],\n "jsonSchema": ""\n },\n "userEventInlineSource": {\n "userEvents": [\n {\n "eventDetail": {\n "eventAttributes": {},\n "experimentIds": [],\n "pageViewId": "",\n "recommendationToken": "",\n "referrerUri": "",\n "uri": ""\n },\n "eventSource": "",\n "eventTime": "",\n "eventType": "",\n "productEventDetail": {\n "cartId": "",\n "listId": "",\n "pageCategories": [\n {}\n ],\n "productDetails": [\n {\n "availableQuantity": 0,\n "currencyCode": "",\n "displayPrice": "",\n "id": "",\n "itemAttributes": {},\n "originalPrice": "",\n "quantity": 0,\n "stockState": ""\n }\n ],\n "purchaseTransaction": {\n "costs": {},\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "taxes": {}\n },\n "searchQuery": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": "",\n "visitorId": ""\n }\n }\n ]\n }\n },\n "requestId": "",\n "updateMask": ""\n}' \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/catalogItems:import'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"errorsConfig": ["gcsPrefix": ""],
"inputConfig": [
"bigQuerySource": [
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
],
"catalogInlineSource": ["catalogItems": [
[
"tags": [],
"categoryHierarchies": [["categories": []]],
"description": "",
"id": "",
"itemAttributes": [
"categoricalFeatures": [],
"numericalFeatures": []
],
"itemGroupId": "",
"languageCode": "",
"productMetadata": [
"availableQuantity": "",
"canonicalProductUri": "",
"costs": [],
"currencyCode": "",
"exactPrice": [
"displayPrice": "",
"originalPrice": ""
],
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"priceRange": [
"max": "",
"min": ""
],
"stockState": ""
],
"title": ""
]
]],
"gcsSource": [
"inputUris": [],
"jsonSchema": ""
],
"userEventInlineSource": ["userEvents": [
[
"eventDetail": [
"eventAttributes": [],
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
],
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": [
"cartId": "",
"listId": "",
"pageCategories": [[]],
"productDetails": [
[
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": [],
"originalPrice": "",
"quantity": 0,
"stockState": ""
]
],
"purchaseTransaction": [
"costs": [],
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": []
],
"searchQuery": ""
],
"userInfo": [
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
]
]
]]
],
"requestId": "",
"updateMask": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/catalogItems:import")! 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
recommendationengine.projects.locations.catalogs.catalogItems.list
{{baseUrl}}/v1beta1/:+parent/catalogItems
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/catalogItems");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta1/:+parent/catalogItems")
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/catalogItems"
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}}/v1beta1/:+parent/catalogItems"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta1/:+parent/catalogItems");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/catalogItems"
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/v1beta1/:+parent/catalogItems HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta1/:+parent/catalogItems")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/catalogItems"))
.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}}/v1beta1/:+parent/catalogItems")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta1/:+parent/catalogItems")
.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}}/v1beta1/:+parent/catalogItems');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1beta1/:+parent/catalogItems'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/catalogItems';
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}}/v1beta1/:+parent/catalogItems',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/catalogItems")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta1/:+parent/catalogItems',
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}}/v1beta1/:+parent/catalogItems'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta1/:+parent/catalogItems');
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}}/v1beta1/:+parent/catalogItems'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/catalogItems';
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}}/v1beta1/:+parent/catalogItems"]
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}}/v1beta1/:+parent/catalogItems" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/catalogItems",
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}}/v1beta1/:+parent/catalogItems');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/catalogItems');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta1/:+parent/catalogItems');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta1/:+parent/catalogItems' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/catalogItems' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta1/:+parent/catalogItems")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/catalogItems"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/catalogItems"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta1/:+parent/catalogItems")
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/v1beta1/:+parent/catalogItems') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/catalogItems";
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}}/v1beta1/:+parent/catalogItems'
http GET '{{baseUrl}}/v1beta1/:+parent/catalogItems'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/catalogItems'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/catalogItems")! 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
recommendationengine.projects.locations.catalogs.catalogItems.patch
{{baseUrl}}/v1beta1/:+name
QUERY PARAMS
name
BODY json
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+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 \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/v1beta1/:+name" {:content-type :json
:form-params {:tags []
:categoryHierarchies [{:categories []}]
:description ""
:id ""
:itemAttributes {:categoricalFeatures {}
:numericalFeatures {}}
:itemGroupId ""
:languageCode ""
:productMetadata {:availableQuantity ""
:canonicalProductUri ""
:costs {}
:currencyCode ""
:exactPrice {:displayPrice ""
:originalPrice ""}
:images [{:height 0
:uri ""
:width 0}]
:priceRange {:max ""
:min ""}
:stockState ""}
:title ""}})
require "http/client"
url = "{{baseUrl}}/v1beta1/:+name"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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}}/v1beta1/:+name"),
Content = new StringContent("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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}}/v1beta1/:+name");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+name"
payload := strings.NewReader("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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/v1beta1/:+name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 647
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/v1beta1/:+name")
.setHeader("content-type", "application/json")
.setBody("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+name"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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 \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta1/:+name")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/v1beta1/:+name")
.header("content-type", "application/json")
.body("{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}")
.asString();
const data = JSON.stringify({
tags: [],
categoryHierarchies: [
{
categories: []
}
],
description: '',
id: '',
itemAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {
displayPrice: '',
originalPrice: ''
},
images: [
{
height: 0,
uri: '',
width: 0
}
],
priceRange: {
max: '',
min: ''
},
stockState: ''
},
title: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/v1beta1/:+name');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v1beta1/:+name',
headers: {'content-type': 'application/json'},
data: {
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"tags":[],"categoryHierarchies":[{"categories":[]}],"description":"","id":"","itemAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"itemGroupId":"","languageCode":"","productMetadata":{"availableQuantity":"","canonicalProductUri":"","costs":{},"currencyCode":"","exactPrice":{"displayPrice":"","originalPrice":""},"images":[{"height":0,"uri":"","width":0}],"priceRange":{"max":"","min":""},"stockState":""},"title":""}'
};
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}}/v1beta1/:+name',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "tags": [],\n "categoryHierarchies": [\n {\n "categories": []\n }\n ],\n "description": "",\n "id": "",\n "itemAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "itemGroupId": "",\n "languageCode": "",\n "productMetadata": {\n "availableQuantity": "",\n "canonicalProductUri": "",\n "costs": {},\n "currencyCode": "",\n "exactPrice": {\n "displayPrice": "",\n "originalPrice": ""\n },\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "priceRange": {\n "max": "",\n "min": ""\n },\n "stockState": ""\n },\n "title": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+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/v1beta1/:+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({
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v1beta1/:+name',
headers: {'content-type': 'application/json'},
body: {
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
},
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}}/v1beta1/:+name');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
tags: [],
categoryHierarchies: [
{
categories: []
}
],
description: '',
id: '',
itemAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {
displayPrice: '',
originalPrice: ''
},
images: [
{
height: 0,
uri: '',
width: 0
}
],
priceRange: {
max: '',
min: ''
},
stockState: ''
},
title: ''
});
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}}/v1beta1/:+name',
headers: {'content-type': 'application/json'},
data: {
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"tags":[],"categoryHierarchies":[{"categories":[]}],"description":"","id":"","itemAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"itemGroupId":"","languageCode":"","productMetadata":{"availableQuantity":"","canonicalProductUri":"","costs":{},"currencyCode":"","exactPrice":{"displayPrice":"","originalPrice":""},"images":[{"height":0,"uri":"","width":0}],"priceRange":{"max":"","min":""},"stockState":""},"title":""}'
};
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 = @{ @"tags": @[ ],
@"categoryHierarchies": @[ @{ @"categories": @[ ] } ],
@"description": @"",
@"id": @"",
@"itemAttributes": @{ @"categoricalFeatures": @{ }, @"numericalFeatures": @{ } },
@"itemGroupId": @"",
@"languageCode": @"",
@"productMetadata": @{ @"availableQuantity": @"", @"canonicalProductUri": @"", @"costs": @{ }, @"currencyCode": @"", @"exactPrice": @{ @"displayPrice": @"", @"originalPrice": @"" }, @"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ], @"priceRange": @{ @"max": @"", @"min": @"" }, @"stockState": @"" },
@"title": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+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([
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]),
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}}/v1beta1/:+name', [
'body' => '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+name');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/v1beta1/:+name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+name"
payload = {
"tags": [],
"categoryHierarchies": [{ "categories": [] }],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+name"
payload <- "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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}}/v1beta1/:+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 \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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/v1beta1/:+name') do |req|
req.body = "{\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\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}}/v1beta1/:+name";
let payload = json!({
"tags": (),
"categoryHierarchies": (json!({"categories": ()})),
"description": "",
"id": "",
"itemAttributes": json!({
"categoricalFeatures": json!({}),
"numericalFeatures": json!({})
}),
"itemGroupId": "",
"languageCode": "",
"productMetadata": json!({
"availableQuantity": "",
"canonicalProductUri": "",
"costs": json!({}),
"currencyCode": "",
"exactPrice": json!({
"displayPrice": "",
"originalPrice": ""
}),
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"priceRange": json!({
"max": "",
"min": ""
}),
"stockState": ""
}),
"title": ""
});
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}}/v1beta1/:+name' \
--header 'content-type: application/json' \
--data '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}'
echo '{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}' | \
http PATCH '{{baseUrl}}/v1beta1/:+name' \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "tags": [],\n "categoryHierarchies": [\n {\n "categories": []\n }\n ],\n "description": "",\n "id": "",\n "itemAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "itemGroupId": "",\n "languageCode": "",\n "productMetadata": {\n "availableQuantity": "",\n "canonicalProductUri": "",\n "costs": {},\n "currencyCode": "",\n "exactPrice": {\n "displayPrice": "",\n "originalPrice": ""\n },\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "priceRange": {\n "max": "",\n "min": ""\n },\n "stockState": ""\n },\n "title": ""\n}' \
--output-document \
- '{{baseUrl}}/v1beta1/:+name'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"tags": [],
"categoryHierarchies": [["categories": []]],
"description": "",
"id": "",
"itemAttributes": [
"categoricalFeatures": [],
"numericalFeatures": []
],
"itemGroupId": "",
"languageCode": "",
"productMetadata": [
"availableQuantity": "",
"canonicalProductUri": "",
"costs": [],
"currencyCode": "",
"exactPrice": [
"displayPrice": "",
"originalPrice": ""
],
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"priceRange": [
"max": "",
"min": ""
],
"stockState": ""
],
"title": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+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()
GET
recommendationengine.projects.locations.catalogs.eventStores.operations.list
{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name/operations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta1/:+name/operations")
require "http/client"
url = "{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+name/operations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+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/v1beta1/:+name/operations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta1/:+name/operations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name/operations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name/operations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1beta1/:+name/operations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name/operations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+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/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+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}}/v1beta1/:+name/operations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name/operations');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+name/operations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta1/:+name/operations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta1/:+name/operations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+name/operations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta1/:+name/operations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+name/operations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+name/operations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta1/:+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/v1beta1/:+name/operations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+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}}/v1beta1/:+name/operations'
http GET '{{baseUrl}}/v1beta1/:+name/operations'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/v1beta1/:+name/operations'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+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
recommendationengine.projects.locations.catalogs.eventStores.placements.predict
{{baseUrl}}/v1beta1/:+name:predict
QUERY PARAMS
name
BODY json
{
"dryRun": false,
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+name:predict");
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 \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta1/:+name:predict" {:content-type :json
:form-params {:dryRun false
:filter ""
:labels {}
:pageSize 0
:pageToken ""
:params {}
:userEvent {:eventDetail {:eventAttributes {:categoricalFeatures {}
:numericalFeatures {}}
:experimentIds []
:pageViewId ""
:recommendationToken ""
:referrerUri ""
:uri ""}
:eventSource ""
:eventTime ""
:eventType ""
:productEventDetail {:cartId ""
:listId ""
:pageCategories [{:categories []}]
:productDetails [{:availableQuantity 0
:currencyCode ""
:displayPrice ""
:id ""
:itemAttributes {}
:originalPrice ""
:quantity 0
:stockState ""}]
:purchaseTransaction {:costs {}
:currencyCode ""
:id ""
:revenue ""
:taxes {}}
:searchQuery ""}
:userInfo {:directUserRequest false
:ipAddress ""
:userAgent ""
:userId ""
:visitorId ""}}}})
require "http/client"
url = "{{baseUrl}}/v1beta1/:+name:predict"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\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}}/v1beta1/:+name:predict"),
Content = new StringContent("{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\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}}/v1beta1/:+name:predict");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+name:predict"
payload := strings.NewReader("{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\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/v1beta1/:+name:predict HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1209
{
"dryRun": false,
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta1/:+name:predict")
.setHeader("content-type", "application/json")
.setBody("{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+name:predict"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\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 \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta1/:+name:predict")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta1/:+name:predict")
.header("content-type", "application/json")
.body("{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
dryRun: false,
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
eventDetail: {
eventAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [
{
categories: []
}
],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {
costs: {},
currencyCode: '',
id: '',
revenue: '',
taxes: {}
},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta1/:+name:predict');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+name:predict',
headers: {'content-type': 'application/json'},
data: {
dryRun: false,
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
eventDetail: {
eventAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{categories: []}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+name:predict';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dryRun":false,"filter":"","labels":{},"pageSize":0,"pageToken":"","params":{},"userEvent":{"eventDetail":{"eventAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"experimentIds":[],"pageViewId":"","recommendationToken":"","referrerUri":"","uri":""},"eventSource":"","eventTime":"","eventType":"","productEventDetail":{"cartId":"","listId":"","pageCategories":[{"categories":[]}],"productDetails":[{"availableQuantity":0,"currencyCode":"","displayPrice":"","id":"","itemAttributes":{},"originalPrice":"","quantity":0,"stockState":""}],"purchaseTransaction":{"costs":{},"currencyCode":"","id":"","revenue":"","taxes":{}},"searchQuery":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":"","visitorId":""}}}'
};
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}}/v1beta1/:+name:predict',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "dryRun": false,\n "filter": "",\n "labels": {},\n "pageSize": 0,\n "pageToken": "",\n "params": {},\n "userEvent": {\n "eventDetail": {\n "eventAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "experimentIds": [],\n "pageViewId": "",\n "recommendationToken": "",\n "referrerUri": "",\n "uri": ""\n },\n "eventSource": "",\n "eventTime": "",\n "eventType": "",\n "productEventDetail": {\n "cartId": "",\n "listId": "",\n "pageCategories": [\n {\n "categories": []\n }\n ],\n "productDetails": [\n {\n "availableQuantity": 0,\n "currencyCode": "",\n "displayPrice": "",\n "id": "",\n "itemAttributes": {},\n "originalPrice": "",\n "quantity": 0,\n "stockState": ""\n }\n ],\n "purchaseTransaction": {\n "costs": {},\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "taxes": {}\n },\n "searchQuery": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": "",\n "visitorId": ""\n }\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 \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+name:predict")
.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/v1beta1/:+name:predict',
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({
dryRun: false,
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
eventDetail: {
eventAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{categories: []}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+name:predict',
headers: {'content-type': 'application/json'},
body: {
dryRun: false,
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
eventDetail: {
eventAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{categories: []}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
},
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}}/v1beta1/:+name:predict');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
dryRun: false,
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
eventDetail: {
eventAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [
{
categories: []
}
],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {
costs: {},
currencyCode: '',
id: '',
revenue: '',
taxes: {}
},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
});
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}}/v1beta1/:+name:predict',
headers: {'content-type': 'application/json'},
data: {
dryRun: false,
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
eventDetail: {
eventAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{categories: []}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+name:predict';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"dryRun":false,"filter":"","labels":{},"pageSize":0,"pageToken":"","params":{},"userEvent":{"eventDetail":{"eventAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"experimentIds":[],"pageViewId":"","recommendationToken":"","referrerUri":"","uri":""},"eventSource":"","eventTime":"","eventType":"","productEventDetail":{"cartId":"","listId":"","pageCategories":[{"categories":[]}],"productDetails":[{"availableQuantity":0,"currencyCode":"","displayPrice":"","id":"","itemAttributes":{},"originalPrice":"","quantity":0,"stockState":""}],"purchaseTransaction":{"costs":{},"currencyCode":"","id":"","revenue":"","taxes":{}},"searchQuery":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":"","visitorId":""}}}'
};
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 = @{ @"dryRun": @NO,
@"filter": @"",
@"labels": @{ },
@"pageSize": @0,
@"pageToken": @"",
@"params": @{ },
@"userEvent": @{ @"eventDetail": @{ @"eventAttributes": @{ @"categoricalFeatures": @{ }, @"numericalFeatures": @{ } }, @"experimentIds": @[ ], @"pageViewId": @"", @"recommendationToken": @"", @"referrerUri": @"", @"uri": @"" }, @"eventSource": @"", @"eventTime": @"", @"eventType": @"", @"productEventDetail": @{ @"cartId": @"", @"listId": @"", @"pageCategories": @[ @{ @"categories": @[ ] } ], @"productDetails": @[ @{ @"availableQuantity": @0, @"currencyCode": @"", @"displayPrice": @"", @"id": @"", @"itemAttributes": @{ }, @"originalPrice": @"", @"quantity": @0, @"stockState": @"" } ], @"purchaseTransaction": @{ @"costs": @{ }, @"currencyCode": @"", @"id": @"", @"revenue": @"", @"taxes": @{ } }, @"searchQuery": @"" }, @"userInfo": @{ @"directUserRequest": @NO, @"ipAddress": @"", @"userAgent": @"", @"userId": @"", @"visitorId": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta1/:+name:predict"]
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}}/v1beta1/:+name:predict" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+name:predict",
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([
'dryRun' => null,
'filter' => '',
'labels' => [
],
'pageSize' => 0,
'pageToken' => '',
'params' => [
],
'userEvent' => [
'eventDetail' => [
'eventAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
'categories' => [
]
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]
]),
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}}/v1beta1/:+name:predict', [
'body' => '{
"dryRun": false,
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+name:predict');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'dryRun' => null,
'filter' => '',
'labels' => [
],
'pageSize' => 0,
'pageToken' => '',
'params' => [
],
'userEvent' => [
'eventDetail' => [
'eventAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
'categories' => [
]
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'dryRun' => null,
'filter' => '',
'labels' => [
],
'pageSize' => 0,
'pageToken' => '',
'params' => [
],
'userEvent' => [
'eventDetail' => [
'eventAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
'categories' => [
]
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1beta1/:+name:predict');
$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}}/v1beta1/:+name:predict' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dryRun": false,
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+name:predict' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"dryRun": false,
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta1/:+name:predict", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+name:predict"
payload = {
"dryRun": False,
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [{ "categories": [] }],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": False,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+name:predict"
payload <- "{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\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}}/v1beta1/:+name:predict")
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 \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\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/v1beta1/:+name:predict') do |req|
req.body = "{\n \"dryRun\": false,\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+name:predict";
let payload = json!({
"dryRun": false,
"filter": "",
"labels": json!({}),
"pageSize": 0,
"pageToken": "",
"params": json!({}),
"userEvent": json!({
"eventDetail": json!({
"eventAttributes": json!({
"categoricalFeatures": json!({}),
"numericalFeatures": json!({})
}),
"experimentIds": (),
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
}),
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": json!({
"cartId": "",
"listId": "",
"pageCategories": (json!({"categories": ()})),
"productDetails": (
json!({
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": json!({}),
"originalPrice": "",
"quantity": 0,
"stockState": ""
})
),
"purchaseTransaction": json!({
"costs": json!({}),
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": json!({})
}),
"searchQuery": ""
}),
"userInfo": json!({
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
})
})
});
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}}/v1beta1/:+name:predict' \
--header 'content-type: application/json' \
--data '{
"dryRun": false,
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
}'
echo '{
"dryRun": false,
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
}' | \
http POST '{{baseUrl}}/v1beta1/:+name:predict' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "dryRun": false,\n "filter": "",\n "labels": {},\n "pageSize": 0,\n "pageToken": "",\n "params": {},\n "userEvent": {\n "eventDetail": {\n "eventAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "experimentIds": [],\n "pageViewId": "",\n "recommendationToken": "",\n "referrerUri": "",\n "uri": ""\n },\n "eventSource": "",\n "eventTime": "",\n "eventType": "",\n "productEventDetail": {\n "cartId": "",\n "listId": "",\n "pageCategories": [\n {\n "categories": []\n }\n ],\n "productDetails": [\n {\n "availableQuantity": 0,\n "currencyCode": "",\n "displayPrice": "",\n "id": "",\n "itemAttributes": {},\n "originalPrice": "",\n "quantity": 0,\n "stockState": ""\n }\n ],\n "purchaseTransaction": {\n "costs": {},\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "taxes": {}\n },\n "searchQuery": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": "",\n "visitorId": ""\n }\n }\n}' \
--output-document \
- '{{baseUrl}}/v1beta1/:+name:predict'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"dryRun": false,
"filter": "",
"labels": [],
"pageSize": 0,
"pageToken": "",
"params": [],
"userEvent": [
"eventDetail": [
"eventAttributes": [
"categoricalFeatures": [],
"numericalFeatures": []
],
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
],
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": [
"cartId": "",
"listId": "",
"pageCategories": [["categories": []]],
"productDetails": [
[
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": [],
"originalPrice": "",
"quantity": 0,
"stockState": ""
]
],
"purchaseTransaction": [
"costs": [],
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": []
],
"searchQuery": ""
],
"userInfo": [
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+name:predict")! 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
recommendationengine.projects.locations.catalogs.eventStores.predictionApiKeyRegistrations.create
{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations
QUERY PARAMS
parent
BODY json
{
"predictionApiKeyRegistration": {
"apiKey": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations");
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 \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations" {:content-type :json
:form-params {:predictionApiKeyRegistration {:apiKey ""}}})
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\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}}/v1beta1/:+parent/predictionApiKeyRegistrations"),
Content = new StringContent("{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\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}}/v1beta1/:+parent/predictionApiKeyRegistrations");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"
payload := strings.NewReader("{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\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/v1beta1/:+parent/predictionApiKeyRegistrations HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 60
{
"predictionApiKeyRegistration": {
"apiKey": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")
.setHeader("content-type", "application/json")
.setBody("{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\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 \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")
.header("content-type", "application/json")
.body("{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
predictionApiKeyRegistration: {
apiKey: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations',
headers: {'content-type': 'application/json'},
data: {predictionApiKeyRegistration: {apiKey: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"predictionApiKeyRegistration":{"apiKey":""}}'
};
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}}/v1beta1/:+parent/predictionApiKeyRegistrations',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "predictionApiKeyRegistration": {\n "apiKey": ""\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 \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")
.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/v1beta1/:+parent/predictionApiKeyRegistrations',
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({predictionApiKeyRegistration: {apiKey: ''}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations',
headers: {'content-type': 'application/json'},
body: {predictionApiKeyRegistration: {apiKey: ''}},
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}}/v1beta1/:+parent/predictionApiKeyRegistrations');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
predictionApiKeyRegistration: {
apiKey: ''
}
});
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}}/v1beta1/:+parent/predictionApiKeyRegistrations',
headers: {'content-type': 'application/json'},
data: {predictionApiKeyRegistration: {apiKey: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"predictionApiKeyRegistration":{"apiKey":""}}'
};
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 = @{ @"predictionApiKeyRegistration": @{ @"apiKey": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"]
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}}/v1beta1/:+parent/predictionApiKeyRegistrations" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations",
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([
'predictionApiKeyRegistration' => [
'apiKey' => ''
]
]),
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}}/v1beta1/:+parent/predictionApiKeyRegistrations', [
'body' => '{
"predictionApiKeyRegistration": {
"apiKey": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'predictionApiKeyRegistration' => [
'apiKey' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'predictionApiKeyRegistration' => [
'apiKey' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations');
$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}}/v1beta1/:+parent/predictionApiKeyRegistrations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"predictionApiKeyRegistration": {
"apiKey": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"predictionApiKeyRegistration": {
"apiKey": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta1/:+parent/predictionApiKeyRegistrations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"
payload = { "predictionApiKeyRegistration": { "apiKey": "" } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"
payload <- "{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\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}}/v1beta1/:+parent/predictionApiKeyRegistrations")
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 \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\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/v1beta1/:+parent/predictionApiKeyRegistrations') do |req|
req.body = "{\n \"predictionApiKeyRegistration\": {\n \"apiKey\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations";
let payload = json!({"predictionApiKeyRegistration": json!({"apiKey": ""})});
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}}/v1beta1/:+parent/predictionApiKeyRegistrations' \
--header 'content-type: application/json' \
--data '{
"predictionApiKeyRegistration": {
"apiKey": ""
}
}'
echo '{
"predictionApiKeyRegistration": {
"apiKey": ""
}
}' | \
http POST '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "predictionApiKeyRegistration": {\n "apiKey": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["predictionApiKeyRegistration": ["apiKey": ""]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")! 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
recommendationengine.projects.locations.catalogs.eventStores.predictionApiKeyRegistrations.list
{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"
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}}/v1beta1/:+parent/predictionApiKeyRegistrations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"
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/v1beta1/:+parent/predictionApiKeyRegistrations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"))
.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}}/v1beta1/:+parent/predictionApiKeyRegistrations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")
.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}}/v1beta1/:+parent/predictionApiKeyRegistrations');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations';
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}}/v1beta1/:+parent/predictionApiKeyRegistrations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta1/:+parent/predictionApiKeyRegistrations',
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}}/v1beta1/:+parent/predictionApiKeyRegistrations'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations');
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}}/v1beta1/:+parent/predictionApiKeyRegistrations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations';
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}}/v1beta1/:+parent/predictionApiKeyRegistrations"]
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}}/v1beta1/:+parent/predictionApiKeyRegistrations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations",
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}}/v1beta1/:+parent/predictionApiKeyRegistrations');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta1/:+parent/predictionApiKeyRegistrations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")
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/v1beta1/:+parent/predictionApiKeyRegistrations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations";
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}}/v1beta1/:+parent/predictionApiKeyRegistrations'
http GET '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/predictionApiKeyRegistrations")! 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
recommendationengine.projects.locations.catalogs.eventStores.userEvents.collect
{{baseUrl}}/v1beta1/:+parent/userEvents:collect
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/userEvents:collect");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta1/:+parent/userEvents:collect")
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:collect"
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}}/v1beta1/:+parent/userEvents:collect"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta1/:+parent/userEvents:collect");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/userEvents:collect"
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/v1beta1/:+parent/userEvents:collect HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta1/:+parent/userEvents:collect")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/userEvents:collect"))
.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}}/v1beta1/:+parent/userEvents:collect")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta1/:+parent/userEvents:collect")
.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}}/v1beta1/:+parent/userEvents:collect');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1beta1/:+parent/userEvents:collect'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:collect';
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}}/v1beta1/:+parent/userEvents:collect',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents:collect")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta1/:+parent/userEvents:collect',
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}}/v1beta1/:+parent/userEvents:collect'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta1/:+parent/userEvents:collect');
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}}/v1beta1/:+parent/userEvents:collect'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:collect';
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}}/v1beta1/:+parent/userEvents:collect"]
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}}/v1beta1/:+parent/userEvents:collect" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/userEvents:collect",
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}}/v1beta1/:+parent/userEvents:collect');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:collect');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:collect');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta1/:+parent/userEvents:collect' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/userEvents:collect' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta1/:+parent/userEvents:collect")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:collect"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/userEvents:collect"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta1/:+parent/userEvents:collect")
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/v1beta1/:+parent/userEvents:collect') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/userEvents:collect";
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}}/v1beta1/:+parent/userEvents:collect'
http GET '{{baseUrl}}/v1beta1/:+parent/userEvents:collect'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/userEvents:collect'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/userEvents:collect")! 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
recommendationengine.projects.locations.catalogs.eventStores.userEvents.import
{{baseUrl}}/v1beta1/:+parent/userEvents:import
QUERY PARAMS
parent
BODY json
{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/userEvents:import");
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 \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta1/:+parent/userEvents:import" {:content-type :json
:form-params {:errorsConfig {:gcsPrefix ""}
:inputConfig {:bigQuerySource {:dataSchema ""
:datasetId ""
:gcsStagingDir ""
:projectId ""
:tableId ""}
:catalogInlineSource {:catalogItems [{:tags []
:categoryHierarchies [{:categories []}]
:description ""
:id ""
:itemAttributes {:categoricalFeatures {}
:numericalFeatures {}}
:itemGroupId ""
:languageCode ""
:productMetadata {:availableQuantity ""
:canonicalProductUri ""
:costs {}
:currencyCode ""
:exactPrice {:displayPrice ""
:originalPrice ""}
:images [{:height 0
:uri ""
:width 0}]
:priceRange {:max ""
:min ""}
:stockState ""}
:title ""}]}
:gcsSource {:inputUris []
:jsonSchema ""}
:userEventInlineSource {:userEvents [{:eventDetail {:eventAttributes {}
:experimentIds []
:pageViewId ""
:recommendationToken ""
:referrerUri ""
:uri ""}
:eventSource ""
:eventTime ""
:eventType ""
:productEventDetail {:cartId ""
:listId ""
:pageCategories [{}]
:productDetails [{:availableQuantity 0
:currencyCode ""
:displayPrice ""
:id ""
:itemAttributes {}
:originalPrice ""
:quantity 0
:stockState ""}]
:purchaseTransaction {:costs {}
:currencyCode ""
:id ""
:revenue ""
:taxes {}}
:searchQuery ""}
:userInfo {:directUserRequest false
:ipAddress ""
:userAgent ""
:userId ""
:visitorId ""}}]}}
:requestId ""}})
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:import"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\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}}/v1beta1/:+parent/userEvents:import"),
Content = new StringContent("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\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}}/v1beta1/:+parent/userEvents:import");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/userEvents:import"
payload := strings.NewReader("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\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/v1beta1/:+parent/userEvents:import HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2667
{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta1/:+parent/userEvents:import")
.setHeader("content-type", "application/json")
.setBody("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/userEvents:import"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\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 \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents:import")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta1/:+parent/userEvents:import")
.header("content-type", "application/json")
.body("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\n}")
.asString();
const data = JSON.stringify({
errorsConfig: {
gcsPrefix: ''
},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
projectId: '',
tableId: ''
},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [
{
categories: []
}
],
description: '',
id: '',
itemAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {
displayPrice: '',
originalPrice: ''
},
images: [
{
height: 0,
uri: '',
width: 0
}
],
priceRange: {
max: '',
min: ''
},
stockState: ''
},
title: ''
}
]
},
gcsSource: {
inputUris: [],
jsonSchema: ''
},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [
{}
],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {
costs: {},
currencyCode: '',
id: '',
revenue: '',
taxes: {}
},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta1/:+parent/userEvents:import');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/userEvents:import',
headers: {'content-type': 'application/json'},
data: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {dataSchema: '', datasetId: '', gcsStagingDir: '', projectId: '', tableId: ''},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
]
},
gcsSource: {inputUris: [], jsonSchema: ''},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"errorsConfig":{"gcsPrefix":""},"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","projectId":"","tableId":""},"catalogInlineSource":{"catalogItems":[{"tags":[],"categoryHierarchies":[{"categories":[]}],"description":"","id":"","itemAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"itemGroupId":"","languageCode":"","productMetadata":{"availableQuantity":"","canonicalProductUri":"","costs":{},"currencyCode":"","exactPrice":{"displayPrice":"","originalPrice":""},"images":[{"height":0,"uri":"","width":0}],"priceRange":{"max":"","min":""},"stockState":""},"title":""}]},"gcsSource":{"inputUris":[],"jsonSchema":""},"userEventInlineSource":{"userEvents":[{"eventDetail":{"eventAttributes":{},"experimentIds":[],"pageViewId":"","recommendationToken":"","referrerUri":"","uri":""},"eventSource":"","eventTime":"","eventType":"","productEventDetail":{"cartId":"","listId":"","pageCategories":[{}],"productDetails":[{"availableQuantity":0,"currencyCode":"","displayPrice":"","id":"","itemAttributes":{},"originalPrice":"","quantity":0,"stockState":""}],"purchaseTransaction":{"costs":{},"currencyCode":"","id":"","revenue":"","taxes":{}},"searchQuery":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":"","visitorId":""}}]}},"requestId":""}'
};
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}}/v1beta1/:+parent/userEvents:import',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "errorsConfig": {\n "gcsPrefix": ""\n },\n "inputConfig": {\n "bigQuerySource": {\n "dataSchema": "",\n "datasetId": "",\n "gcsStagingDir": "",\n "projectId": "",\n "tableId": ""\n },\n "catalogInlineSource": {\n "catalogItems": [\n {\n "tags": [],\n "categoryHierarchies": [\n {\n "categories": []\n }\n ],\n "description": "",\n "id": "",\n "itemAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "itemGroupId": "",\n "languageCode": "",\n "productMetadata": {\n "availableQuantity": "",\n "canonicalProductUri": "",\n "costs": {},\n "currencyCode": "",\n "exactPrice": {\n "displayPrice": "",\n "originalPrice": ""\n },\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "priceRange": {\n "max": "",\n "min": ""\n },\n "stockState": ""\n },\n "title": ""\n }\n ]\n },\n "gcsSource": {\n "inputUris": [],\n "jsonSchema": ""\n },\n "userEventInlineSource": {\n "userEvents": [\n {\n "eventDetail": {\n "eventAttributes": {},\n "experimentIds": [],\n "pageViewId": "",\n "recommendationToken": "",\n "referrerUri": "",\n "uri": ""\n },\n "eventSource": "",\n "eventTime": "",\n "eventType": "",\n "productEventDetail": {\n "cartId": "",\n "listId": "",\n "pageCategories": [\n {}\n ],\n "productDetails": [\n {\n "availableQuantity": 0,\n "currencyCode": "",\n "displayPrice": "",\n "id": "",\n "itemAttributes": {},\n "originalPrice": "",\n "quantity": 0,\n "stockState": ""\n }\n ],\n "purchaseTransaction": {\n "costs": {},\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "taxes": {}\n },\n "searchQuery": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": "",\n "visitorId": ""\n }\n }\n ]\n }\n },\n "requestId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents:import")
.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/v1beta1/:+parent/userEvents:import',
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({
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {dataSchema: '', datasetId: '', gcsStagingDir: '', projectId: '', tableId: ''},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
]
},
gcsSource: {inputUris: [], jsonSchema: ''},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/userEvents:import',
headers: {'content-type': 'application/json'},
body: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {dataSchema: '', datasetId: '', gcsStagingDir: '', projectId: '', tableId: ''},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
]
},
gcsSource: {inputUris: [], jsonSchema: ''},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: ''
},
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}}/v1beta1/:+parent/userEvents:import');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
errorsConfig: {
gcsPrefix: ''
},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
projectId: '',
tableId: ''
},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [
{
categories: []
}
],
description: '',
id: '',
itemAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {
displayPrice: '',
originalPrice: ''
},
images: [
{
height: 0,
uri: '',
width: 0
}
],
priceRange: {
max: '',
min: ''
},
stockState: ''
},
title: ''
}
]
},
gcsSource: {
inputUris: [],
jsonSchema: ''
},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [
{}
],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {
costs: {},
currencyCode: '',
id: '',
revenue: '',
taxes: {}
},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: ''
});
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}}/v1beta1/:+parent/userEvents:import',
headers: {'content-type': 'application/json'},
data: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {dataSchema: '', datasetId: '', gcsStagingDir: '', projectId: '', tableId: ''},
catalogInlineSource: {
catalogItems: [
{
tags: [],
categoryHierarchies: [{categories: []}],
description: '',
id: '',
itemAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
itemGroupId: '',
languageCode: '',
productMetadata: {
availableQuantity: '',
canonicalProductUri: '',
costs: {},
currencyCode: '',
exactPrice: {displayPrice: '', originalPrice: ''},
images: [{height: 0, uri: '', width: 0}],
priceRange: {max: '', min: ''},
stockState: ''
},
title: ''
}
]
},
gcsSource: {inputUris: [], jsonSchema: ''},
userEventInlineSource: {
userEvents: [
{
eventDetail: {
eventAttributes: {},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
]
}
},
requestId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"errorsConfig":{"gcsPrefix":""},"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","projectId":"","tableId":""},"catalogInlineSource":{"catalogItems":[{"tags":[],"categoryHierarchies":[{"categories":[]}],"description":"","id":"","itemAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"itemGroupId":"","languageCode":"","productMetadata":{"availableQuantity":"","canonicalProductUri":"","costs":{},"currencyCode":"","exactPrice":{"displayPrice":"","originalPrice":""},"images":[{"height":0,"uri":"","width":0}],"priceRange":{"max":"","min":""},"stockState":""},"title":""}]},"gcsSource":{"inputUris":[],"jsonSchema":""},"userEventInlineSource":{"userEvents":[{"eventDetail":{"eventAttributes":{},"experimentIds":[],"pageViewId":"","recommendationToken":"","referrerUri":"","uri":""},"eventSource":"","eventTime":"","eventType":"","productEventDetail":{"cartId":"","listId":"","pageCategories":[{}],"productDetails":[{"availableQuantity":0,"currencyCode":"","displayPrice":"","id":"","itemAttributes":{},"originalPrice":"","quantity":0,"stockState":""}],"purchaseTransaction":{"costs":{},"currencyCode":"","id":"","revenue":"","taxes":{}},"searchQuery":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":"","visitorId":""}}]}},"requestId":""}'
};
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 = @{ @"errorsConfig": @{ @"gcsPrefix": @"" },
@"inputConfig": @{ @"bigQuerySource": @{ @"dataSchema": @"", @"datasetId": @"", @"gcsStagingDir": @"", @"projectId": @"", @"tableId": @"" }, @"catalogInlineSource": @{ @"catalogItems": @[ @{ @"tags": @[ ], @"categoryHierarchies": @[ @{ @"categories": @[ ] } ], @"description": @"", @"id": @"", @"itemAttributes": @{ @"categoricalFeatures": @{ }, @"numericalFeatures": @{ } }, @"itemGroupId": @"", @"languageCode": @"", @"productMetadata": @{ @"availableQuantity": @"", @"canonicalProductUri": @"", @"costs": @{ }, @"currencyCode": @"", @"exactPrice": @{ @"displayPrice": @"", @"originalPrice": @"" }, @"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ], @"priceRange": @{ @"max": @"", @"min": @"" }, @"stockState": @"" }, @"title": @"" } ] }, @"gcsSource": @{ @"inputUris": @[ ], @"jsonSchema": @"" }, @"userEventInlineSource": @{ @"userEvents": @[ @{ @"eventDetail": @{ @"eventAttributes": @{ }, @"experimentIds": @[ ], @"pageViewId": @"", @"recommendationToken": @"", @"referrerUri": @"", @"uri": @"" }, @"eventSource": @"", @"eventTime": @"", @"eventType": @"", @"productEventDetail": @{ @"cartId": @"", @"listId": @"", @"pageCategories": @[ @{ } ], @"productDetails": @[ @{ @"availableQuantity": @0, @"currencyCode": @"", @"displayPrice": @"", @"id": @"", @"itemAttributes": @{ }, @"originalPrice": @"", @"quantity": @0, @"stockState": @"" } ], @"purchaseTransaction": @{ @"costs": @{ }, @"currencyCode": @"", @"id": @"", @"revenue": @"", @"taxes": @{ } }, @"searchQuery": @"" }, @"userInfo": @{ @"directUserRequest": @NO, @"ipAddress": @"", @"userAgent": @"", @"userId": @"", @"visitorId": @"" } } ] } },
@"requestId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta1/:+parent/userEvents:import"]
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}}/v1beta1/:+parent/userEvents:import" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/userEvents:import",
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([
'errorsConfig' => [
'gcsPrefix' => ''
],
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'projectId' => '',
'tableId' => ''
],
'catalogInlineSource' => [
'catalogItems' => [
[
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]
]
],
'gcsSource' => [
'inputUris' => [
],
'jsonSchema' => ''
],
'userEventInlineSource' => [
'userEvents' => [
[
'eventDetail' => [
'eventAttributes' => [
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]
]
]
],
'requestId' => ''
]),
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}}/v1beta1/:+parent/userEvents:import', [
'body' => '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:import');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'errorsConfig' => [
'gcsPrefix' => ''
],
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'projectId' => '',
'tableId' => ''
],
'catalogInlineSource' => [
'catalogItems' => [
[
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]
]
],
'gcsSource' => [
'inputUris' => [
],
'jsonSchema' => ''
],
'userEventInlineSource' => [
'userEvents' => [
[
'eventDetail' => [
'eventAttributes' => [
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]
]
]
],
'requestId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'errorsConfig' => [
'gcsPrefix' => ''
],
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'projectId' => '',
'tableId' => ''
],
'catalogInlineSource' => [
'catalogItems' => [
[
'tags' => [
],
'categoryHierarchies' => [
[
'categories' => [
]
]
],
'description' => '',
'id' => '',
'itemAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'itemGroupId' => '',
'languageCode' => '',
'productMetadata' => [
'availableQuantity' => '',
'canonicalProductUri' => '',
'costs' => [
],
'currencyCode' => '',
'exactPrice' => [
'displayPrice' => '',
'originalPrice' => ''
],
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'priceRange' => [
'max' => '',
'min' => ''
],
'stockState' => ''
],
'title' => ''
]
]
],
'gcsSource' => [
'inputUris' => [
],
'jsonSchema' => ''
],
'userEventInlineSource' => [
'userEvents' => [
[
'eventDetail' => [
'eventAttributes' => [
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]
]
]
],
'requestId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:import');
$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}}/v1beta1/:+parent/userEvents:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/userEvents:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta1/:+parent/userEvents:import", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:import"
payload = {
"errorsConfig": { "gcsPrefix": "" },
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": { "catalogItems": [
{
"tags": [],
"categoryHierarchies": [{ "categories": [] }],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
] },
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": { "userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [{}],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": False,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
] }
},
"requestId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/userEvents:import"
payload <- "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\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}}/v1beta1/:+parent/userEvents:import")
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 \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\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/v1beta1/:+parent/userEvents:import') do |req|
req.body = "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"catalogInlineSource\": {\n \"catalogItems\": [\n {\n \"tags\": [],\n \"categoryHierarchies\": [\n {\n \"categories\": []\n }\n ],\n \"description\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"itemGroupId\": \"\",\n \"languageCode\": \"\",\n \"productMetadata\": {\n \"availableQuantity\": \"\",\n \"canonicalProductUri\": \"\",\n \"costs\": {},\n \"currencyCode\": \"\",\n \"exactPrice\": {\n \"displayPrice\": \"\",\n \"originalPrice\": \"\"\n },\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"priceRange\": {\n \"max\": \"\",\n \"min\": \"\"\n },\n \"stockState\": \"\"\n },\n \"title\": \"\"\n }\n ]\n },\n \"gcsSource\": {\n \"inputUris\": [],\n \"jsonSchema\": \"\"\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"eventDetail\": {\n \"eventAttributes\": {},\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {}\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n }\n ]\n }\n },\n \"requestId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/userEvents:import";
let payload = json!({
"errorsConfig": json!({"gcsPrefix": ""}),
"inputConfig": json!({
"bigQuerySource": json!({
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
}),
"catalogInlineSource": json!({"catalogItems": (
json!({
"tags": (),
"categoryHierarchies": (json!({"categories": ()})),
"description": "",
"id": "",
"itemAttributes": json!({
"categoricalFeatures": json!({}),
"numericalFeatures": json!({})
}),
"itemGroupId": "",
"languageCode": "",
"productMetadata": json!({
"availableQuantity": "",
"canonicalProductUri": "",
"costs": json!({}),
"currencyCode": "",
"exactPrice": json!({
"displayPrice": "",
"originalPrice": ""
}),
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"priceRange": json!({
"max": "",
"min": ""
}),
"stockState": ""
}),
"title": ""
})
)}),
"gcsSource": json!({
"inputUris": (),
"jsonSchema": ""
}),
"userEventInlineSource": json!({"userEvents": (
json!({
"eventDetail": json!({
"eventAttributes": json!({}),
"experimentIds": (),
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
}),
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": json!({
"cartId": "",
"listId": "",
"pageCategories": (json!({})),
"productDetails": (
json!({
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": json!({}),
"originalPrice": "",
"quantity": 0,
"stockState": ""
})
),
"purchaseTransaction": json!({
"costs": json!({}),
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": json!({})
}),
"searchQuery": ""
}),
"userInfo": json!({
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
})
})
)})
}),
"requestId": ""
});
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}}/v1beta1/:+parent/userEvents:import' \
--header 'content-type: application/json' \
--data '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": ""
}'
echo '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
},
"catalogInlineSource": {
"catalogItems": [
{
"tags": [],
"categoryHierarchies": [
{
"categories": []
}
],
"description": "",
"id": "",
"itemAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"itemGroupId": "",
"languageCode": "",
"productMetadata": {
"availableQuantity": "",
"canonicalProductUri": "",
"costs": {},
"currencyCode": "",
"exactPrice": {
"displayPrice": "",
"originalPrice": ""
},
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"priceRange": {
"max": "",
"min": ""
},
"stockState": ""
},
"title": ""
}
]
},
"gcsSource": {
"inputUris": [],
"jsonSchema": ""
},
"userEventInlineSource": {
"userEvents": [
{
"eventDetail": {
"eventAttributes": {},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
]
}
},
"requestId": ""
}' | \
http POST '{{baseUrl}}/v1beta1/:+parent/userEvents:import' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "errorsConfig": {\n "gcsPrefix": ""\n },\n "inputConfig": {\n "bigQuerySource": {\n "dataSchema": "",\n "datasetId": "",\n "gcsStagingDir": "",\n "projectId": "",\n "tableId": ""\n },\n "catalogInlineSource": {\n "catalogItems": [\n {\n "tags": [],\n "categoryHierarchies": [\n {\n "categories": []\n }\n ],\n "description": "",\n "id": "",\n "itemAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "itemGroupId": "",\n "languageCode": "",\n "productMetadata": {\n "availableQuantity": "",\n "canonicalProductUri": "",\n "costs": {},\n "currencyCode": "",\n "exactPrice": {\n "displayPrice": "",\n "originalPrice": ""\n },\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "priceRange": {\n "max": "",\n "min": ""\n },\n "stockState": ""\n },\n "title": ""\n }\n ]\n },\n "gcsSource": {\n "inputUris": [],\n "jsonSchema": ""\n },\n "userEventInlineSource": {\n "userEvents": [\n {\n "eventDetail": {\n "eventAttributes": {},\n "experimentIds": [],\n "pageViewId": "",\n "recommendationToken": "",\n "referrerUri": "",\n "uri": ""\n },\n "eventSource": "",\n "eventTime": "",\n "eventType": "",\n "productEventDetail": {\n "cartId": "",\n "listId": "",\n "pageCategories": [\n {}\n ],\n "productDetails": [\n {\n "availableQuantity": 0,\n "currencyCode": "",\n "displayPrice": "",\n "id": "",\n "itemAttributes": {},\n "originalPrice": "",\n "quantity": 0,\n "stockState": ""\n }\n ],\n "purchaseTransaction": {\n "costs": {},\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "taxes": {}\n },\n "searchQuery": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": "",\n "visitorId": ""\n }\n }\n ]\n }\n },\n "requestId": ""\n}' \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/userEvents:import'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"errorsConfig": ["gcsPrefix": ""],
"inputConfig": [
"bigQuerySource": [
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"projectId": "",
"tableId": ""
],
"catalogInlineSource": ["catalogItems": [
[
"tags": [],
"categoryHierarchies": [["categories": []]],
"description": "",
"id": "",
"itemAttributes": [
"categoricalFeatures": [],
"numericalFeatures": []
],
"itemGroupId": "",
"languageCode": "",
"productMetadata": [
"availableQuantity": "",
"canonicalProductUri": "",
"costs": [],
"currencyCode": "",
"exactPrice": [
"displayPrice": "",
"originalPrice": ""
],
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"priceRange": [
"max": "",
"min": ""
],
"stockState": ""
],
"title": ""
]
]],
"gcsSource": [
"inputUris": [],
"jsonSchema": ""
],
"userEventInlineSource": ["userEvents": [
[
"eventDetail": [
"eventAttributes": [],
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
],
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": [
"cartId": "",
"listId": "",
"pageCategories": [[]],
"productDetails": [
[
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": [],
"originalPrice": "",
"quantity": 0,
"stockState": ""
]
],
"purchaseTransaction": [
"costs": [],
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": []
],
"searchQuery": ""
],
"userInfo": [
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
]
]
]]
],
"requestId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/userEvents:import")! 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
recommendationengine.projects.locations.catalogs.eventStores.userEvents.list
{{baseUrl}}/v1beta1/:+parent/userEvents
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/userEvents");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta1/:+parent/userEvents")
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/userEvents"
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}}/v1beta1/:+parent/userEvents"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta1/:+parent/userEvents");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/userEvents"
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/v1beta1/:+parent/userEvents HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta1/:+parent/userEvents")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/userEvents"))
.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}}/v1beta1/:+parent/userEvents")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta1/:+parent/userEvents")
.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}}/v1beta1/:+parent/userEvents');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1beta1/:+parent/userEvents'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents';
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}}/v1beta1/:+parent/userEvents',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta1/:+parent/userEvents',
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}}/v1beta1/:+parent/userEvents'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta1/:+parent/userEvents');
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}}/v1beta1/:+parent/userEvents'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents';
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}}/v1beta1/:+parent/userEvents"]
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}}/v1beta1/:+parent/userEvents" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/userEvents",
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}}/v1beta1/:+parent/userEvents');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/userEvents');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta1/:+parent/userEvents');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta1/:+parent/userEvents' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/userEvents' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta1/:+parent/userEvents")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/userEvents"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/userEvents"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta1/:+parent/userEvents")
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/v1beta1/:+parent/userEvents') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/userEvents";
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}}/v1beta1/:+parent/userEvents'
http GET '{{baseUrl}}/v1beta1/:+parent/userEvents'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/userEvents'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/userEvents")! 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
recommendationengine.projects.locations.catalogs.eventStores.userEvents.purge
{{baseUrl}}/v1beta1/:+parent/userEvents:purge
QUERY PARAMS
parent
BODY json
{
"filter": "",
"force": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/userEvents:purge");
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 \"filter\": \"\",\n \"force\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta1/:+parent/userEvents:purge" {:content-type :json
:form-params {:filter ""
:force false}})
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:purge"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"filter\": \"\",\n \"force\": false\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}}/v1beta1/:+parent/userEvents:purge"),
Content = new StringContent("{\n \"filter\": \"\",\n \"force\": false\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}}/v1beta1/:+parent/userEvents:purge");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"filter\": \"\",\n \"force\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/userEvents:purge"
payload := strings.NewReader("{\n \"filter\": \"\",\n \"force\": false\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/v1beta1/:+parent/userEvents:purge HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 36
{
"filter": "",
"force": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta1/:+parent/userEvents:purge")
.setHeader("content-type", "application/json")
.setBody("{\n \"filter\": \"\",\n \"force\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/userEvents:purge"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"filter\": \"\",\n \"force\": false\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 \"filter\": \"\",\n \"force\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents:purge")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta1/:+parent/userEvents:purge")
.header("content-type", "application/json")
.body("{\n \"filter\": \"\",\n \"force\": false\n}")
.asString();
const data = JSON.stringify({
filter: '',
force: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta1/:+parent/userEvents:purge');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/userEvents:purge',
headers: {'content-type': 'application/json'},
data: {filter: '', force: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:purge';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filter":"","force":false}'
};
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}}/v1beta1/:+parent/userEvents:purge',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "filter": "",\n "force": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"filter\": \"\",\n \"force\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents:purge")
.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/v1beta1/:+parent/userEvents:purge',
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({filter: '', force: false}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/userEvents:purge',
headers: {'content-type': 'application/json'},
body: {filter: '', force: false},
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}}/v1beta1/:+parent/userEvents:purge');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
filter: '',
force: false
});
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}}/v1beta1/:+parent/userEvents:purge',
headers: {'content-type': 'application/json'},
data: {filter: '', force: false}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:purge';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filter":"","force":false}'
};
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 = @{ @"filter": @"",
@"force": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta1/:+parent/userEvents:purge"]
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}}/v1beta1/:+parent/userEvents:purge" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"filter\": \"\",\n \"force\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/userEvents:purge",
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([
'filter' => '',
'force' => null
]),
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}}/v1beta1/:+parent/userEvents:purge', [
'body' => '{
"filter": "",
"force": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:purge');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'filter' => '',
'force' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'filter' => '',
'force' => null
]));
$request->setRequestUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:purge');
$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}}/v1beta1/:+parent/userEvents:purge' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filter": "",
"force": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/userEvents:purge' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filter": "",
"force": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"filter\": \"\",\n \"force\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta1/:+parent/userEvents:purge", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:purge"
payload = {
"filter": "",
"force": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/userEvents:purge"
payload <- "{\n \"filter\": \"\",\n \"force\": false\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}}/v1beta1/:+parent/userEvents:purge")
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 \"filter\": \"\",\n \"force\": false\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/v1beta1/:+parent/userEvents:purge') do |req|
req.body = "{\n \"filter\": \"\",\n \"force\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/userEvents:purge";
let payload = json!({
"filter": "",
"force": false
});
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}}/v1beta1/:+parent/userEvents:purge' \
--header 'content-type: application/json' \
--data '{
"filter": "",
"force": false
}'
echo '{
"filter": "",
"force": false
}' | \
http POST '{{baseUrl}}/v1beta1/:+parent/userEvents:purge' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "filter": "",\n "force": false\n}' \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/userEvents:purge'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"filter": "",
"force": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/userEvents:purge")! 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
recommendationengine.projects.locations.catalogs.eventStores.userEvents.rejoin
{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin
QUERY PARAMS
parent
BODY json
{
"userEventRejoinScope": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin");
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 \"userEventRejoinScope\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin" {:content-type :json
:form-params {:userEventRejoinScope ""}})
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"userEventRejoinScope\": \"\"\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}}/v1beta1/:+parent/userEvents:rejoin"),
Content = new StringContent("{\n \"userEventRejoinScope\": \"\"\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}}/v1beta1/:+parent/userEvents:rejoin");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"userEventRejoinScope\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin"
payload := strings.NewReader("{\n \"userEventRejoinScope\": \"\"\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/v1beta1/:+parent/userEvents:rejoin HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 32
{
"userEventRejoinScope": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin")
.setHeader("content-type", "application/json")
.setBody("{\n \"userEventRejoinScope\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"userEventRejoinScope\": \"\"\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 \"userEventRejoinScope\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin")
.header("content-type", "application/json")
.body("{\n \"userEventRejoinScope\": \"\"\n}")
.asString();
const data = JSON.stringify({
userEventRejoinScope: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin',
headers: {'content-type': 'application/json'},
data: {userEventRejoinScope: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userEventRejoinScope":""}'
};
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}}/v1beta1/:+parent/userEvents:rejoin',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "userEventRejoinScope": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"userEventRejoinScope\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin")
.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/v1beta1/:+parent/userEvents:rejoin',
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({userEventRejoinScope: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin',
headers: {'content-type': 'application/json'},
body: {userEventRejoinScope: ''},
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}}/v1beta1/:+parent/userEvents:rejoin');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
userEventRejoinScope: ''
});
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}}/v1beta1/:+parent/userEvents:rejoin',
headers: {'content-type': 'application/json'},
data: {userEventRejoinScope: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"userEventRejoinScope":""}'
};
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 = @{ @"userEventRejoinScope": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin"]
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}}/v1beta1/:+parent/userEvents:rejoin" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"userEventRejoinScope\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin",
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([
'userEventRejoinScope' => ''
]),
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}}/v1beta1/:+parent/userEvents:rejoin', [
'body' => '{
"userEventRejoinScope": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'userEventRejoinScope' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'userEventRejoinScope' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin');
$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}}/v1beta1/:+parent/userEvents:rejoin' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userEventRejoinScope": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userEventRejoinScope": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"userEventRejoinScope\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta1/:+parent/userEvents:rejoin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin"
payload = { "userEventRejoinScope": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin"
payload <- "{\n \"userEventRejoinScope\": \"\"\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}}/v1beta1/:+parent/userEvents:rejoin")
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 \"userEventRejoinScope\": \"\"\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/v1beta1/:+parent/userEvents:rejoin') do |req|
req.body = "{\n \"userEventRejoinScope\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin";
let payload = json!({"userEventRejoinScope": ""});
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}}/v1beta1/:+parent/userEvents:rejoin' \
--header 'content-type: application/json' \
--data '{
"userEventRejoinScope": ""
}'
echo '{
"userEventRejoinScope": ""
}' | \
http POST '{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "userEventRejoinScope": ""\n}' \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["userEventRejoinScope": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/userEvents:rejoin")! 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
recommendationengine.projects.locations.catalogs.eventStores.userEvents.write
{{baseUrl}}/v1beta1/:+parent/userEvents:write
QUERY PARAMS
parent
BODY json
{
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/userEvents:write");
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 \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta1/:+parent/userEvents:write" {:content-type :json
:form-params {:eventDetail {:eventAttributes {:categoricalFeatures {}
:numericalFeatures {}}
:experimentIds []
:pageViewId ""
:recommendationToken ""
:referrerUri ""
:uri ""}
:eventSource ""
:eventTime ""
:eventType ""
:productEventDetail {:cartId ""
:listId ""
:pageCategories [{:categories []}]
:productDetails [{:availableQuantity 0
:currencyCode ""
:displayPrice ""
:id ""
:itemAttributes {}
:originalPrice ""
:quantity 0
:stockState ""}]
:purchaseTransaction {:costs {}
:currencyCode ""
:id ""
:revenue ""
:taxes {}}
:searchQuery ""}
:userInfo {:directUserRequest false
:ipAddress ""
:userAgent ""
:userId ""
:visitorId ""}}})
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:write"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\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}}/v1beta1/:+parent/userEvents:write"),
Content = new StringContent("{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\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}}/v1beta1/:+parent/userEvents:write");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/userEvents:write"
payload := strings.NewReader("{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\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/v1beta1/:+parent/userEvents:write HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 985
{
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta1/:+parent/userEvents:write")
.setHeader("content-type", "application/json")
.setBody("{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/userEvents:write"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\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 \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents:write")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta1/:+parent/userEvents:write")
.header("content-type", "application/json")
.body("{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
eventDetail: {
eventAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [
{
categories: []
}
],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {
costs: {},
currencyCode: '',
id: '',
revenue: '',
taxes: {}
},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta1/:+parent/userEvents:write');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/userEvents:write',
headers: {'content-type': 'application/json'},
data: {
eventDetail: {
eventAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{categories: []}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:write';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"eventDetail":{"eventAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"experimentIds":[],"pageViewId":"","recommendationToken":"","referrerUri":"","uri":""},"eventSource":"","eventTime":"","eventType":"","productEventDetail":{"cartId":"","listId":"","pageCategories":[{"categories":[]}],"productDetails":[{"availableQuantity":0,"currencyCode":"","displayPrice":"","id":"","itemAttributes":{},"originalPrice":"","quantity":0,"stockState":""}],"purchaseTransaction":{"costs":{},"currencyCode":"","id":"","revenue":"","taxes":{}},"searchQuery":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":"","visitorId":""}}'
};
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}}/v1beta1/:+parent/userEvents:write',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "eventDetail": {\n "eventAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "experimentIds": [],\n "pageViewId": "",\n "recommendationToken": "",\n "referrerUri": "",\n "uri": ""\n },\n "eventSource": "",\n "eventTime": "",\n "eventType": "",\n "productEventDetail": {\n "cartId": "",\n "listId": "",\n "pageCategories": [\n {\n "categories": []\n }\n ],\n "productDetails": [\n {\n "availableQuantity": 0,\n "currencyCode": "",\n "displayPrice": "",\n "id": "",\n "itemAttributes": {},\n "originalPrice": "",\n "quantity": 0,\n "stockState": ""\n }\n ],\n "purchaseTransaction": {\n "costs": {},\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "taxes": {}\n },\n "searchQuery": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": "",\n "visitorId": ""\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 \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/userEvents:write")
.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/v1beta1/:+parent/userEvents:write',
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({
eventDetail: {
eventAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{categories: []}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta1/:+parent/userEvents:write',
headers: {'content-type': 'application/json'},
body: {
eventDetail: {
eventAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{categories: []}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
},
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}}/v1beta1/:+parent/userEvents:write');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
eventDetail: {
eventAttributes: {
categoricalFeatures: {},
numericalFeatures: {}
},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [
{
categories: []
}
],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {
costs: {},
currencyCode: '',
id: '',
revenue: '',
taxes: {}
},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
});
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}}/v1beta1/:+parent/userEvents:write',
headers: {'content-type': 'application/json'},
data: {
eventDetail: {
eventAttributes: {categoricalFeatures: {}, numericalFeatures: {}},
experimentIds: [],
pageViewId: '',
recommendationToken: '',
referrerUri: '',
uri: ''
},
eventSource: '',
eventTime: '',
eventType: '',
productEventDetail: {
cartId: '',
listId: '',
pageCategories: [{categories: []}],
productDetails: [
{
availableQuantity: 0,
currencyCode: '',
displayPrice: '',
id: '',
itemAttributes: {},
originalPrice: '',
quantity: 0,
stockState: ''
}
],
purchaseTransaction: {costs: {}, currencyCode: '', id: '', revenue: '', taxes: {}},
searchQuery: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: '',
visitorId: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/userEvents:write';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"eventDetail":{"eventAttributes":{"categoricalFeatures":{},"numericalFeatures":{}},"experimentIds":[],"pageViewId":"","recommendationToken":"","referrerUri":"","uri":""},"eventSource":"","eventTime":"","eventType":"","productEventDetail":{"cartId":"","listId":"","pageCategories":[{"categories":[]}],"productDetails":[{"availableQuantity":0,"currencyCode":"","displayPrice":"","id":"","itemAttributes":{},"originalPrice":"","quantity":0,"stockState":""}],"purchaseTransaction":{"costs":{},"currencyCode":"","id":"","revenue":"","taxes":{}},"searchQuery":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":"","visitorId":""}}'
};
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 = @{ @"eventDetail": @{ @"eventAttributes": @{ @"categoricalFeatures": @{ }, @"numericalFeatures": @{ } }, @"experimentIds": @[ ], @"pageViewId": @"", @"recommendationToken": @"", @"referrerUri": @"", @"uri": @"" },
@"eventSource": @"",
@"eventTime": @"",
@"eventType": @"",
@"productEventDetail": @{ @"cartId": @"", @"listId": @"", @"pageCategories": @[ @{ @"categories": @[ ] } ], @"productDetails": @[ @{ @"availableQuantity": @0, @"currencyCode": @"", @"displayPrice": @"", @"id": @"", @"itemAttributes": @{ }, @"originalPrice": @"", @"quantity": @0, @"stockState": @"" } ], @"purchaseTransaction": @{ @"costs": @{ }, @"currencyCode": @"", @"id": @"", @"revenue": @"", @"taxes": @{ } }, @"searchQuery": @"" },
@"userInfo": @{ @"directUserRequest": @NO, @"ipAddress": @"", @"userAgent": @"", @"userId": @"", @"visitorId": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta1/:+parent/userEvents:write"]
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}}/v1beta1/:+parent/userEvents:write" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/userEvents:write",
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([
'eventDetail' => [
'eventAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
'categories' => [
]
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]),
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}}/v1beta1/:+parent/userEvents:write', [
'body' => '{
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:write');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'eventDetail' => [
'eventAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
'categories' => [
]
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'eventDetail' => [
'eventAttributes' => [
'categoricalFeatures' => [
],
'numericalFeatures' => [
]
],
'experimentIds' => [
],
'pageViewId' => '',
'recommendationToken' => '',
'referrerUri' => '',
'uri' => ''
],
'eventSource' => '',
'eventTime' => '',
'eventType' => '',
'productEventDetail' => [
'cartId' => '',
'listId' => '',
'pageCategories' => [
[
'categories' => [
]
]
],
'productDetails' => [
[
'availableQuantity' => 0,
'currencyCode' => '',
'displayPrice' => '',
'id' => '',
'itemAttributes' => [
],
'originalPrice' => '',
'quantity' => 0,
'stockState' => ''
]
],
'purchaseTransaction' => [
'costs' => [
],
'currencyCode' => '',
'id' => '',
'revenue' => '',
'taxes' => [
]
],
'searchQuery' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => '',
'visitorId' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1beta1/:+parent/userEvents:write');
$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}}/v1beta1/:+parent/userEvents:write' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/userEvents:write' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta1/:+parent/userEvents:write", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/userEvents:write"
payload = {
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [{ "categories": [] }],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": False,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/userEvents:write"
payload <- "{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\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}}/v1beta1/:+parent/userEvents:write")
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 \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\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/v1beta1/:+parent/userEvents:write') do |req|
req.body = "{\n \"eventDetail\": {\n \"eventAttributes\": {\n \"categoricalFeatures\": {},\n \"numericalFeatures\": {}\n },\n \"experimentIds\": [],\n \"pageViewId\": \"\",\n \"recommendationToken\": \"\",\n \"referrerUri\": \"\",\n \"uri\": \"\"\n },\n \"eventSource\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"productEventDetail\": {\n \"cartId\": \"\",\n \"listId\": \"\",\n \"pageCategories\": [\n {\n \"categories\": []\n }\n ],\n \"productDetails\": [\n {\n \"availableQuantity\": 0,\n \"currencyCode\": \"\",\n \"displayPrice\": \"\",\n \"id\": \"\",\n \"itemAttributes\": {},\n \"originalPrice\": \"\",\n \"quantity\": 0,\n \"stockState\": \"\"\n }\n ],\n \"purchaseTransaction\": {\n \"costs\": {},\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"taxes\": {}\n },\n \"searchQuery\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\",\n \"visitorId\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/userEvents:write";
let payload = json!({
"eventDetail": json!({
"eventAttributes": json!({
"categoricalFeatures": json!({}),
"numericalFeatures": json!({})
}),
"experimentIds": (),
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
}),
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": json!({
"cartId": "",
"listId": "",
"pageCategories": (json!({"categories": ()})),
"productDetails": (
json!({
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": json!({}),
"originalPrice": "",
"quantity": 0,
"stockState": ""
})
),
"purchaseTransaction": json!({
"costs": json!({}),
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": json!({})
}),
"searchQuery": ""
}),
"userInfo": json!({
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
})
});
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}}/v1beta1/:+parent/userEvents:write' \
--header 'content-type: application/json' \
--data '{
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}'
echo '{
"eventDetail": {
"eventAttributes": {
"categoricalFeatures": {},
"numericalFeatures": {}
},
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
},
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": {
"cartId": "",
"listId": "",
"pageCategories": [
{
"categories": []
}
],
"productDetails": [
{
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": {},
"originalPrice": "",
"quantity": 0,
"stockState": ""
}
],
"purchaseTransaction": {
"costs": {},
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": {}
},
"searchQuery": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
}
}' | \
http POST '{{baseUrl}}/v1beta1/:+parent/userEvents:write' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "eventDetail": {\n "eventAttributes": {\n "categoricalFeatures": {},\n "numericalFeatures": {}\n },\n "experimentIds": [],\n "pageViewId": "",\n "recommendationToken": "",\n "referrerUri": "",\n "uri": ""\n },\n "eventSource": "",\n "eventTime": "",\n "eventType": "",\n "productEventDetail": {\n "cartId": "",\n "listId": "",\n "pageCategories": [\n {\n "categories": []\n }\n ],\n "productDetails": [\n {\n "availableQuantity": 0,\n "currencyCode": "",\n "displayPrice": "",\n "id": "",\n "itemAttributes": {},\n "originalPrice": "",\n "quantity": 0,\n "stockState": ""\n }\n ],\n "purchaseTransaction": {\n "costs": {},\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "taxes": {}\n },\n "searchQuery": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": "",\n "visitorId": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/userEvents:write'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"eventDetail": [
"eventAttributes": [
"categoricalFeatures": [],
"numericalFeatures": []
],
"experimentIds": [],
"pageViewId": "",
"recommendationToken": "",
"referrerUri": "",
"uri": ""
],
"eventSource": "",
"eventTime": "",
"eventType": "",
"productEventDetail": [
"cartId": "",
"listId": "",
"pageCategories": [["categories": []]],
"productDetails": [
[
"availableQuantity": 0,
"currencyCode": "",
"displayPrice": "",
"id": "",
"itemAttributes": [],
"originalPrice": "",
"quantity": 0,
"stockState": ""
]
],
"purchaseTransaction": [
"costs": [],
"currencyCode": "",
"id": "",
"revenue": "",
"taxes": []
],
"searchQuery": ""
],
"userInfo": [
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": "",
"visitorId": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/userEvents:write")! 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
recommendationengine.projects.locations.catalogs.list
{{baseUrl}}/v1beta1/:+parent/catalogs
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta1/:+parent/catalogs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta1/:+parent/catalogs")
require "http/client"
url = "{{baseUrl}}/v1beta1/:+parent/catalogs"
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}}/v1beta1/:+parent/catalogs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta1/:+parent/catalogs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta1/:+parent/catalogs"
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/v1beta1/:+parent/catalogs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta1/:+parent/catalogs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta1/:+parent/catalogs"))
.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}}/v1beta1/:+parent/catalogs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta1/:+parent/catalogs")
.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}}/v1beta1/:+parent/catalogs');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1beta1/:+parent/catalogs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta1/:+parent/catalogs';
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}}/v1beta1/:+parent/catalogs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta1/:+parent/catalogs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta1/:+parent/catalogs',
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}}/v1beta1/:+parent/catalogs'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta1/:+parent/catalogs');
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}}/v1beta1/:+parent/catalogs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta1/:+parent/catalogs';
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}}/v1beta1/:+parent/catalogs"]
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}}/v1beta1/:+parent/catalogs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta1/:+parent/catalogs",
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}}/v1beta1/:+parent/catalogs');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta1/:+parent/catalogs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta1/:+parent/catalogs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta1/:+parent/catalogs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta1/:+parent/catalogs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta1/:+parent/catalogs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta1/:+parent/catalogs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta1/:+parent/catalogs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta1/:+parent/catalogs")
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/v1beta1/:+parent/catalogs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta1/:+parent/catalogs";
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}}/v1beta1/:+parent/catalogs'
http GET '{{baseUrl}}/v1beta1/:+parent/catalogs'
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/v1beta1/:+parent/catalogs'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta1/:+parent/catalogs")! 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()