Retail API
POST
retail.projects.locations.catalogs.attributesConfig.addCatalogAttribute
{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute
QUERY PARAMS
attributesConfig
BODY json
{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute");
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 \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute" {:content-type :json
:form-params {:catalogAttribute {:dynamicFacetableOption ""
:exactSearchableOption ""
:inUse false
:indexableOption ""
:key ""
:recommendationsFilteringOption ""
:retrievableOption ""
:searchableOption ""
:type ""}}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\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}}/v2alpha/:attributesConfig:addCatalogAttribute"),
Content = new StringContent("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\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}}/v2alpha/:attributesConfig:addCatalogAttribute");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute"
payload := strings.NewReader("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\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/v2alpha/:attributesConfig:addCatalogAttribute HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 274
{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute")
.setHeader("content-type", "application/json")
.setBody("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\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 \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute")
.header("content-type", "application/json")
.body("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute',
headers: {'content-type': 'application/json'},
data: {
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"catalogAttribute":{"dynamicFacetableOption":"","exactSearchableOption":"","inUse":false,"indexableOption":"","key":"","recommendationsFilteringOption":"","retrievableOption":"","searchableOption":"","type":""}}'
};
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}}/v2alpha/:attributesConfig:addCatalogAttribute',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "catalogAttribute": {\n "dynamicFacetableOption": "",\n "exactSearchableOption": "",\n "inUse": false,\n "indexableOption": "",\n "key": "",\n "recommendationsFilteringOption": "",\n "retrievableOption": "",\n "searchableOption": "",\n "type": ""\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 \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute")
.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/v2alpha/:attributesConfig:addCatalogAttribute',
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({
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute',
headers: {'content-type': 'application/json'},
body: {
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
}
},
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}}/v2alpha/:attributesConfig:addCatalogAttribute');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
}
});
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}}/v2alpha/:attributesConfig:addCatalogAttribute',
headers: {'content-type': 'application/json'},
data: {
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"catalogAttribute":{"dynamicFacetableOption":"","exactSearchableOption":"","inUse":false,"indexableOption":"","key":"","recommendationsFilteringOption":"","retrievableOption":"","searchableOption":"","type":""}}'
};
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 = @{ @"catalogAttribute": @{ @"dynamicFacetableOption": @"", @"exactSearchableOption": @"", @"inUse": @NO, @"indexableOption": @"", @"key": @"", @"recommendationsFilteringOption": @"", @"retrievableOption": @"", @"searchableOption": @"", @"type": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute"]
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}}/v2alpha/:attributesConfig:addCatalogAttribute" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute",
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([
'catalogAttribute' => [
'dynamicFacetableOption' => '',
'exactSearchableOption' => '',
'inUse' => null,
'indexableOption' => '',
'key' => '',
'recommendationsFilteringOption' => '',
'retrievableOption' => '',
'searchableOption' => '',
'type' => ''
]
]),
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}}/v2alpha/:attributesConfig:addCatalogAttribute', [
'body' => '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'catalogAttribute' => [
'dynamicFacetableOption' => '',
'exactSearchableOption' => '',
'inUse' => null,
'indexableOption' => '',
'key' => '',
'recommendationsFilteringOption' => '',
'retrievableOption' => '',
'searchableOption' => '',
'type' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'catalogAttribute' => [
'dynamicFacetableOption' => '',
'exactSearchableOption' => '',
'inUse' => null,
'indexableOption' => '',
'key' => '',
'recommendationsFilteringOption' => '',
'retrievableOption' => '',
'searchableOption' => '',
'type' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute');
$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}}/v2alpha/:attributesConfig:addCatalogAttribute' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:attributesConfig:addCatalogAttribute", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute"
payload = { "catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": False,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute"
payload <- "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\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}}/v2alpha/:attributesConfig:addCatalogAttribute")
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 \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\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/v2alpha/:attributesConfig:addCatalogAttribute') do |req|
req.body = "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute";
let payload = json!({"catalogAttribute": json!({
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
})});
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}}/v2alpha/:attributesConfig:addCatalogAttribute \
--header 'content-type: application/json' \
--data '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
}
}'
echo '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
}
}' | \
http POST {{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "catalogAttribute": {\n "dynamicFacetableOption": "",\n "exactSearchableOption": "",\n "inUse": false,\n "indexableOption": "",\n "key": "",\n "recommendationsFilteringOption": "",\n "retrievableOption": "",\n "searchableOption": "",\n "type": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["catalogAttribute": [
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:attributesConfig:addCatalogAttribute")! 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
retail.projects.locations.catalogs.attributesConfig.batchRemoveCatalogAttributes
{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes
QUERY PARAMS
attributesConfig
BODY json
{
"attributeKeys": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes");
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 \"attributeKeys\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes" {:content-type :json
:form-params {:attributeKeys []}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"attributeKeys\": []\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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes"),
Content = new StringContent("{\n \"attributeKeys\": []\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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attributeKeys\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes"
payload := strings.NewReader("{\n \"attributeKeys\": []\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/v2alpha/:attributesConfig:batchRemoveCatalogAttributes HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 25
{
"attributeKeys": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes")
.setHeader("content-type", "application/json")
.setBody("{\n \"attributeKeys\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"attributeKeys\": []\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 \"attributeKeys\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes")
.header("content-type", "application/json")
.body("{\n \"attributeKeys\": []\n}")
.asString();
const data = JSON.stringify({
attributeKeys: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes',
headers: {'content-type': 'application/json'},
data: {attributeKeys: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attributeKeys":[]}'
};
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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "attributeKeys": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attributeKeys\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes")
.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/v2alpha/:attributesConfig:batchRemoveCatalogAttributes',
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({attributeKeys: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes',
headers: {'content-type': 'application/json'},
body: {attributeKeys: []},
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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
attributeKeys: []
});
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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes',
headers: {'content-type': 'application/json'},
data: {attributeKeys: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attributeKeys":[]}'
};
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 = @{ @"attributeKeys": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes"]
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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"attributeKeys\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes",
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([
'attributeKeys' => [
]
]),
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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes', [
'body' => '{
"attributeKeys": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attributeKeys' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attributeKeys' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes');
$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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributeKeys": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributeKeys": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attributeKeys\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:attributesConfig:batchRemoveCatalogAttributes", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes"
payload = { "attributeKeys": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes"
payload <- "{\n \"attributeKeys\": []\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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes")
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 \"attributeKeys\": []\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/v2alpha/:attributesConfig:batchRemoveCatalogAttributes') do |req|
req.body = "{\n \"attributeKeys\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes";
let payload = json!({"attributeKeys": ()});
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}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes \
--header 'content-type: application/json' \
--data '{
"attributeKeys": []
}'
echo '{
"attributeKeys": []
}' | \
http POST {{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "attributeKeys": []\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["attributeKeys": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:attributesConfig:batchRemoveCatalogAttributes")! 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
retail.projects.locations.catalogs.attributesConfig.removeCatalogAttribute
{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute
QUERY PARAMS
attributesConfig
BODY json
{
"key": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute");
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 \"key\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute" {:content-type :json
:form-params {:key ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"key\": \"\"\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}}/v2alpha/:attributesConfig:removeCatalogAttribute"),
Content = new StringContent("{\n \"key\": \"\"\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}}/v2alpha/:attributesConfig:removeCatalogAttribute");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"key\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute"
payload := strings.NewReader("{\n \"key\": \"\"\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/v2alpha/:attributesConfig:removeCatalogAttribute HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 15
{
"key": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute")
.setHeader("content-type", "application/json")
.setBody("{\n \"key\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"key\": \"\"\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 \"key\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute")
.header("content-type", "application/json")
.body("{\n \"key\": \"\"\n}")
.asString();
const data = JSON.stringify({
key: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute',
headers: {'content-type': 'application/json'},
data: {key: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"key":""}'
};
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}}/v2alpha/:attributesConfig:removeCatalogAttribute',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "key": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"key\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute")
.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/v2alpha/:attributesConfig:removeCatalogAttribute',
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({key: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute',
headers: {'content-type': 'application/json'},
body: {key: ''},
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}}/v2alpha/:attributesConfig:removeCatalogAttribute');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
key: ''
});
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}}/v2alpha/:attributesConfig:removeCatalogAttribute',
headers: {'content-type': 'application/json'},
data: {key: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"key":""}'
};
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 = @{ @"key": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute"]
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}}/v2alpha/:attributesConfig:removeCatalogAttribute" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"key\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute",
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([
'key' => ''
]),
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}}/v2alpha/:attributesConfig:removeCatalogAttribute', [
'body' => '{
"key": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'key' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'key' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute');
$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}}/v2alpha/:attributesConfig:removeCatalogAttribute' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"key": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"key": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"key\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:attributesConfig:removeCatalogAttribute", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute"
payload = { "key": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute"
payload <- "{\n \"key\": \"\"\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}}/v2alpha/:attributesConfig:removeCatalogAttribute")
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 \"key\": \"\"\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/v2alpha/:attributesConfig:removeCatalogAttribute') do |req|
req.body = "{\n \"key\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute";
let payload = json!({"key": ""});
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}}/v2alpha/:attributesConfig:removeCatalogAttribute \
--header 'content-type: application/json' \
--data '{
"key": ""
}'
echo '{
"key": ""
}' | \
http POST {{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "key": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["key": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:attributesConfig:removeCatalogAttribute")! 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
retail.projects.locations.catalogs.attributesConfig.replaceCatalogAttribute
{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute
QUERY PARAMS
attributesConfig
BODY json
{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
},
"updateMask": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute");
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 \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\n \"updateMask\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute" {:content-type :json
:form-params {:catalogAttribute {:dynamicFacetableOption ""
:exactSearchableOption ""
:inUse false
:indexableOption ""
:key ""
:recommendationsFilteringOption ""
:retrievableOption ""
:searchableOption ""
:type ""}
:updateMask ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\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}}/v2alpha/:attributesConfig:replaceCatalogAttribute"),
Content = new StringContent("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\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}}/v2alpha/:attributesConfig:replaceCatalogAttribute");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\n \"updateMask\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute"
payload := strings.NewReader("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\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/v2alpha/:attributesConfig:replaceCatalogAttribute HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 294
{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
},
"updateMask": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute")
.setHeader("content-type", "application/json")
.setBody("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\n \"updateMask\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\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 \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\n \"updateMask\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute")
.header("content-type", "application/json")
.body("{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\n \"updateMask\": \"\"\n}")
.asString();
const data = JSON.stringify({
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
},
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}}/v2alpha/:attributesConfig:replaceCatalogAttribute');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute',
headers: {'content-type': 'application/json'},
data: {
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
},
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"catalogAttribute":{"dynamicFacetableOption":"","exactSearchableOption":"","inUse":false,"indexableOption":"","key":"","recommendationsFilteringOption":"","retrievableOption":"","searchableOption":"","type":""},"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}}/v2alpha/:attributesConfig:replaceCatalogAttribute',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "catalogAttribute": {\n "dynamicFacetableOption": "",\n "exactSearchableOption": "",\n "inUse": false,\n "indexableOption": "",\n "key": "",\n "recommendationsFilteringOption": "",\n "retrievableOption": "",\n "searchableOption": "",\n "type": ""\n },\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 \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\n \"updateMask\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute")
.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/v2alpha/:attributesConfig:replaceCatalogAttribute',
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({
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
},
updateMask: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute',
headers: {'content-type': 'application/json'},
body: {
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
},
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}}/v2alpha/:attributesConfig:replaceCatalogAttribute');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
},
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}}/v2alpha/:attributesConfig:replaceCatalogAttribute',
headers: {'content-type': 'application/json'},
data: {
catalogAttribute: {
dynamicFacetableOption: '',
exactSearchableOption: '',
inUse: false,
indexableOption: '',
key: '',
recommendationsFilteringOption: '',
retrievableOption: '',
searchableOption: '',
type: ''
},
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"catalogAttribute":{"dynamicFacetableOption":"","exactSearchableOption":"","inUse":false,"indexableOption":"","key":"","recommendationsFilteringOption":"","retrievableOption":"","searchableOption":"","type":""},"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 = @{ @"catalogAttribute": @{ @"dynamicFacetableOption": @"", @"exactSearchableOption": @"", @"inUse": @NO, @"indexableOption": @"", @"key": @"", @"recommendationsFilteringOption": @"", @"retrievableOption": @"", @"searchableOption": @"", @"type": @"" },
@"updateMask": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute"]
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}}/v2alpha/:attributesConfig:replaceCatalogAttribute" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\n \"updateMask\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute",
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([
'catalogAttribute' => [
'dynamicFacetableOption' => '',
'exactSearchableOption' => '',
'inUse' => null,
'indexableOption' => '',
'key' => '',
'recommendationsFilteringOption' => '',
'retrievableOption' => '',
'searchableOption' => '',
'type' => ''
],
'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}}/v2alpha/:attributesConfig:replaceCatalogAttribute', [
'body' => '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
},
"updateMask": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'catalogAttribute' => [
'dynamicFacetableOption' => '',
'exactSearchableOption' => '',
'inUse' => null,
'indexableOption' => '',
'key' => '',
'recommendationsFilteringOption' => '',
'retrievableOption' => '',
'searchableOption' => '',
'type' => ''
],
'updateMask' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'catalogAttribute' => [
'dynamicFacetableOption' => '',
'exactSearchableOption' => '',
'inUse' => null,
'indexableOption' => '',
'key' => '',
'recommendationsFilteringOption' => '',
'retrievableOption' => '',
'searchableOption' => '',
'type' => ''
],
'updateMask' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute');
$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}}/v2alpha/:attributesConfig:replaceCatalogAttribute' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
},
"updateMask": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
},
"updateMask": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\n \"updateMask\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:attributesConfig:replaceCatalogAttribute", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute"
payload = {
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": False,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
},
"updateMask": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute"
payload <- "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\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}}/v2alpha/:attributesConfig:replaceCatalogAttribute")
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 \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\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/v2alpha/:attributesConfig:replaceCatalogAttribute') do |req|
req.body = "{\n \"catalogAttribute\": {\n \"dynamicFacetableOption\": \"\",\n \"exactSearchableOption\": \"\",\n \"inUse\": false,\n \"indexableOption\": \"\",\n \"key\": \"\",\n \"recommendationsFilteringOption\": \"\",\n \"retrievableOption\": \"\",\n \"searchableOption\": \"\",\n \"type\": \"\"\n },\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}}/v2alpha/:attributesConfig:replaceCatalogAttribute";
let payload = json!({
"catalogAttribute": json!({
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
}),
"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}}/v2alpha/:attributesConfig:replaceCatalogAttribute \
--header 'content-type: application/json' \
--data '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
},
"updateMask": ""
}'
echo '{
"catalogAttribute": {
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
},
"updateMask": ""
}' | \
http POST {{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "catalogAttribute": {\n "dynamicFacetableOption": "",\n "exactSearchableOption": "",\n "inUse": false,\n "indexableOption": "",\n "key": "",\n "recommendationsFilteringOption": "",\n "retrievableOption": "",\n "searchableOption": "",\n "type": ""\n },\n "updateMask": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"catalogAttribute": [
"dynamicFacetableOption": "",
"exactSearchableOption": "",
"inUse": false,
"indexableOption": "",
"key": "",
"recommendationsFilteringOption": "",
"retrievableOption": "",
"searchableOption": "",
"type": ""
],
"updateMask": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:attributesConfig:replaceCatalogAttribute")! 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
retail.projects.locations.catalogs.branches.products.addFulfillmentPlaces
{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces
QUERY PARAMS
product
BODY json
{
"addTime": "",
"allowMissing": false,
"placeIds": [],
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces");
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 \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces" {:content-type :json
:form-params {:addTime ""
:allowMissing false
:placeIds []
:type ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\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}}/v2alpha/:product:addFulfillmentPlaces"),
Content = new StringContent("{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\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}}/v2alpha/:product:addFulfillmentPlaces");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces"
payload := strings.NewReader("{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\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/v2alpha/:product:addFulfillmentPlaces HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 76
{
"addTime": "",
"allowMissing": false,
"placeIds": [],
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces")
.setHeader("content-type", "application/json")
.setBody("{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\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 \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces")
.header("content-type", "application/json")
.body("{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
addTime: '',
allowMissing: false,
placeIds: [],
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces',
headers: {'content-type': 'application/json'},
data: {addTime: '', allowMissing: false, placeIds: [], type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"addTime":"","allowMissing":false,"placeIds":[],"type":""}'
};
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}}/v2alpha/:product:addFulfillmentPlaces',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "addTime": "",\n "allowMissing": false,\n "placeIds": [],\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces")
.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/v2alpha/:product:addFulfillmentPlaces',
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({addTime: '', allowMissing: false, placeIds: [], type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces',
headers: {'content-type': 'application/json'},
body: {addTime: '', allowMissing: false, placeIds: [], type: ''},
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}}/v2alpha/:product:addFulfillmentPlaces');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
addTime: '',
allowMissing: false,
placeIds: [],
type: ''
});
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}}/v2alpha/:product:addFulfillmentPlaces',
headers: {'content-type': 'application/json'},
data: {addTime: '', allowMissing: false, placeIds: [], type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"addTime":"","allowMissing":false,"placeIds":[],"type":""}'
};
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 = @{ @"addTime": @"",
@"allowMissing": @NO,
@"placeIds": @[ ],
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces"]
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}}/v2alpha/:product:addFulfillmentPlaces" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces",
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([
'addTime' => '',
'allowMissing' => null,
'placeIds' => [
],
'type' => ''
]),
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}}/v2alpha/:product:addFulfillmentPlaces', [
'body' => '{
"addTime": "",
"allowMissing": false,
"placeIds": [],
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'addTime' => '',
'allowMissing' => null,
'placeIds' => [
],
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'addTime' => '',
'allowMissing' => null,
'placeIds' => [
],
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces');
$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}}/v2alpha/:product:addFulfillmentPlaces' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"addTime": "",
"allowMissing": false,
"placeIds": [],
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"addTime": "",
"allowMissing": false,
"placeIds": [],
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:product:addFulfillmentPlaces", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces"
payload = {
"addTime": "",
"allowMissing": False,
"placeIds": [],
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces"
payload <- "{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\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}}/v2alpha/:product:addFulfillmentPlaces")
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 \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\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/v2alpha/:product:addFulfillmentPlaces') do |req|
req.body = "{\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"placeIds\": [],\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces";
let payload = json!({
"addTime": "",
"allowMissing": false,
"placeIds": (),
"type": ""
});
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}}/v2alpha/:product:addFulfillmentPlaces \
--header 'content-type: application/json' \
--data '{
"addTime": "",
"allowMissing": false,
"placeIds": [],
"type": ""
}'
echo '{
"addTime": "",
"allowMissing": false,
"placeIds": [],
"type": ""
}' | \
http POST {{baseUrl}}/v2alpha/:product:addFulfillmentPlaces \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "addTime": "",\n "allowMissing": false,\n "placeIds": [],\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:product:addFulfillmentPlaces
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"addTime": "",
"allowMissing": false,
"placeIds": [],
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:product:addFulfillmentPlaces")! 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
retail.projects.locations.catalogs.branches.products.addLocalInventories
{{baseUrl}}/v2alpha/:product:addLocalInventories
QUERY PARAMS
product
BODY json
{
"addMask": "",
"addTime": "",
"allowMissing": false,
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:product:addLocalInventories");
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 \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:product:addLocalInventories" {:content-type :json
:form-params {:addMask ""
:addTime ""
:allowMissing false
:localInventories [{:attributes {}
:fulfillmentTypes []
:placeId ""
:priceInfo {:cost ""
:currencyCode ""
:originalPrice ""
:price ""
:priceEffectiveTime ""
:priceExpireTime ""
:priceRange {:originalPrice {:exclusiveMaximum ""
:exclusiveMinimum ""
:maximum ""
:minimum ""}
:price {}}}}]}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:product:addLocalInventories"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\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}}/v2alpha/:product:addLocalInventories"),
Content = new StringContent("{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\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}}/v2alpha/:product:addLocalInventories");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:product:addLocalInventories"
payload := strings.NewReader("{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\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/v2alpha/:product:addLocalInventories HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 592
{
"addMask": "",
"addTime": "",
"allowMissing": false,
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:product:addLocalInventories")
.setHeader("content-type", "application/json")
.setBody("{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:product:addLocalInventories"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\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 \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:product:addLocalInventories")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:product:addLocalInventories")
.header("content-type", "application/json")
.body("{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ]\n}")
.asString();
const data = JSON.stringify({
addMask: '',
addTime: '',
allowMissing: false,
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:product:addLocalInventories');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:product:addLocalInventories',
headers: {'content-type': 'application/json'},
data: {
addMask: '',
addTime: '',
allowMissing: false,
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:product:addLocalInventories';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"addMask":"","addTime":"","allowMissing":false,"localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}]}'
};
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}}/v2alpha/:product:addLocalInventories',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "addMask": "",\n "addTime": "",\n "allowMissing": false,\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\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 \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:product:addLocalInventories")
.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/v2alpha/:product:addLocalInventories',
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({
addMask: '',
addTime: '',
allowMissing: false,
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:product:addLocalInventories',
headers: {'content-type': 'application/json'},
body: {
addMask: '',
addTime: '',
allowMissing: false,
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
]
},
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}}/v2alpha/:product:addLocalInventories');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
addMask: '',
addTime: '',
allowMissing: false,
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
]
});
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}}/v2alpha/:product:addLocalInventories',
headers: {'content-type': 'application/json'},
data: {
addMask: '',
addTime: '',
allowMissing: false,
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:product:addLocalInventories';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"addMask":"","addTime":"","allowMissing":false,"localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}]}'
};
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 = @{ @"addMask": @"",
@"addTime": @"",
@"allowMissing": @NO,
@"localInventories": @[ @{ @"attributes": @{ }, @"fulfillmentTypes": @[ ], @"placeId": @"", @"priceInfo": @{ @"cost": @"", @"currencyCode": @"", @"originalPrice": @"", @"price": @"", @"priceEffectiveTime": @"", @"priceExpireTime": @"", @"priceRange": @{ @"originalPrice": @{ @"exclusiveMaximum": @"", @"exclusiveMinimum": @"", @"maximum": @"", @"minimum": @"" }, @"price": @{ } } } } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:product:addLocalInventories"]
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}}/v2alpha/:product:addLocalInventories" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:product:addLocalInventories",
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([
'addMask' => '',
'addTime' => '',
'allowMissing' => null,
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
]
]),
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}}/v2alpha/:product:addLocalInventories', [
'body' => '{
"addMask": "",
"addTime": "",
"allowMissing": false,
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:product:addLocalInventories');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'addMask' => '',
'addTime' => '',
'allowMissing' => null,
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'addMask' => '',
'addTime' => '',
'allowMissing' => null,
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:product:addLocalInventories');
$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}}/v2alpha/:product:addLocalInventories' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"addMask": "",
"addTime": "",
"allowMissing": false,
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:product:addLocalInventories' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"addMask": "",
"addTime": "",
"allowMissing": false,
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:product:addLocalInventories", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:product:addLocalInventories"
payload = {
"addMask": "",
"addTime": "",
"allowMissing": False,
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:product:addLocalInventories"
payload <- "{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\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}}/v2alpha/:product:addLocalInventories")
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 \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\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/v2alpha/:product:addLocalInventories') do |req|
req.body = "{\n \"addMask\": \"\",\n \"addTime\": \"\",\n \"allowMissing\": false,\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\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}}/v2alpha/:product:addLocalInventories";
let payload = json!({
"addMask": "",
"addTime": "",
"allowMissing": false,
"localInventories": (
json!({
"attributes": json!({}),
"fulfillmentTypes": (),
"placeId": "",
"priceInfo": json!({
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": json!({
"originalPrice": json!({
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}),
"price": json!({})
})
})
})
)
});
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}}/v2alpha/:product:addLocalInventories \
--header 'content-type: application/json' \
--data '{
"addMask": "",
"addTime": "",
"allowMissing": false,
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
]
}'
echo '{
"addMask": "",
"addTime": "",
"allowMissing": false,
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
]
}' | \
http POST {{baseUrl}}/v2alpha/:product:addLocalInventories \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "addMask": "",\n "addTime": "",\n "allowMissing": false,\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:product:addLocalInventories
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"addMask": "",
"addTime": "",
"allowMissing": false,
"localInventories": [
[
"attributes": [],
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": [
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": [
"originalPrice": [
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
],
"price": []
]
]
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:product:addLocalInventories")! 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
retail.projects.locations.catalogs.branches.products.create
{{baseUrl}}/v2alpha/:parent/products
QUERY PARAMS
parent
BODY json
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/products");
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 \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:parent/products" {:content-type :json
:form-params {:attributes {}
:audience {:ageGroups []
:genders []}
:availability ""
:availableQuantity 0
:availableTime ""
:brands []
:categories []
:collectionMemberIds []
:colorInfo {:colorFamilies []
:colors []}
:conditions []
:description ""
:expireTime ""
:fulfillmentInfo [{:placeIds []
:type ""}]
:gtin ""
:id ""
:images [{:height 0
:uri ""
:width 0}]
:languageCode ""
:localInventories [{:attributes {}
:fulfillmentTypes []
:placeId ""
:priceInfo {:cost ""
:currencyCode ""
:originalPrice ""
:price ""
:priceEffectiveTime ""
:priceExpireTime ""
:priceRange {:originalPrice {:exclusiveMaximum ""
:exclusiveMinimum ""
:maximum ""
:minimum ""}
:price {}}}}]
:materials []
:name ""
:patterns []
:priceInfo {}
:primaryProductId ""
:promotions [{:promotionId ""}]
:publishTime ""
:rating {:averageRating ""
:ratingCount 0
:ratingHistogram []}
:retrievableFields ""
:sizes []
:tags []
:title ""
:ttl ""
:type ""
:uri ""
:variants []}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/products"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\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}}/v2alpha/:parent/products"),
Content = new StringContent("{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\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}}/v2alpha/:parent/products");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/products"
payload := strings.NewReader("{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\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/v2alpha/:parent/products HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1482
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:parent/products")
.setHeader("content-type", "application/json")
.setBody("{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/products"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\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 \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/products")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:parent/products")
.header("content-type", "application/json")
.body("{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n}")
.asString();
const data = JSON.stringify({
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:parent/products');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/products',
headers: {'content-type': 'application/json'},
data: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/products';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]}'
};
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}}/v2alpha/:parent/products',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/products")
.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/v2alpha/:parent/products',
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({
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/products',
headers: {'content-type': 'application/json'},
body: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
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}}/v2alpha/:parent/products');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
});
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}}/v2alpha/:parent/products',
headers: {'content-type': 'application/json'},
data: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/products';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]}'
};
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 = @{ @"attributes": @{ },
@"audience": @{ @"ageGroups": @[ ], @"genders": @[ ] },
@"availability": @"",
@"availableQuantity": @0,
@"availableTime": @"",
@"brands": @[ ],
@"categories": @[ ],
@"collectionMemberIds": @[ ],
@"colorInfo": @{ @"colorFamilies": @[ ], @"colors": @[ ] },
@"conditions": @[ ],
@"description": @"",
@"expireTime": @"",
@"fulfillmentInfo": @[ @{ @"placeIds": @[ ], @"type": @"" } ],
@"gtin": @"",
@"id": @"",
@"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ],
@"languageCode": @"",
@"localInventories": @[ @{ @"attributes": @{ }, @"fulfillmentTypes": @[ ], @"placeId": @"", @"priceInfo": @{ @"cost": @"", @"currencyCode": @"", @"originalPrice": @"", @"price": @"", @"priceEffectiveTime": @"", @"priceExpireTime": @"", @"priceRange": @{ @"originalPrice": @{ @"exclusiveMaximum": @"", @"exclusiveMinimum": @"", @"maximum": @"", @"minimum": @"" }, @"price": @{ } } } } ],
@"materials": @[ ],
@"name": @"",
@"patterns": @[ ],
@"priceInfo": @{ },
@"primaryProductId": @"",
@"promotions": @[ @{ @"promotionId": @"" } ],
@"publishTime": @"",
@"rating": @{ @"averageRating": @"", @"ratingCount": @0, @"ratingHistogram": @[ ] },
@"retrievableFields": @"",
@"sizes": @[ ],
@"tags": @[ ],
@"title": @"",
@"ttl": @"",
@"type": @"",
@"uri": @"",
@"variants": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:parent/products"]
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}}/v2alpha/:parent/products" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/products",
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([
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
]),
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}}/v2alpha/:parent/products', [
'body' => '{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/products');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:parent/products');
$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}}/v2alpha/:parent/products' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/products' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:parent/products", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/products"
payload = {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [{ "promotionId": "" }],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/products"
payload <- "{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\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}}/v2alpha/:parent/products")
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 \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\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/v2alpha/:parent/products') do |req|
req.body = "{\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/products";
let payload = json!({
"attributes": json!({}),
"audience": json!({
"ageGroups": (),
"genders": ()
}),
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": (),
"categories": (),
"collectionMemberIds": (),
"colorInfo": json!({
"colorFamilies": (),
"colors": ()
}),
"conditions": (),
"description": "",
"expireTime": "",
"fulfillmentInfo": (
json!({
"placeIds": (),
"type": ""
})
),
"gtin": "",
"id": "",
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"languageCode": "",
"localInventories": (
json!({
"attributes": json!({}),
"fulfillmentTypes": (),
"placeId": "",
"priceInfo": json!({
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": json!({
"originalPrice": json!({
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}),
"price": json!({})
})
})
})
),
"materials": (),
"name": "",
"patterns": (),
"priceInfo": json!({}),
"primaryProductId": "",
"promotions": (json!({"promotionId": ""})),
"publishTime": "",
"rating": json!({
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": ()
}),
"retrievableFields": "",
"sizes": (),
"tags": (),
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": ()
});
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}}/v2alpha/:parent/products \
--header 'content-type: application/json' \
--data '{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}'
echo '{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}' | \
http POST {{baseUrl}}/v2alpha/:parent/products \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:parent/products
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"attributes": [],
"audience": [
"ageGroups": [],
"genders": []
],
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": [
"colorFamilies": [],
"colors": []
],
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
[
"placeIds": [],
"type": ""
]
],
"gtin": "",
"id": "",
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"languageCode": "",
"localInventories": [
[
"attributes": [],
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": [
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": [
"originalPrice": [
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
],
"price": []
]
]
]
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": [],
"primaryProductId": "",
"promotions": [["promotionId": ""]],
"publishTime": "",
"rating": [
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
],
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/products")! 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
retail.projects.locations.catalogs.branches.products.import
{{baseUrl}}/v2alpha/:parent/products:import
QUERY PARAMS
parent
BODY json
{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"productInlineSource": {
"products": [
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
]
}
},
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": false,
"updateMask": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/products: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\n \"updateMask\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:parent/products:import" {:content-type :json
:form-params {:errorsConfig {:gcsPrefix ""}
:inputConfig {:bigQuerySource {:dataSchema ""
:datasetId ""
:gcsStagingDir ""
:partitionDate {:day 0
:month 0
:year 0}
:projectId ""
:tableId ""}
:gcsSource {:dataSchema ""
:inputUris []}
:productInlineSource {:products [{:attributes {}
:audience {:ageGroups []
:genders []}
:availability ""
:availableQuantity 0
:availableTime ""
:brands []
:categories []
:collectionMemberIds []
:colorInfo {:colorFamilies []
:colors []}
:conditions []
:description ""
:expireTime ""
:fulfillmentInfo [{:placeIds []
:type ""}]
:gtin ""
:id ""
:images [{:height 0
:uri ""
:width 0}]
:languageCode ""
:localInventories [{:attributes {}
:fulfillmentTypes []
:placeId ""
:priceInfo {:cost ""
:currencyCode ""
:originalPrice ""
:price ""
:priceEffectiveTime ""
:priceExpireTime ""
:priceRange {:originalPrice {:exclusiveMaximum ""
:exclusiveMinimum ""
:maximum ""
:minimum ""}
:price {}}}}]
:materials []
:name ""
:patterns []
:priceInfo {}
:primaryProductId ""
:promotions [{:promotionId ""}]
:publishTime ""
:rating {:averageRating ""
:ratingCount 0
:ratingHistogram []}
:retrievableFields ""
:sizes []
:tags []
:title ""
:ttl ""
:type ""
:uri ""
:variants []}]}}
:notificationPubsubTopic ""
:reconciliationMode ""
:requestId ""
:skipDefaultBranchProtection false
:updateMask ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/products: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\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}}/v2alpha/:parent/products:import"),
Content = new StringContent("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\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}}/v2alpha/:parent/products: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\n \"updateMask\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/products:import"
payload := strings.NewReader("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\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/v2alpha/:parent/products:import HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2739
{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"productInlineSource": {
"products": [
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
]
}
},
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": false,
"updateMask": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:parent/products:import")
.setHeader("content-type", "application/json")
.setBody("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\n \"updateMask\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/products: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\n \"updateMask\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/products:import")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:parent/products:import")
.header("content-type", "application/json")
.body("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\n \"updateMask\": \"\"\n}")
.asString();
const data = JSON.stringify({
errorsConfig: {
gcsPrefix: ''
},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {
day: 0,
month: 0,
year: 0
},
projectId: '',
tableId: ''
},
gcsSource: {
dataSchema: '',
inputUris: []
},
productInlineSource: {
products: [
{
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
}
]
}
},
notificationPubsubTopic: '',
reconciliationMode: '',
requestId: '',
skipDefaultBranchProtection: false,
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}}/v2alpha/:parent/products:import');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/products:import',
headers: {'content-type': 'application/json'},
data: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
},
gcsSource: {dataSchema: '', inputUris: []},
productInlineSource: {
products: [
{
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
}
]
}
},
notificationPubsubTopic: '',
reconciliationMode: '',
requestId: '',
skipDefaultBranchProtection: false,
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/products:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"errorsConfig":{"gcsPrefix":""},"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","partitionDate":{"day":0,"month":0,"year":0},"projectId":"","tableId":""},"gcsSource":{"dataSchema":"","inputUris":[]},"productInlineSource":{"products":[{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]}]}},"notificationPubsubTopic":"","reconciliationMode":"","requestId":"","skipDefaultBranchProtection":false,"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}}/v2alpha/:parent/products: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 "partitionDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "projectId": "",\n "tableId": ""\n },\n "gcsSource": {\n "dataSchema": "",\n "inputUris": []\n },\n "productInlineSource": {\n "products": [\n {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n }\n ]\n }\n },\n "notificationPubsubTopic": "",\n "reconciliationMode": "",\n "requestId": "",\n "skipDefaultBranchProtection": false,\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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\n \"updateMask\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/products: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/v2alpha/:parent/products: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: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
},
gcsSource: {dataSchema: '', inputUris: []},
productInlineSource: {
products: [
{
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
}
]
}
},
notificationPubsubTopic: '',
reconciliationMode: '',
requestId: '',
skipDefaultBranchProtection: false,
updateMask: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/products:import',
headers: {'content-type': 'application/json'},
body: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
},
gcsSource: {dataSchema: '', inputUris: []},
productInlineSource: {
products: [
{
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
}
]
}
},
notificationPubsubTopic: '',
reconciliationMode: '',
requestId: '',
skipDefaultBranchProtection: false,
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}}/v2alpha/:parent/products:import');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
errorsConfig: {
gcsPrefix: ''
},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {
day: 0,
month: 0,
year: 0
},
projectId: '',
tableId: ''
},
gcsSource: {
dataSchema: '',
inputUris: []
},
productInlineSource: {
products: [
{
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
}
]
}
},
notificationPubsubTopic: '',
reconciliationMode: '',
requestId: '',
skipDefaultBranchProtection: false,
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}}/v2alpha/:parent/products:import',
headers: {'content-type': 'application/json'},
data: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
},
gcsSource: {dataSchema: '', inputUris: []},
productInlineSource: {
products: [
{
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
}
]
}
},
notificationPubsubTopic: '',
reconciliationMode: '',
requestId: '',
skipDefaultBranchProtection: false,
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/products:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"errorsConfig":{"gcsPrefix":""},"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","partitionDate":{"day":0,"month":0,"year":0},"projectId":"","tableId":""},"gcsSource":{"dataSchema":"","inputUris":[]},"productInlineSource":{"products":[{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]}]}},"notificationPubsubTopic":"","reconciliationMode":"","requestId":"","skipDefaultBranchProtection":false,"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": @"", @"partitionDate": @{ @"day": @0, @"month": @0, @"year": @0 }, @"projectId": @"", @"tableId": @"" }, @"gcsSource": @{ @"dataSchema": @"", @"inputUris": @[ ] }, @"productInlineSource": @{ @"products": @[ @{ @"attributes": @{ }, @"audience": @{ @"ageGroups": @[ ], @"genders": @[ ] }, @"availability": @"", @"availableQuantity": @0, @"availableTime": @"", @"brands": @[ ], @"categories": @[ ], @"collectionMemberIds": @[ ], @"colorInfo": @{ @"colorFamilies": @[ ], @"colors": @[ ] }, @"conditions": @[ ], @"description": @"", @"expireTime": @"", @"fulfillmentInfo": @[ @{ @"placeIds": @[ ], @"type": @"" } ], @"gtin": @"", @"id": @"", @"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ], @"languageCode": @"", @"localInventories": @[ @{ @"attributes": @{ }, @"fulfillmentTypes": @[ ], @"placeId": @"", @"priceInfo": @{ @"cost": @"", @"currencyCode": @"", @"originalPrice": @"", @"price": @"", @"priceEffectiveTime": @"", @"priceExpireTime": @"", @"priceRange": @{ @"originalPrice": @{ @"exclusiveMaximum": @"", @"exclusiveMinimum": @"", @"maximum": @"", @"minimum": @"" }, @"price": @{ } } } } ], @"materials": @[ ], @"name": @"", @"patterns": @[ ], @"priceInfo": @{ }, @"primaryProductId": @"", @"promotions": @[ @{ @"promotionId": @"" } ], @"publishTime": @"", @"rating": @{ @"averageRating": @"", @"ratingCount": @0, @"ratingHistogram": @[ ] }, @"retrievableFields": @"", @"sizes": @[ ], @"tags": @[ ], @"title": @"", @"ttl": @"", @"type": @"", @"uri": @"", @"variants": @[ ] } ] } },
@"notificationPubsubTopic": @"",
@"reconciliationMode": @"",
@"requestId": @"",
@"skipDefaultBranchProtection": @NO,
@"updateMask": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\n \"updateMask\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/products: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' => '',
'partitionDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'projectId' => '',
'tableId' => ''
],
'gcsSource' => [
'dataSchema' => '',
'inputUris' => [
]
],
'productInlineSource' => [
'products' => [
[
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
]
]
]
],
'notificationPubsubTopic' => '',
'reconciliationMode' => '',
'requestId' => '',
'skipDefaultBranchProtection' => null,
'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}}/v2alpha/:parent/products:import', [
'body' => '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"productInlineSource": {
"products": [
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
]
}
},
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": false,
"updateMask": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/products: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' => '',
'partitionDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'projectId' => '',
'tableId' => ''
],
'gcsSource' => [
'dataSchema' => '',
'inputUris' => [
]
],
'productInlineSource' => [
'products' => [
[
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
]
]
]
],
'notificationPubsubTopic' => '',
'reconciliationMode' => '',
'requestId' => '',
'skipDefaultBranchProtection' => null,
'updateMask' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'errorsConfig' => [
'gcsPrefix' => ''
],
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'partitionDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'projectId' => '',
'tableId' => ''
],
'gcsSource' => [
'dataSchema' => '',
'inputUris' => [
]
],
'productInlineSource' => [
'products' => [
[
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
]
]
]
],
'notificationPubsubTopic' => '',
'reconciliationMode' => '',
'requestId' => '',
'skipDefaultBranchProtection' => null,
'updateMask' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"productInlineSource": {
"products": [
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
]
}
},
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": false,
"updateMask": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/products:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"productInlineSource": {
"products": [
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
]
}
},
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": false,
"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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\n \"updateMask\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:parent/products:import", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/products:import"
payload = {
"errorsConfig": { "gcsPrefix": "" },
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"productInlineSource": { "products": [
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [{ "promotionId": "" }],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
] }
},
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": False,
"updateMask": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/products:import"
payload <- "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\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}}/v2alpha/:parent/products: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\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/v2alpha/:parent/products:import') do |req|
req.body = "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"productInlineSource\": {\n \"products\": [\n {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n }\n ]\n }\n },\n \"notificationPubsubTopic\": \"\",\n \"reconciliationMode\": \"\",\n \"requestId\": \"\",\n \"skipDefaultBranchProtection\": false,\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}}/v2alpha/:parent/products:import";
let payload = json!({
"errorsConfig": json!({"gcsPrefix": ""}),
"inputConfig": json!({
"bigQuerySource": json!({
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": json!({
"day": 0,
"month": 0,
"year": 0
}),
"projectId": "",
"tableId": ""
}),
"gcsSource": json!({
"dataSchema": "",
"inputUris": ()
}),
"productInlineSource": json!({"products": (
json!({
"attributes": json!({}),
"audience": json!({
"ageGroups": (),
"genders": ()
}),
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": (),
"categories": (),
"collectionMemberIds": (),
"colorInfo": json!({
"colorFamilies": (),
"colors": ()
}),
"conditions": (),
"description": "",
"expireTime": "",
"fulfillmentInfo": (
json!({
"placeIds": (),
"type": ""
})
),
"gtin": "",
"id": "",
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"languageCode": "",
"localInventories": (
json!({
"attributes": json!({}),
"fulfillmentTypes": (),
"placeId": "",
"priceInfo": json!({
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": json!({
"originalPrice": json!({
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}),
"price": json!({})
})
})
})
),
"materials": (),
"name": "",
"patterns": (),
"priceInfo": json!({}),
"primaryProductId": "",
"promotions": (json!({"promotionId": ""})),
"publishTime": "",
"rating": json!({
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": ()
}),
"retrievableFields": "",
"sizes": (),
"tags": (),
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": ()
})
)})
}),
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": false,
"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}}/v2alpha/:parent/products:import \
--header 'content-type: application/json' \
--data '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"productInlineSource": {
"products": [
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
]
}
},
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": false,
"updateMask": ""
}'
echo '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"productInlineSource": {
"products": [
{
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
}
]
}
},
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": false,
"updateMask": ""
}' | \
http POST {{baseUrl}}/v2alpha/:parent/products: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 "partitionDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "projectId": "",\n "tableId": ""\n },\n "gcsSource": {\n "dataSchema": "",\n "inputUris": []\n },\n "productInlineSource": {\n "products": [\n {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n }\n ]\n }\n },\n "notificationPubsubTopic": "",\n "reconciliationMode": "",\n "requestId": "",\n "skipDefaultBranchProtection": false,\n "updateMask": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:parent/products:import
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"errorsConfig": ["gcsPrefix": ""],
"inputConfig": [
"bigQuerySource": [
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": [
"day": 0,
"month": 0,
"year": 0
],
"projectId": "",
"tableId": ""
],
"gcsSource": [
"dataSchema": "",
"inputUris": []
],
"productInlineSource": ["products": [
[
"attributes": [],
"audience": [
"ageGroups": [],
"genders": []
],
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": [
"colorFamilies": [],
"colors": []
],
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
[
"placeIds": [],
"type": ""
]
],
"gtin": "",
"id": "",
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"languageCode": "",
"localInventories": [
[
"attributes": [],
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": [
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": [
"originalPrice": [
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
],
"price": []
]
]
]
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": [],
"primaryProductId": "",
"promotions": [["promotionId": ""]],
"publishTime": "",
"rating": [
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
],
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
]
]]
],
"notificationPubsubTopic": "",
"reconciliationMode": "",
"requestId": "",
"skipDefaultBranchProtection": false,
"updateMask": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/products: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
retail.projects.locations.catalogs.branches.products.list
{{baseUrl}}/v2alpha/:parent/products
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/products");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:parent/products")
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/products"
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}}/v2alpha/:parent/products"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:parent/products");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/products"
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/v2alpha/:parent/products HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:parent/products")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/products"))
.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}}/v2alpha/:parent/products")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/:parent/products")
.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}}/v2alpha/:parent/products');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2alpha/:parent/products'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/products';
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}}/v2alpha/:parent/products',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/products")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2alpha/:parent/products',
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}}/v2alpha/:parent/products'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2alpha/:parent/products');
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}}/v2alpha/:parent/products'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/products';
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}}/v2alpha/:parent/products"]
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}}/v2alpha/:parent/products" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/products",
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}}/v2alpha/:parent/products');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/products');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:parent/products');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:parent/products' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/products' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:parent/products")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/products"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/products"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/:parent/products")
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/v2alpha/:parent/products') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/products";
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}}/v2alpha/:parent/products
http GET {{baseUrl}}/v2alpha/:parent/products
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:parent/products
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/products")! 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
retail.projects.locations.catalogs.branches.products.purge
{{baseUrl}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products:purge" {:content-type :json
:form-params {:filter ""
:force false}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products:purge")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products:purge');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products:purge', [
'body' => '{
"filter": "",
"force": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products:purge' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filter": "",
"force": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/products: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/v2alpha/:parent/products:purge", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products:purge \
--header 'content-type: application/json' \
--data '{
"filter": "",
"force": false
}'
echo '{
"filter": "",
"force": false
}' | \
http POST {{baseUrl}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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}}/v2alpha/:parent/products: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
retail.projects.locations.catalogs.branches.products.removeFulfillmentPlaces
{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces
QUERY PARAMS
product
BODY json
{
"allowMissing": false,
"placeIds": [],
"removeTime": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces");
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 \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces" {:content-type :json
:form-params {:allowMissing false
:placeIds []
:removeTime ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\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}}/v2alpha/:product:removeFulfillmentPlaces"),
Content = new StringContent("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\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}}/v2alpha/:product:removeFulfillmentPlaces");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces"
payload := strings.NewReader("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\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/v2alpha/:product:removeFulfillmentPlaces HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 79
{
"allowMissing": false,
"placeIds": [],
"removeTime": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\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 \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces")
.header("content-type", "application/json")
.body("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
allowMissing: false,
placeIds: [],
removeTime: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces',
headers: {'content-type': 'application/json'},
data: {allowMissing: false, placeIds: [], removeTime: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowMissing":false,"placeIds":[],"removeTime":"","type":""}'
};
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}}/v2alpha/:product:removeFulfillmentPlaces',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowMissing": false,\n "placeIds": [],\n "removeTime": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces")
.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/v2alpha/:product:removeFulfillmentPlaces',
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({allowMissing: false, placeIds: [], removeTime: '', type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces',
headers: {'content-type': 'application/json'},
body: {allowMissing: false, placeIds: [], removeTime: '', type: ''},
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}}/v2alpha/:product:removeFulfillmentPlaces');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowMissing: false,
placeIds: [],
removeTime: '',
type: ''
});
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}}/v2alpha/:product:removeFulfillmentPlaces',
headers: {'content-type': 'application/json'},
data: {allowMissing: false, placeIds: [], removeTime: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowMissing":false,"placeIds":[],"removeTime":"","type":""}'
};
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 = @{ @"allowMissing": @NO,
@"placeIds": @[ ],
@"removeTime": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces"]
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}}/v2alpha/:product:removeFulfillmentPlaces" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces",
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([
'allowMissing' => null,
'placeIds' => [
],
'removeTime' => '',
'type' => ''
]),
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}}/v2alpha/:product:removeFulfillmentPlaces', [
'body' => '{
"allowMissing": false,
"placeIds": [],
"removeTime": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowMissing' => null,
'placeIds' => [
],
'removeTime' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowMissing' => null,
'placeIds' => [
],
'removeTime' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces');
$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}}/v2alpha/:product:removeFulfillmentPlaces' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowMissing": false,
"placeIds": [],
"removeTime": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowMissing": false,
"placeIds": [],
"removeTime": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:product:removeFulfillmentPlaces", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces"
payload = {
"allowMissing": False,
"placeIds": [],
"removeTime": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces"
payload <- "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\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}}/v2alpha/:product:removeFulfillmentPlaces")
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 \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\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/v2alpha/:product:removeFulfillmentPlaces') do |req|
req.body = "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces";
let payload = json!({
"allowMissing": false,
"placeIds": (),
"removeTime": "",
"type": ""
});
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}}/v2alpha/:product:removeFulfillmentPlaces \
--header 'content-type: application/json' \
--data '{
"allowMissing": false,
"placeIds": [],
"removeTime": "",
"type": ""
}'
echo '{
"allowMissing": false,
"placeIds": [],
"removeTime": "",
"type": ""
}' | \
http POST {{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "allowMissing": false,\n "placeIds": [],\n "removeTime": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowMissing": false,
"placeIds": [],
"removeTime": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:product:removeFulfillmentPlaces")! 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
retail.projects.locations.catalogs.branches.products.removeLocalInventories
{{baseUrl}}/v2alpha/:product:removeLocalInventories
QUERY PARAMS
product
BODY json
{
"allowMissing": false,
"placeIds": [],
"removeTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:product:removeLocalInventories");
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 \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:product:removeLocalInventories" {:content-type :json
:form-params {:allowMissing false
:placeIds []
:removeTime ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:product:removeLocalInventories"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\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}}/v2alpha/:product:removeLocalInventories"),
Content = new StringContent("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\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}}/v2alpha/:product:removeLocalInventories");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:product:removeLocalInventories"
payload := strings.NewReader("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\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/v2alpha/:product:removeLocalInventories HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 65
{
"allowMissing": false,
"placeIds": [],
"removeTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:product:removeLocalInventories")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:product:removeLocalInventories"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\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 \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:product:removeLocalInventories")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:product:removeLocalInventories")
.header("content-type", "application/json")
.body("{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
allowMissing: false,
placeIds: [],
removeTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:product:removeLocalInventories');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:product:removeLocalInventories',
headers: {'content-type': 'application/json'},
data: {allowMissing: false, placeIds: [], removeTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:product:removeLocalInventories';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowMissing":false,"placeIds":[],"removeTime":""}'
};
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}}/v2alpha/:product:removeLocalInventories',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowMissing": false,\n "placeIds": [],\n "removeTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:product:removeLocalInventories")
.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/v2alpha/:product:removeLocalInventories',
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({allowMissing: false, placeIds: [], removeTime: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:product:removeLocalInventories',
headers: {'content-type': 'application/json'},
body: {allowMissing: false, placeIds: [], removeTime: ''},
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}}/v2alpha/:product:removeLocalInventories');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowMissing: false,
placeIds: [],
removeTime: ''
});
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}}/v2alpha/:product:removeLocalInventories',
headers: {'content-type': 'application/json'},
data: {allowMissing: false, placeIds: [], removeTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:product:removeLocalInventories';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowMissing":false,"placeIds":[],"removeTime":""}'
};
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 = @{ @"allowMissing": @NO,
@"placeIds": @[ ],
@"removeTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:product:removeLocalInventories"]
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}}/v2alpha/:product:removeLocalInventories" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:product:removeLocalInventories",
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([
'allowMissing' => null,
'placeIds' => [
],
'removeTime' => ''
]),
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}}/v2alpha/:product:removeLocalInventories', [
'body' => '{
"allowMissing": false,
"placeIds": [],
"removeTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:product:removeLocalInventories');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowMissing' => null,
'placeIds' => [
],
'removeTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowMissing' => null,
'placeIds' => [
],
'removeTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:product:removeLocalInventories');
$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}}/v2alpha/:product:removeLocalInventories' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowMissing": false,
"placeIds": [],
"removeTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:product:removeLocalInventories' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowMissing": false,
"placeIds": [],
"removeTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:product:removeLocalInventories", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:product:removeLocalInventories"
payload = {
"allowMissing": False,
"placeIds": [],
"removeTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:product:removeLocalInventories"
payload <- "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\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}}/v2alpha/:product:removeLocalInventories")
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 \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\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/v2alpha/:product:removeLocalInventories') do |req|
req.body = "{\n \"allowMissing\": false,\n \"placeIds\": [],\n \"removeTime\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:product:removeLocalInventories";
let payload = json!({
"allowMissing": false,
"placeIds": (),
"removeTime": ""
});
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}}/v2alpha/:product:removeLocalInventories \
--header 'content-type: application/json' \
--data '{
"allowMissing": false,
"placeIds": [],
"removeTime": ""
}'
echo '{
"allowMissing": false,
"placeIds": [],
"removeTime": ""
}' | \
http POST {{baseUrl}}/v2alpha/:product:removeLocalInventories \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "allowMissing": false,\n "placeIds": [],\n "removeTime": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:product:removeLocalInventories
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowMissing": false,
"placeIds": [],
"removeTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:product:removeLocalInventories")! 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
retail.projects.locations.catalogs.branches.products.setInventory
{{baseUrl}}/v2alpha/:name:setInventory
QUERY PARAMS
name
BODY json
{
"allowMissing": false,
"inventory": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"setMask": "",
"setTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:name:setInventory");
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 \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:name:setInventory" {:content-type :json
:form-params {:allowMissing false
:inventory {:attributes {}
:audience {:ageGroups []
:genders []}
:availability ""
:availableQuantity 0
:availableTime ""
:brands []
:categories []
:collectionMemberIds []
:colorInfo {:colorFamilies []
:colors []}
:conditions []
:description ""
:expireTime ""
:fulfillmentInfo [{:placeIds []
:type ""}]
:gtin ""
:id ""
:images [{:height 0
:uri ""
:width 0}]
:languageCode ""
:localInventories [{:attributes {}
:fulfillmentTypes []
:placeId ""
:priceInfo {:cost ""
:currencyCode ""
:originalPrice ""
:price ""
:priceEffectiveTime ""
:priceExpireTime ""
:priceRange {:originalPrice {:exclusiveMaximum ""
:exclusiveMinimum ""
:maximum ""
:minimum ""}
:price {}}}}]
:materials []
:name ""
:patterns []
:priceInfo {}
:primaryProductId ""
:promotions [{:promotionId ""}]
:publishTime ""
:rating {:averageRating ""
:ratingCount 0
:ratingHistogram []}
:retrievableFields ""
:sizes []
:tags []
:title ""
:ttl ""
:type ""
:uri ""
:variants []}
:setMask ""
:setTime ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:name:setInventory"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\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}}/v2alpha/:name:setInventory"),
Content = new StringContent("{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\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}}/v2alpha/:name:setInventory");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:name:setInventory"
payload := strings.NewReader("{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\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/v2alpha/:name:setInventory HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1726
{
"allowMissing": false,
"inventory": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"setMask": "",
"setTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:name:setInventory")
.setHeader("content-type", "application/json")
.setBody("{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:name:setInventory"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\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 \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:name:setInventory")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:name:setInventory")
.header("content-type", "application/json")
.body("{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
allowMissing: false,
inventory: {
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
setMask: '',
setTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:name:setInventory');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name:setInventory',
headers: {'content-type': 'application/json'},
data: {
allowMissing: false,
inventory: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
setMask: '',
setTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:name:setInventory';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowMissing":false,"inventory":{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]},"setMask":"","setTime":""}'
};
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}}/v2alpha/:name:setInventory',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "allowMissing": false,\n "inventory": {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n },\n "setMask": "",\n "setTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:name:setInventory")
.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/v2alpha/:name:setInventory',
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({
allowMissing: false,
inventory: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
setMask: '',
setTime: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name:setInventory',
headers: {'content-type': 'application/json'},
body: {
allowMissing: false,
inventory: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
setMask: '',
setTime: ''
},
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}}/v2alpha/:name:setInventory');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
allowMissing: false,
inventory: {
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
setMask: '',
setTime: ''
});
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}}/v2alpha/:name:setInventory',
headers: {'content-type': 'application/json'},
data: {
allowMissing: false,
inventory: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
setMask: '',
setTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:name:setInventory';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"allowMissing":false,"inventory":{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]},"setMask":"","setTime":""}'
};
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 = @{ @"allowMissing": @NO,
@"inventory": @{ @"attributes": @{ }, @"audience": @{ @"ageGroups": @[ ], @"genders": @[ ] }, @"availability": @"", @"availableQuantity": @0, @"availableTime": @"", @"brands": @[ ], @"categories": @[ ], @"collectionMemberIds": @[ ], @"colorInfo": @{ @"colorFamilies": @[ ], @"colors": @[ ] }, @"conditions": @[ ], @"description": @"", @"expireTime": @"", @"fulfillmentInfo": @[ @{ @"placeIds": @[ ], @"type": @"" } ], @"gtin": @"", @"id": @"", @"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ], @"languageCode": @"", @"localInventories": @[ @{ @"attributes": @{ }, @"fulfillmentTypes": @[ ], @"placeId": @"", @"priceInfo": @{ @"cost": @"", @"currencyCode": @"", @"originalPrice": @"", @"price": @"", @"priceEffectiveTime": @"", @"priceExpireTime": @"", @"priceRange": @{ @"originalPrice": @{ @"exclusiveMaximum": @"", @"exclusiveMinimum": @"", @"maximum": @"", @"minimum": @"" }, @"price": @{ } } } } ], @"materials": @[ ], @"name": @"", @"patterns": @[ ], @"priceInfo": @{ }, @"primaryProductId": @"", @"promotions": @[ @{ @"promotionId": @"" } ], @"publishTime": @"", @"rating": @{ @"averageRating": @"", @"ratingCount": @0, @"ratingHistogram": @[ ] }, @"retrievableFields": @"", @"sizes": @[ ], @"tags": @[ ], @"title": @"", @"ttl": @"", @"type": @"", @"uri": @"", @"variants": @[ ] },
@"setMask": @"",
@"setTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:name:setInventory"]
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}}/v2alpha/:name:setInventory" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:name:setInventory",
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([
'allowMissing' => null,
'inventory' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'setMask' => '',
'setTime' => ''
]),
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}}/v2alpha/:name:setInventory', [
'body' => '{
"allowMissing": false,
"inventory": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"setMask": "",
"setTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:name:setInventory');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'allowMissing' => null,
'inventory' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'setMask' => '',
'setTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'allowMissing' => null,
'inventory' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'setMask' => '',
'setTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:name:setInventory');
$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}}/v2alpha/:name:setInventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowMissing": false,
"inventory": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"setMask": "",
"setTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:name:setInventory' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"allowMissing": false,
"inventory": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"setMask": "",
"setTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:name:setInventory", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:name:setInventory"
payload = {
"allowMissing": False,
"inventory": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [{ "promotionId": "" }],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"setMask": "",
"setTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:name:setInventory"
payload <- "{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\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}}/v2alpha/:name:setInventory")
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 \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\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/v2alpha/:name:setInventory') do |req|
req.body = "{\n \"allowMissing\": false,\n \"inventory\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"setMask\": \"\",\n \"setTime\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:name:setInventory";
let payload = json!({
"allowMissing": false,
"inventory": json!({
"attributes": json!({}),
"audience": json!({
"ageGroups": (),
"genders": ()
}),
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": (),
"categories": (),
"collectionMemberIds": (),
"colorInfo": json!({
"colorFamilies": (),
"colors": ()
}),
"conditions": (),
"description": "",
"expireTime": "",
"fulfillmentInfo": (
json!({
"placeIds": (),
"type": ""
})
),
"gtin": "",
"id": "",
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"languageCode": "",
"localInventories": (
json!({
"attributes": json!({}),
"fulfillmentTypes": (),
"placeId": "",
"priceInfo": json!({
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": json!({
"originalPrice": json!({
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}),
"price": json!({})
})
})
})
),
"materials": (),
"name": "",
"patterns": (),
"priceInfo": json!({}),
"primaryProductId": "",
"promotions": (json!({"promotionId": ""})),
"publishTime": "",
"rating": json!({
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": ()
}),
"retrievableFields": "",
"sizes": (),
"tags": (),
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": ()
}),
"setMask": "",
"setTime": ""
});
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}}/v2alpha/:name:setInventory \
--header 'content-type: application/json' \
--data '{
"allowMissing": false,
"inventory": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"setMask": "",
"setTime": ""
}'
echo '{
"allowMissing": false,
"inventory": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"setMask": "",
"setTime": ""
}' | \
http POST {{baseUrl}}/v2alpha/:name:setInventory \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "allowMissing": false,\n "inventory": {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n },\n "setMask": "",\n "setTime": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:name:setInventory
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"allowMissing": false,
"inventory": [
"attributes": [],
"audience": [
"ageGroups": [],
"genders": []
],
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": [
"colorFamilies": [],
"colors": []
],
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
[
"placeIds": [],
"type": ""
]
],
"gtin": "",
"id": "",
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"languageCode": "",
"localInventories": [
[
"attributes": [],
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": [
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": [
"originalPrice": [
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
],
"price": []
]
]
]
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": [],
"primaryProductId": "",
"promotions": [["promotionId": ""]],
"publishTime": "",
"rating": [
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
],
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
],
"setMask": "",
"setTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:name:setInventory")! 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
retail.projects.locations.catalogs.completeQuery
{{baseUrl}}/v2alpha/:catalog:completeQuery
QUERY PARAMS
catalog
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:catalog:completeQuery");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:catalog:completeQuery")
require "http/client"
url = "{{baseUrl}}/v2alpha/:catalog:completeQuery"
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}}/v2alpha/:catalog:completeQuery"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:catalog:completeQuery");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:catalog:completeQuery"
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/v2alpha/:catalog:completeQuery HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:catalog:completeQuery")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:catalog:completeQuery"))
.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}}/v2alpha/:catalog:completeQuery")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/:catalog:completeQuery")
.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}}/v2alpha/:catalog:completeQuery');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v2alpha/:catalog:completeQuery'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:catalog:completeQuery';
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}}/v2alpha/:catalog:completeQuery',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:catalog:completeQuery")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2alpha/:catalog:completeQuery',
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}}/v2alpha/:catalog:completeQuery'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2alpha/:catalog:completeQuery');
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}}/v2alpha/:catalog:completeQuery'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:catalog:completeQuery';
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}}/v2alpha/:catalog:completeQuery"]
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}}/v2alpha/:catalog:completeQuery" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:catalog:completeQuery",
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}}/v2alpha/:catalog:completeQuery');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:catalog:completeQuery');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:catalog:completeQuery');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:catalog:completeQuery' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:catalog:completeQuery' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:catalog:completeQuery")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:catalog:completeQuery"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:catalog:completeQuery"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/:catalog:completeQuery")
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/v2alpha/:catalog:completeQuery') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:catalog:completeQuery";
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}}/v2alpha/:catalog:completeQuery
http GET {{baseUrl}}/v2alpha/:catalog:completeQuery
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:catalog:completeQuery
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:catalog:completeQuery")! 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
retail.projects.locations.catalogs.completionData.import
{{baseUrl}}/v2alpha/:parent/completionData:import
QUERY PARAMS
parent
BODY json
{
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
}
},
"notificationPubsubTopic": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/completionData: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 \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:parent/completionData:import" {:content-type :json
:form-params {:inputConfig {:bigQuerySource {:dataSchema ""
:datasetId ""
:gcsStagingDir ""
:partitionDate {:day 0
:month 0
:year 0}
:projectId ""
:tableId ""}}
:notificationPubsubTopic ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/completionData:import"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\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}}/v2alpha/:parent/completionData:import"),
Content = new StringContent("{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\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}}/v2alpha/:parent/completionData:import");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/completionData:import"
payload := strings.NewReader("{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\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/v2alpha/:parent/completionData:import HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 296
{
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
}
},
"notificationPubsubTopic": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:parent/completionData:import")
.setHeader("content-type", "application/json")
.setBody("{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/completionData:import"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\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 \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/completionData:import")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:parent/completionData:import")
.header("content-type", "application/json")
.body("{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\n}")
.asString();
const data = JSON.stringify({
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {
day: 0,
month: 0,
year: 0
},
projectId: '',
tableId: ''
}
},
notificationPubsubTopic: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:parent/completionData:import');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/completionData:import',
headers: {'content-type': 'application/json'},
data: {
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
}
},
notificationPubsubTopic: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/completionData:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","partitionDate":{"day":0,"month":0,"year":0},"projectId":"","tableId":""}},"notificationPubsubTopic":""}'
};
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}}/v2alpha/:parent/completionData:import',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "inputConfig": {\n "bigQuerySource": {\n "dataSchema": "",\n "datasetId": "",\n "gcsStagingDir": "",\n "partitionDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "projectId": "",\n "tableId": ""\n }\n },\n "notificationPubsubTopic": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/completionData: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/v2alpha/:parent/completionData: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({
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
}
},
notificationPubsubTopic: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/completionData:import',
headers: {'content-type': 'application/json'},
body: {
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
}
},
notificationPubsubTopic: ''
},
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}}/v2alpha/:parent/completionData:import');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {
day: 0,
month: 0,
year: 0
},
projectId: '',
tableId: ''
}
},
notificationPubsubTopic: ''
});
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}}/v2alpha/:parent/completionData:import',
headers: {'content-type': 'application/json'},
data: {
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
}
},
notificationPubsubTopic: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/completionData:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","partitionDate":{"day":0,"month":0,"year":0},"projectId":"","tableId":""}},"notificationPubsubTopic":""}'
};
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 = @{ @"inputConfig": @{ @"bigQuerySource": @{ @"dataSchema": @"", @"datasetId": @"", @"gcsStagingDir": @"", @"partitionDate": @{ @"day": @0, @"month": @0, @"year": @0 }, @"projectId": @"", @"tableId": @"" } },
@"notificationPubsubTopic": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:parent/completionData: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}}/v2alpha/:parent/completionData:import" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/completionData: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([
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'partitionDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'projectId' => '',
'tableId' => ''
]
],
'notificationPubsubTopic' => ''
]),
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}}/v2alpha/:parent/completionData:import', [
'body' => '{
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
}
},
"notificationPubsubTopic": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/completionData:import');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'partitionDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'projectId' => '',
'tableId' => ''
]
],
'notificationPubsubTopic' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'partitionDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'projectId' => '',
'tableId' => ''
]
],
'notificationPubsubTopic' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:parent/completionData: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}}/v2alpha/:parent/completionData:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
}
},
"notificationPubsubTopic": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/completionData:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
}
},
"notificationPubsubTopic": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:parent/completionData:import", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/completionData:import"
payload = {
"inputConfig": { "bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
} },
"notificationPubsubTopic": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/completionData:import"
payload <- "{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\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}}/v2alpha/:parent/completionData: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 \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\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/v2alpha/:parent/completionData:import') do |req|
req.body = "{\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n }\n },\n \"notificationPubsubTopic\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/completionData:import";
let payload = json!({
"inputConfig": json!({"bigQuerySource": json!({
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": json!({
"day": 0,
"month": 0,
"year": 0
}),
"projectId": "",
"tableId": ""
})}),
"notificationPubsubTopic": ""
});
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}}/v2alpha/:parent/completionData:import \
--header 'content-type: application/json' \
--data '{
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
}
},
"notificationPubsubTopic": ""
}'
echo '{
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
}
},
"notificationPubsubTopic": ""
}' | \
http POST {{baseUrl}}/v2alpha/:parent/completionData:import \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "inputConfig": {\n "bigQuerySource": {\n "dataSchema": "",\n "datasetId": "",\n "gcsStagingDir": "",\n "partitionDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "projectId": "",\n "tableId": ""\n }\n },\n "notificationPubsubTopic": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:parent/completionData:import
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"inputConfig": ["bigQuerySource": [
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": [
"day": 0,
"month": 0,
"year": 0
],
"projectId": "",
"tableId": ""
]],
"notificationPubsubTopic": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/completionData: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()
POST
retail.projects.locations.catalogs.controls.create
{{baseUrl}}/v2alpha/:parent/controls
QUERY PARAMS
parent
BODY json
{
"associatedServingConfigIds": [],
"displayName": "",
"facetSpec": {
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
},
"name": "",
"rule": {
"boostAction": {
"boost": "",
"productsFilter": ""
},
"condition": {
"activeTimeRange": [
{
"endTime": "",
"startTime": ""
}
],
"queryTerms": [
{
"fullMatch": false,
"value": ""
}
]
},
"doNotAssociateAction": {
"doNotAssociateTerms": [],
"queryTerms": [],
"terms": []
},
"filterAction": {
"filter": ""
},
"ignoreAction": {
"ignoreTerms": []
},
"onewaySynonymsAction": {
"onewayTerms": [],
"queryTerms": [],
"synonyms": []
},
"redirectAction": {
"redirectUri": ""
},
"replacementAction": {
"queryTerms": [],
"replacementTerm": "",
"term": ""
},
"twowaySynonymsAction": {
"synonyms": []
}
},
"searchSolutionUseCase": [],
"solutionTypes": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/controls");
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 \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:parent/controls" {:content-type :json
:form-params {:associatedServingConfigIds []
:displayName ""
:facetSpec {:enableDynamicPosition false
:excludedFilterKeys []
:facetKey {:caseInsensitive false
:contains []
:intervals [{:exclusiveMaximum ""
:exclusiveMinimum ""
:maximum ""
:minimum ""}]
:key ""
:orderBy ""
:prefixes []
:query ""
:restrictedValues []
:returnMinMax false}
:limit 0}
:name ""
:rule {:boostAction {:boost ""
:productsFilter ""}
:condition {:activeTimeRange [{:endTime ""
:startTime ""}]
:queryTerms [{:fullMatch false
:value ""}]}
:doNotAssociateAction {:doNotAssociateTerms []
:queryTerms []
:terms []}
:filterAction {:filter ""}
:ignoreAction {:ignoreTerms []}
:onewaySynonymsAction {:onewayTerms []
:queryTerms []
:synonyms []}
:redirectAction {:redirectUri ""}
:replacementAction {:queryTerms []
:replacementTerm ""
:term ""}
:twowaySynonymsAction {:synonyms []}}
:searchSolutionUseCase []
:solutionTypes []}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/controls"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\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}}/v2alpha/:parent/controls"),
Content = new StringContent("{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\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}}/v2alpha/:parent/controls");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/controls"
payload := strings.NewReader("{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\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/v2alpha/:parent/controls HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1475
{
"associatedServingConfigIds": [],
"displayName": "",
"facetSpec": {
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
},
"name": "",
"rule": {
"boostAction": {
"boost": "",
"productsFilter": ""
},
"condition": {
"activeTimeRange": [
{
"endTime": "",
"startTime": ""
}
],
"queryTerms": [
{
"fullMatch": false,
"value": ""
}
]
},
"doNotAssociateAction": {
"doNotAssociateTerms": [],
"queryTerms": [],
"terms": []
},
"filterAction": {
"filter": ""
},
"ignoreAction": {
"ignoreTerms": []
},
"onewaySynonymsAction": {
"onewayTerms": [],
"queryTerms": [],
"synonyms": []
},
"redirectAction": {
"redirectUri": ""
},
"replacementAction": {
"queryTerms": [],
"replacementTerm": "",
"term": ""
},
"twowaySynonymsAction": {
"synonyms": []
}
},
"searchSolutionUseCase": [],
"solutionTypes": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:parent/controls")
.setHeader("content-type", "application/json")
.setBody("{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/controls"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\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 \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/controls")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:parent/controls")
.header("content-type", "application/json")
.body("{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\n}")
.asString();
const data = JSON.stringify({
associatedServingConfigIds: [],
displayName: '',
facetSpec: {
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [
{
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
}
],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
},
name: '',
rule: {
boostAction: {
boost: '',
productsFilter: ''
},
condition: {
activeTimeRange: [
{
endTime: '',
startTime: ''
}
],
queryTerms: [
{
fullMatch: false,
value: ''
}
]
},
doNotAssociateAction: {
doNotAssociateTerms: [],
queryTerms: [],
terms: []
},
filterAction: {
filter: ''
},
ignoreAction: {
ignoreTerms: []
},
onewaySynonymsAction: {
onewayTerms: [],
queryTerms: [],
synonyms: []
},
redirectAction: {
redirectUri: ''
},
replacementAction: {
queryTerms: [],
replacementTerm: '',
term: ''
},
twowaySynonymsAction: {
synonyms: []
}
},
searchSolutionUseCase: [],
solutionTypes: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:parent/controls');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/controls',
headers: {'content-type': 'application/json'},
data: {
associatedServingConfigIds: [],
displayName: '',
facetSpec: {
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [{exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''}],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
},
name: '',
rule: {
boostAction: {boost: '', productsFilter: ''},
condition: {
activeTimeRange: [{endTime: '', startTime: ''}],
queryTerms: [{fullMatch: false, value: ''}]
},
doNotAssociateAction: {doNotAssociateTerms: [], queryTerms: [], terms: []},
filterAction: {filter: ''},
ignoreAction: {ignoreTerms: []},
onewaySynonymsAction: {onewayTerms: [], queryTerms: [], synonyms: []},
redirectAction: {redirectUri: ''},
replacementAction: {queryTerms: [], replacementTerm: '', term: ''},
twowaySynonymsAction: {synonyms: []}
},
searchSolutionUseCase: [],
solutionTypes: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/controls';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"associatedServingConfigIds":[],"displayName":"","facetSpec":{"enableDynamicPosition":false,"excludedFilterKeys":[],"facetKey":{"caseInsensitive":false,"contains":[],"intervals":[{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""}],"key":"","orderBy":"","prefixes":[],"query":"","restrictedValues":[],"returnMinMax":false},"limit":0},"name":"","rule":{"boostAction":{"boost":"","productsFilter":""},"condition":{"activeTimeRange":[{"endTime":"","startTime":""}],"queryTerms":[{"fullMatch":false,"value":""}]},"doNotAssociateAction":{"doNotAssociateTerms":[],"queryTerms":[],"terms":[]},"filterAction":{"filter":""},"ignoreAction":{"ignoreTerms":[]},"onewaySynonymsAction":{"onewayTerms":[],"queryTerms":[],"synonyms":[]},"redirectAction":{"redirectUri":""},"replacementAction":{"queryTerms":[],"replacementTerm":"","term":""},"twowaySynonymsAction":{"synonyms":[]}},"searchSolutionUseCase":[],"solutionTypes":[]}'
};
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}}/v2alpha/:parent/controls',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "associatedServingConfigIds": [],\n "displayName": "",\n "facetSpec": {\n "enableDynamicPosition": false,\n "excludedFilterKeys": [],\n "facetKey": {\n "caseInsensitive": false,\n "contains": [],\n "intervals": [\n {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n }\n ],\n "key": "",\n "orderBy": "",\n "prefixes": [],\n "query": "",\n "restrictedValues": [],\n "returnMinMax": false\n },\n "limit": 0\n },\n "name": "",\n "rule": {\n "boostAction": {\n "boost": "",\n "productsFilter": ""\n },\n "condition": {\n "activeTimeRange": [\n {\n "endTime": "",\n "startTime": ""\n }\n ],\n "queryTerms": [\n {\n "fullMatch": false,\n "value": ""\n }\n ]\n },\n "doNotAssociateAction": {\n "doNotAssociateTerms": [],\n "queryTerms": [],\n "terms": []\n },\n "filterAction": {\n "filter": ""\n },\n "ignoreAction": {\n "ignoreTerms": []\n },\n "onewaySynonymsAction": {\n "onewayTerms": [],\n "queryTerms": [],\n "synonyms": []\n },\n "redirectAction": {\n "redirectUri": ""\n },\n "replacementAction": {\n "queryTerms": [],\n "replacementTerm": "",\n "term": ""\n },\n "twowaySynonymsAction": {\n "synonyms": []\n }\n },\n "searchSolutionUseCase": [],\n "solutionTypes": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/controls")
.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/v2alpha/:parent/controls',
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({
associatedServingConfigIds: [],
displayName: '',
facetSpec: {
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [{exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''}],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
},
name: '',
rule: {
boostAction: {boost: '', productsFilter: ''},
condition: {
activeTimeRange: [{endTime: '', startTime: ''}],
queryTerms: [{fullMatch: false, value: ''}]
},
doNotAssociateAction: {doNotAssociateTerms: [], queryTerms: [], terms: []},
filterAction: {filter: ''},
ignoreAction: {ignoreTerms: []},
onewaySynonymsAction: {onewayTerms: [], queryTerms: [], synonyms: []},
redirectAction: {redirectUri: ''},
replacementAction: {queryTerms: [], replacementTerm: '', term: ''},
twowaySynonymsAction: {synonyms: []}
},
searchSolutionUseCase: [],
solutionTypes: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/controls',
headers: {'content-type': 'application/json'},
body: {
associatedServingConfigIds: [],
displayName: '',
facetSpec: {
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [{exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''}],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
},
name: '',
rule: {
boostAction: {boost: '', productsFilter: ''},
condition: {
activeTimeRange: [{endTime: '', startTime: ''}],
queryTerms: [{fullMatch: false, value: ''}]
},
doNotAssociateAction: {doNotAssociateTerms: [], queryTerms: [], terms: []},
filterAction: {filter: ''},
ignoreAction: {ignoreTerms: []},
onewaySynonymsAction: {onewayTerms: [], queryTerms: [], synonyms: []},
redirectAction: {redirectUri: ''},
replacementAction: {queryTerms: [], replacementTerm: '', term: ''},
twowaySynonymsAction: {synonyms: []}
},
searchSolutionUseCase: [],
solutionTypes: []
},
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}}/v2alpha/:parent/controls');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
associatedServingConfigIds: [],
displayName: '',
facetSpec: {
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [
{
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
}
],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
},
name: '',
rule: {
boostAction: {
boost: '',
productsFilter: ''
},
condition: {
activeTimeRange: [
{
endTime: '',
startTime: ''
}
],
queryTerms: [
{
fullMatch: false,
value: ''
}
]
},
doNotAssociateAction: {
doNotAssociateTerms: [],
queryTerms: [],
terms: []
},
filterAction: {
filter: ''
},
ignoreAction: {
ignoreTerms: []
},
onewaySynonymsAction: {
onewayTerms: [],
queryTerms: [],
synonyms: []
},
redirectAction: {
redirectUri: ''
},
replacementAction: {
queryTerms: [],
replacementTerm: '',
term: ''
},
twowaySynonymsAction: {
synonyms: []
}
},
searchSolutionUseCase: [],
solutionTypes: []
});
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}}/v2alpha/:parent/controls',
headers: {'content-type': 'application/json'},
data: {
associatedServingConfigIds: [],
displayName: '',
facetSpec: {
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [{exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''}],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
},
name: '',
rule: {
boostAction: {boost: '', productsFilter: ''},
condition: {
activeTimeRange: [{endTime: '', startTime: ''}],
queryTerms: [{fullMatch: false, value: ''}]
},
doNotAssociateAction: {doNotAssociateTerms: [], queryTerms: [], terms: []},
filterAction: {filter: ''},
ignoreAction: {ignoreTerms: []},
onewaySynonymsAction: {onewayTerms: [], queryTerms: [], synonyms: []},
redirectAction: {redirectUri: ''},
replacementAction: {queryTerms: [], replacementTerm: '', term: ''},
twowaySynonymsAction: {synonyms: []}
},
searchSolutionUseCase: [],
solutionTypes: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/controls';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"associatedServingConfigIds":[],"displayName":"","facetSpec":{"enableDynamicPosition":false,"excludedFilterKeys":[],"facetKey":{"caseInsensitive":false,"contains":[],"intervals":[{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""}],"key":"","orderBy":"","prefixes":[],"query":"","restrictedValues":[],"returnMinMax":false},"limit":0},"name":"","rule":{"boostAction":{"boost":"","productsFilter":""},"condition":{"activeTimeRange":[{"endTime":"","startTime":""}],"queryTerms":[{"fullMatch":false,"value":""}]},"doNotAssociateAction":{"doNotAssociateTerms":[],"queryTerms":[],"terms":[]},"filterAction":{"filter":""},"ignoreAction":{"ignoreTerms":[]},"onewaySynonymsAction":{"onewayTerms":[],"queryTerms":[],"synonyms":[]},"redirectAction":{"redirectUri":""},"replacementAction":{"queryTerms":[],"replacementTerm":"","term":""},"twowaySynonymsAction":{"synonyms":[]}},"searchSolutionUseCase":[],"solutionTypes":[]}'
};
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 = @{ @"associatedServingConfigIds": @[ ],
@"displayName": @"",
@"facetSpec": @{ @"enableDynamicPosition": @NO, @"excludedFilterKeys": @[ ], @"facetKey": @{ @"caseInsensitive": @NO, @"contains": @[ ], @"intervals": @[ @{ @"exclusiveMaximum": @"", @"exclusiveMinimum": @"", @"maximum": @"", @"minimum": @"" } ], @"key": @"", @"orderBy": @"", @"prefixes": @[ ], @"query": @"", @"restrictedValues": @[ ], @"returnMinMax": @NO }, @"limit": @0 },
@"name": @"",
@"rule": @{ @"boostAction": @{ @"boost": @"", @"productsFilter": @"" }, @"condition": @{ @"activeTimeRange": @[ @{ @"endTime": @"", @"startTime": @"" } ], @"queryTerms": @[ @{ @"fullMatch": @NO, @"value": @"" } ] }, @"doNotAssociateAction": @{ @"doNotAssociateTerms": @[ ], @"queryTerms": @[ ], @"terms": @[ ] }, @"filterAction": @{ @"filter": @"" }, @"ignoreAction": @{ @"ignoreTerms": @[ ] }, @"onewaySynonymsAction": @{ @"onewayTerms": @[ ], @"queryTerms": @[ ], @"synonyms": @[ ] }, @"redirectAction": @{ @"redirectUri": @"" }, @"replacementAction": @{ @"queryTerms": @[ ], @"replacementTerm": @"", @"term": @"" }, @"twowaySynonymsAction": @{ @"synonyms": @[ ] } },
@"searchSolutionUseCase": @[ ],
@"solutionTypes": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:parent/controls"]
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}}/v2alpha/:parent/controls" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/controls",
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([
'associatedServingConfigIds' => [
],
'displayName' => '',
'facetSpec' => [
'enableDynamicPosition' => null,
'excludedFilterKeys' => [
],
'facetKey' => [
'caseInsensitive' => null,
'contains' => [
],
'intervals' => [
[
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
]
],
'key' => '',
'orderBy' => '',
'prefixes' => [
],
'query' => '',
'restrictedValues' => [
],
'returnMinMax' => null
],
'limit' => 0
],
'name' => '',
'rule' => [
'boostAction' => [
'boost' => '',
'productsFilter' => ''
],
'condition' => [
'activeTimeRange' => [
[
'endTime' => '',
'startTime' => ''
]
],
'queryTerms' => [
[
'fullMatch' => null,
'value' => ''
]
]
],
'doNotAssociateAction' => [
'doNotAssociateTerms' => [
],
'queryTerms' => [
],
'terms' => [
]
],
'filterAction' => [
'filter' => ''
],
'ignoreAction' => [
'ignoreTerms' => [
]
],
'onewaySynonymsAction' => [
'onewayTerms' => [
],
'queryTerms' => [
],
'synonyms' => [
]
],
'redirectAction' => [
'redirectUri' => ''
],
'replacementAction' => [
'queryTerms' => [
],
'replacementTerm' => '',
'term' => ''
],
'twowaySynonymsAction' => [
'synonyms' => [
]
]
],
'searchSolutionUseCase' => [
],
'solutionTypes' => [
]
]),
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}}/v2alpha/:parent/controls', [
'body' => '{
"associatedServingConfigIds": [],
"displayName": "",
"facetSpec": {
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
},
"name": "",
"rule": {
"boostAction": {
"boost": "",
"productsFilter": ""
},
"condition": {
"activeTimeRange": [
{
"endTime": "",
"startTime": ""
}
],
"queryTerms": [
{
"fullMatch": false,
"value": ""
}
]
},
"doNotAssociateAction": {
"doNotAssociateTerms": [],
"queryTerms": [],
"terms": []
},
"filterAction": {
"filter": ""
},
"ignoreAction": {
"ignoreTerms": []
},
"onewaySynonymsAction": {
"onewayTerms": [],
"queryTerms": [],
"synonyms": []
},
"redirectAction": {
"redirectUri": ""
},
"replacementAction": {
"queryTerms": [],
"replacementTerm": "",
"term": ""
},
"twowaySynonymsAction": {
"synonyms": []
}
},
"searchSolutionUseCase": [],
"solutionTypes": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/controls');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'associatedServingConfigIds' => [
],
'displayName' => '',
'facetSpec' => [
'enableDynamicPosition' => null,
'excludedFilterKeys' => [
],
'facetKey' => [
'caseInsensitive' => null,
'contains' => [
],
'intervals' => [
[
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
]
],
'key' => '',
'orderBy' => '',
'prefixes' => [
],
'query' => '',
'restrictedValues' => [
],
'returnMinMax' => null
],
'limit' => 0
],
'name' => '',
'rule' => [
'boostAction' => [
'boost' => '',
'productsFilter' => ''
],
'condition' => [
'activeTimeRange' => [
[
'endTime' => '',
'startTime' => ''
]
],
'queryTerms' => [
[
'fullMatch' => null,
'value' => ''
]
]
],
'doNotAssociateAction' => [
'doNotAssociateTerms' => [
],
'queryTerms' => [
],
'terms' => [
]
],
'filterAction' => [
'filter' => ''
],
'ignoreAction' => [
'ignoreTerms' => [
]
],
'onewaySynonymsAction' => [
'onewayTerms' => [
],
'queryTerms' => [
],
'synonyms' => [
]
],
'redirectAction' => [
'redirectUri' => ''
],
'replacementAction' => [
'queryTerms' => [
],
'replacementTerm' => '',
'term' => ''
],
'twowaySynonymsAction' => [
'synonyms' => [
]
]
],
'searchSolutionUseCase' => [
],
'solutionTypes' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'associatedServingConfigIds' => [
],
'displayName' => '',
'facetSpec' => [
'enableDynamicPosition' => null,
'excludedFilterKeys' => [
],
'facetKey' => [
'caseInsensitive' => null,
'contains' => [
],
'intervals' => [
[
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
]
],
'key' => '',
'orderBy' => '',
'prefixes' => [
],
'query' => '',
'restrictedValues' => [
],
'returnMinMax' => null
],
'limit' => 0
],
'name' => '',
'rule' => [
'boostAction' => [
'boost' => '',
'productsFilter' => ''
],
'condition' => [
'activeTimeRange' => [
[
'endTime' => '',
'startTime' => ''
]
],
'queryTerms' => [
[
'fullMatch' => null,
'value' => ''
]
]
],
'doNotAssociateAction' => [
'doNotAssociateTerms' => [
],
'queryTerms' => [
],
'terms' => [
]
],
'filterAction' => [
'filter' => ''
],
'ignoreAction' => [
'ignoreTerms' => [
]
],
'onewaySynonymsAction' => [
'onewayTerms' => [
],
'queryTerms' => [
],
'synonyms' => [
]
],
'redirectAction' => [
'redirectUri' => ''
],
'replacementAction' => [
'queryTerms' => [
],
'replacementTerm' => '',
'term' => ''
],
'twowaySynonymsAction' => [
'synonyms' => [
]
]
],
'searchSolutionUseCase' => [
],
'solutionTypes' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:parent/controls');
$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}}/v2alpha/:parent/controls' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"associatedServingConfigIds": [],
"displayName": "",
"facetSpec": {
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
},
"name": "",
"rule": {
"boostAction": {
"boost": "",
"productsFilter": ""
},
"condition": {
"activeTimeRange": [
{
"endTime": "",
"startTime": ""
}
],
"queryTerms": [
{
"fullMatch": false,
"value": ""
}
]
},
"doNotAssociateAction": {
"doNotAssociateTerms": [],
"queryTerms": [],
"terms": []
},
"filterAction": {
"filter": ""
},
"ignoreAction": {
"ignoreTerms": []
},
"onewaySynonymsAction": {
"onewayTerms": [],
"queryTerms": [],
"synonyms": []
},
"redirectAction": {
"redirectUri": ""
},
"replacementAction": {
"queryTerms": [],
"replacementTerm": "",
"term": ""
},
"twowaySynonymsAction": {
"synonyms": []
}
},
"searchSolutionUseCase": [],
"solutionTypes": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/controls' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"associatedServingConfigIds": [],
"displayName": "",
"facetSpec": {
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
},
"name": "",
"rule": {
"boostAction": {
"boost": "",
"productsFilter": ""
},
"condition": {
"activeTimeRange": [
{
"endTime": "",
"startTime": ""
}
],
"queryTerms": [
{
"fullMatch": false,
"value": ""
}
]
},
"doNotAssociateAction": {
"doNotAssociateTerms": [],
"queryTerms": [],
"terms": []
},
"filterAction": {
"filter": ""
},
"ignoreAction": {
"ignoreTerms": []
},
"onewaySynonymsAction": {
"onewayTerms": [],
"queryTerms": [],
"synonyms": []
},
"redirectAction": {
"redirectUri": ""
},
"replacementAction": {
"queryTerms": [],
"replacementTerm": "",
"term": ""
},
"twowaySynonymsAction": {
"synonyms": []
}
},
"searchSolutionUseCase": [],
"solutionTypes": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:parent/controls", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/controls"
payload = {
"associatedServingConfigIds": [],
"displayName": "",
"facetSpec": {
"enableDynamicPosition": False,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": False,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": False
},
"limit": 0
},
"name": "",
"rule": {
"boostAction": {
"boost": "",
"productsFilter": ""
},
"condition": {
"activeTimeRange": [
{
"endTime": "",
"startTime": ""
}
],
"queryTerms": [
{
"fullMatch": False,
"value": ""
}
]
},
"doNotAssociateAction": {
"doNotAssociateTerms": [],
"queryTerms": [],
"terms": []
},
"filterAction": { "filter": "" },
"ignoreAction": { "ignoreTerms": [] },
"onewaySynonymsAction": {
"onewayTerms": [],
"queryTerms": [],
"synonyms": []
},
"redirectAction": { "redirectUri": "" },
"replacementAction": {
"queryTerms": [],
"replacementTerm": "",
"term": ""
},
"twowaySynonymsAction": { "synonyms": [] }
},
"searchSolutionUseCase": [],
"solutionTypes": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/controls"
payload <- "{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\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}}/v2alpha/:parent/controls")
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 \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\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/v2alpha/:parent/controls') do |req|
req.body = "{\n \"associatedServingConfigIds\": [],\n \"displayName\": \"\",\n \"facetSpec\": {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n },\n \"name\": \"\",\n \"rule\": {\n \"boostAction\": {\n \"boost\": \"\",\n \"productsFilter\": \"\"\n },\n \"condition\": {\n \"activeTimeRange\": [\n {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n ],\n \"queryTerms\": [\n {\n \"fullMatch\": false,\n \"value\": \"\"\n }\n ]\n },\n \"doNotAssociateAction\": {\n \"doNotAssociateTerms\": [],\n \"queryTerms\": [],\n \"terms\": []\n },\n \"filterAction\": {\n \"filter\": \"\"\n },\n \"ignoreAction\": {\n \"ignoreTerms\": []\n },\n \"onewaySynonymsAction\": {\n \"onewayTerms\": [],\n \"queryTerms\": [],\n \"synonyms\": []\n },\n \"redirectAction\": {\n \"redirectUri\": \"\"\n },\n \"replacementAction\": {\n \"queryTerms\": [],\n \"replacementTerm\": \"\",\n \"term\": \"\"\n },\n \"twowaySynonymsAction\": {\n \"synonyms\": []\n }\n },\n \"searchSolutionUseCase\": [],\n \"solutionTypes\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/controls";
let payload = json!({
"associatedServingConfigIds": (),
"displayName": "",
"facetSpec": json!({
"enableDynamicPosition": false,
"excludedFilterKeys": (),
"facetKey": json!({
"caseInsensitive": false,
"contains": (),
"intervals": (
json!({
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
})
),
"key": "",
"orderBy": "",
"prefixes": (),
"query": "",
"restrictedValues": (),
"returnMinMax": false
}),
"limit": 0
}),
"name": "",
"rule": json!({
"boostAction": json!({
"boost": "",
"productsFilter": ""
}),
"condition": json!({
"activeTimeRange": (
json!({
"endTime": "",
"startTime": ""
})
),
"queryTerms": (
json!({
"fullMatch": false,
"value": ""
})
)
}),
"doNotAssociateAction": json!({
"doNotAssociateTerms": (),
"queryTerms": (),
"terms": ()
}),
"filterAction": json!({"filter": ""}),
"ignoreAction": json!({"ignoreTerms": ()}),
"onewaySynonymsAction": json!({
"onewayTerms": (),
"queryTerms": (),
"synonyms": ()
}),
"redirectAction": json!({"redirectUri": ""}),
"replacementAction": json!({
"queryTerms": (),
"replacementTerm": "",
"term": ""
}),
"twowaySynonymsAction": json!({"synonyms": ()})
}),
"searchSolutionUseCase": (),
"solutionTypes": ()
});
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}}/v2alpha/:parent/controls \
--header 'content-type: application/json' \
--data '{
"associatedServingConfigIds": [],
"displayName": "",
"facetSpec": {
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
},
"name": "",
"rule": {
"boostAction": {
"boost": "",
"productsFilter": ""
},
"condition": {
"activeTimeRange": [
{
"endTime": "",
"startTime": ""
}
],
"queryTerms": [
{
"fullMatch": false,
"value": ""
}
]
},
"doNotAssociateAction": {
"doNotAssociateTerms": [],
"queryTerms": [],
"terms": []
},
"filterAction": {
"filter": ""
},
"ignoreAction": {
"ignoreTerms": []
},
"onewaySynonymsAction": {
"onewayTerms": [],
"queryTerms": [],
"synonyms": []
},
"redirectAction": {
"redirectUri": ""
},
"replacementAction": {
"queryTerms": [],
"replacementTerm": "",
"term": ""
},
"twowaySynonymsAction": {
"synonyms": []
}
},
"searchSolutionUseCase": [],
"solutionTypes": []
}'
echo '{
"associatedServingConfigIds": [],
"displayName": "",
"facetSpec": {
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
},
"name": "",
"rule": {
"boostAction": {
"boost": "",
"productsFilter": ""
},
"condition": {
"activeTimeRange": [
{
"endTime": "",
"startTime": ""
}
],
"queryTerms": [
{
"fullMatch": false,
"value": ""
}
]
},
"doNotAssociateAction": {
"doNotAssociateTerms": [],
"queryTerms": [],
"terms": []
},
"filterAction": {
"filter": ""
},
"ignoreAction": {
"ignoreTerms": []
},
"onewaySynonymsAction": {
"onewayTerms": [],
"queryTerms": [],
"synonyms": []
},
"redirectAction": {
"redirectUri": ""
},
"replacementAction": {
"queryTerms": [],
"replacementTerm": "",
"term": ""
},
"twowaySynonymsAction": {
"synonyms": []
}
},
"searchSolutionUseCase": [],
"solutionTypes": []
}' | \
http POST {{baseUrl}}/v2alpha/:parent/controls \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "associatedServingConfigIds": [],\n "displayName": "",\n "facetSpec": {\n "enableDynamicPosition": false,\n "excludedFilterKeys": [],\n "facetKey": {\n "caseInsensitive": false,\n "contains": [],\n "intervals": [\n {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n }\n ],\n "key": "",\n "orderBy": "",\n "prefixes": [],\n "query": "",\n "restrictedValues": [],\n "returnMinMax": false\n },\n "limit": 0\n },\n "name": "",\n "rule": {\n "boostAction": {\n "boost": "",\n "productsFilter": ""\n },\n "condition": {\n "activeTimeRange": [\n {\n "endTime": "",\n "startTime": ""\n }\n ],\n "queryTerms": [\n {\n "fullMatch": false,\n "value": ""\n }\n ]\n },\n "doNotAssociateAction": {\n "doNotAssociateTerms": [],\n "queryTerms": [],\n "terms": []\n },\n "filterAction": {\n "filter": ""\n },\n "ignoreAction": {\n "ignoreTerms": []\n },\n "onewaySynonymsAction": {\n "onewayTerms": [],\n "queryTerms": [],\n "synonyms": []\n },\n "redirectAction": {\n "redirectUri": ""\n },\n "replacementAction": {\n "queryTerms": [],\n "replacementTerm": "",\n "term": ""\n },\n "twowaySynonymsAction": {\n "synonyms": []\n }\n },\n "searchSolutionUseCase": [],\n "solutionTypes": []\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:parent/controls
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"associatedServingConfigIds": [],
"displayName": "",
"facetSpec": [
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": [
"caseInsensitive": false,
"contains": [],
"intervals": [
[
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
]
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
],
"limit": 0
],
"name": "",
"rule": [
"boostAction": [
"boost": "",
"productsFilter": ""
],
"condition": [
"activeTimeRange": [
[
"endTime": "",
"startTime": ""
]
],
"queryTerms": [
[
"fullMatch": false,
"value": ""
]
]
],
"doNotAssociateAction": [
"doNotAssociateTerms": [],
"queryTerms": [],
"terms": []
],
"filterAction": ["filter": ""],
"ignoreAction": ["ignoreTerms": []],
"onewaySynonymsAction": [
"onewayTerms": [],
"queryTerms": [],
"synonyms": []
],
"redirectAction": ["redirectUri": ""],
"replacementAction": [
"queryTerms": [],
"replacementTerm": "",
"term": ""
],
"twowaySynonymsAction": ["synonyms": []]
],
"searchSolutionUseCase": [],
"solutionTypes": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/controls")! 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
retail.projects.locations.catalogs.controls.list
{{baseUrl}}/v2alpha/:parent/controls
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/controls");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:parent/controls")
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/controls"
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}}/v2alpha/:parent/controls"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:parent/controls");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/controls"
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/v2alpha/:parent/controls HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:parent/controls")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/controls"))
.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}}/v2alpha/:parent/controls")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/:parent/controls")
.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}}/v2alpha/:parent/controls');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2alpha/:parent/controls'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/controls';
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}}/v2alpha/:parent/controls',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/controls")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2alpha/:parent/controls',
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}}/v2alpha/:parent/controls'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2alpha/:parent/controls');
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}}/v2alpha/:parent/controls'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/controls';
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}}/v2alpha/:parent/controls"]
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}}/v2alpha/:parent/controls" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/controls",
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}}/v2alpha/:parent/controls');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/controls');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:parent/controls');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:parent/controls' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/controls' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:parent/controls")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/controls"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/controls"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/:parent/controls")
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/v2alpha/:parent/controls') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/controls";
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}}/v2alpha/:parent/controls
http GET {{baseUrl}}/v2alpha/:parent/controls
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:parent/controls
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/controls")! 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
retail.projects.locations.catalogs.getDefaultBranch
{{baseUrl}}/v2alpha/:catalog:getDefaultBranch
QUERY PARAMS
catalog
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:catalog:getDefaultBranch");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:catalog:getDefaultBranch")
require "http/client"
url = "{{baseUrl}}/v2alpha/:catalog:getDefaultBranch"
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}}/v2alpha/:catalog:getDefaultBranch"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:catalog:getDefaultBranch");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:catalog:getDefaultBranch"
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/v2alpha/:catalog:getDefaultBranch HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:catalog:getDefaultBranch")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:catalog:getDefaultBranch"))
.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}}/v2alpha/:catalog:getDefaultBranch")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/:catalog:getDefaultBranch")
.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}}/v2alpha/:catalog:getDefaultBranch');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v2alpha/:catalog:getDefaultBranch'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:catalog:getDefaultBranch';
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}}/v2alpha/:catalog:getDefaultBranch',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:catalog:getDefaultBranch")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2alpha/:catalog:getDefaultBranch',
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}}/v2alpha/:catalog:getDefaultBranch'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2alpha/:catalog:getDefaultBranch');
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}}/v2alpha/:catalog:getDefaultBranch'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:catalog:getDefaultBranch';
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}}/v2alpha/:catalog:getDefaultBranch"]
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}}/v2alpha/:catalog:getDefaultBranch" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:catalog:getDefaultBranch",
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}}/v2alpha/:catalog:getDefaultBranch');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:catalog:getDefaultBranch');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:catalog:getDefaultBranch');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:catalog:getDefaultBranch' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:catalog:getDefaultBranch' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:catalog:getDefaultBranch")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:catalog:getDefaultBranch"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:catalog:getDefaultBranch"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/:catalog:getDefaultBranch")
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/v2alpha/:catalog:getDefaultBranch') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:catalog:getDefaultBranch";
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}}/v2alpha/:catalog:getDefaultBranch
http GET {{baseUrl}}/v2alpha/:catalog:getDefaultBranch
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:catalog:getDefaultBranch
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:catalog:getDefaultBranch")! 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
retail.projects.locations.catalogs.list
{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/catalogs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:parent/catalogs")
require "http/client"
url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/catalogs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/: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/v2alpha/:parent/catalogs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:parent/catalogs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/catalogs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/catalogs');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2alpha/:parent/catalogs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/catalogs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/catalogs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/catalogs');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/catalogs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:parent/catalogs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:parent/catalogs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/catalogs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:parent/catalogs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/catalogs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/catalogs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/: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/v2alpha/:parent/catalogs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/catalogs
http GET {{baseUrl}}/v2alpha/:parent/catalogs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:parent/catalogs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/: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()
POST
retail.projects.locations.catalogs.merchantCenterAccountLinks.createMerchantCenterAccountLink
{{baseUrl}}/v2alpha/:name
QUERY PARAMS
name
BODY json
{
"branchId": "",
"feedFilters": [
{
"primaryFeedId": "",
"primaryFeedName": ""
}
],
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/: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 \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:name" {:content-type :json
:form-params {:branchId ""
:feedFilters [{:primaryFeedId ""
:primaryFeedName ""}]
:feedLabel ""
:id ""
:languageCode ""
:merchantCenterAccountId ""
:name ""
:projectId ""
:state ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:name"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\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}}/v2alpha/:name"),
Content = new StringContent("{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\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}}/v2alpha/:name");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:name"
payload := strings.NewReader("{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\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/v2alpha/:name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 245
{
"branchId": "",
"feedFilters": [
{
"primaryFeedId": "",
"primaryFeedName": ""
}
],
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:name")
.setHeader("content-type", "application/json")
.setBody("{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:name"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\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 \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:name")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:name")
.header("content-type", "application/json")
.body("{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\n}")
.asString();
const data = JSON.stringify({
branchId: '',
feedFilters: [
{
primaryFeedId: '',
primaryFeedName: ''
}
],
feedLabel: '',
id: '',
languageCode: '',
merchantCenterAccountId: '',
name: '',
projectId: '',
state: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:name');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name',
headers: {'content-type': 'application/json'},
data: {
branchId: '',
feedFilters: [{primaryFeedId: '', primaryFeedName: ''}],
feedLabel: '',
id: '',
languageCode: '',
merchantCenterAccountId: '',
name: '',
projectId: '',
state: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:name';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"branchId":"","feedFilters":[{"primaryFeedId":"","primaryFeedName":""}],"feedLabel":"","id":"","languageCode":"","merchantCenterAccountId":"","name":"","projectId":"","state":""}'
};
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}}/v2alpha/:name',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "branchId": "",\n "feedFilters": [\n {\n "primaryFeedId": "",\n "primaryFeedName": ""\n }\n ],\n "feedLabel": "",\n "id": "",\n "languageCode": "",\n "merchantCenterAccountId": "",\n "name": "",\n "projectId": "",\n "state": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:name")
.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/v2alpha/: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({
branchId: '',
feedFilters: [{primaryFeedId: '', primaryFeedName: ''}],
feedLabel: '',
id: '',
languageCode: '',
merchantCenterAccountId: '',
name: '',
projectId: '',
state: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name',
headers: {'content-type': 'application/json'},
body: {
branchId: '',
feedFilters: [{primaryFeedId: '', primaryFeedName: ''}],
feedLabel: '',
id: '',
languageCode: '',
merchantCenterAccountId: '',
name: '',
projectId: '',
state: ''
},
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}}/v2alpha/:name');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
branchId: '',
feedFilters: [
{
primaryFeedId: '',
primaryFeedName: ''
}
],
feedLabel: '',
id: '',
languageCode: '',
merchantCenterAccountId: '',
name: '',
projectId: '',
state: ''
});
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}}/v2alpha/:name',
headers: {'content-type': 'application/json'},
data: {
branchId: '',
feedFilters: [{primaryFeedId: '', primaryFeedName: ''}],
feedLabel: '',
id: '',
languageCode: '',
merchantCenterAccountId: '',
name: '',
projectId: '',
state: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:name';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"branchId":"","feedFilters":[{"primaryFeedId":"","primaryFeedName":""}],"feedLabel":"","id":"","languageCode":"","merchantCenterAccountId":"","name":"","projectId":"","state":""}'
};
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 = @{ @"branchId": @"",
@"feedFilters": @[ @{ @"primaryFeedId": @"", @"primaryFeedName": @"" } ],
@"feedLabel": @"",
@"id": @"",
@"languageCode": @"",
@"merchantCenterAccountId": @"",
@"name": @"",
@"projectId": @"",
@"state": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:name"]
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}}/v2alpha/:name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:name",
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([
'branchId' => '',
'feedFilters' => [
[
'primaryFeedId' => '',
'primaryFeedName' => ''
]
],
'feedLabel' => '',
'id' => '',
'languageCode' => '',
'merchantCenterAccountId' => '',
'name' => '',
'projectId' => '',
'state' => ''
]),
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}}/v2alpha/:name', [
'body' => '{
"branchId": "",
"feedFilters": [
{
"primaryFeedId": "",
"primaryFeedName": ""
}
],
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:name');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'branchId' => '',
'feedFilters' => [
[
'primaryFeedId' => '',
'primaryFeedName' => ''
]
],
'feedLabel' => '',
'id' => '',
'languageCode' => '',
'merchantCenterAccountId' => '',
'name' => '',
'projectId' => '',
'state' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'branchId' => '',
'feedFilters' => [
[
'primaryFeedId' => '',
'primaryFeedName' => ''
]
],
'feedLabel' => '',
'id' => '',
'languageCode' => '',
'merchantCenterAccountId' => '',
'name' => '',
'projectId' => '',
'state' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:name');
$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}}/v2alpha/:name' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"branchId": "",
"feedFilters": [
{
"primaryFeedId": "",
"primaryFeedName": ""
}
],
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:name' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"branchId": "",
"feedFilters": [
{
"primaryFeedId": "",
"primaryFeedName": ""
}
],
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:name"
payload = {
"branchId": "",
"feedFilters": [
{
"primaryFeedId": "",
"primaryFeedName": ""
}
],
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:name"
payload <- "{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\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}}/v2alpha/:name")
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 \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\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/v2alpha/:name') do |req|
req.body = "{\n \"branchId\": \"\",\n \"feedFilters\": [\n {\n \"primaryFeedId\": \"\",\n \"primaryFeedName\": \"\"\n }\n ],\n \"feedLabel\": \"\",\n \"id\": \"\",\n \"languageCode\": \"\",\n \"merchantCenterAccountId\": \"\",\n \"name\": \"\",\n \"projectId\": \"\",\n \"state\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:name";
let payload = json!({
"branchId": "",
"feedFilters": (
json!({
"primaryFeedId": "",
"primaryFeedName": ""
})
),
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
});
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}}/v2alpha/:name \
--header 'content-type: application/json' \
--data '{
"branchId": "",
"feedFilters": [
{
"primaryFeedId": "",
"primaryFeedName": ""
}
],
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
}'
echo '{
"branchId": "",
"feedFilters": [
{
"primaryFeedId": "",
"primaryFeedName": ""
}
],
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
}' | \
http POST {{baseUrl}}/v2alpha/:name \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "branchId": "",\n "feedFilters": [\n {\n "primaryFeedId": "",\n "primaryFeedName": ""\n }\n ],\n "feedLabel": "",\n "id": "",\n "languageCode": "",\n "merchantCenterAccountId": "",\n "name": "",\n "projectId": "",\n "state": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:name
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"branchId": "",
"feedFilters": [
[
"primaryFeedId": "",
"primaryFeedName": ""
]
],
"feedLabel": "",
"id": "",
"languageCode": "",
"merchantCenterAccountId": "",
"name": "",
"projectId": "",
"state": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:name")! 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
retail.projects.locations.catalogs.merchantCenterAccountLinks.list
{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks")
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks"
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}}/v2alpha/:parent/merchantCenterAccountLinks"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks"
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/v2alpha/:parent/merchantCenterAccountLinks HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks"))
.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}}/v2alpha/:parent/merchantCenterAccountLinks")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks")
.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}}/v2alpha/:parent/merchantCenterAccountLinks');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks';
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}}/v2alpha/:parent/merchantCenterAccountLinks',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2alpha/:parent/merchantCenterAccountLinks',
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}}/v2alpha/:parent/merchantCenterAccountLinks'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks');
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}}/v2alpha/:parent/merchantCenterAccountLinks'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks';
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}}/v2alpha/:parent/merchantCenterAccountLinks"]
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}}/v2alpha/:parent/merchantCenterAccountLinks" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks",
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}}/v2alpha/:parent/merchantCenterAccountLinks');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:parent/merchantCenterAccountLinks")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks")
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/v2alpha/:parent/merchantCenterAccountLinks') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks";
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}}/v2alpha/:parent/merchantCenterAccountLinks
http GET {{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/merchantCenterAccountLinks")! 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
retail.projects.locations.catalogs.models.create
{{baseUrl}}/v2alpha/:parent/models
QUERY PARAMS
parent
BODY json
{
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": {
"pageOptimizationEventType": "",
"panels": [
{
"candidates": [
{
"servingConfigId": ""
}
],
"defaultCandidate": {},
"displayName": ""
}
],
"restriction": ""
},
"periodicTuningState": "",
"servingConfigLists": [
{
"servingConfigIds": []
}
],
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/models");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:parent/models" {:content-type :json
:form-params {:createTime ""
:dataState ""
:displayName ""
:filteringOption ""
:lastTuneTime ""
:name ""
:optimizationObjective ""
:pageOptimizationConfig {:pageOptimizationEventType ""
:panels [{:candidates [{:servingConfigId ""}]
:defaultCandidate {}
:displayName ""}]
:restriction ""}
:periodicTuningState ""
:servingConfigLists [{:servingConfigIds []}]
:servingState ""
:trainingState ""
:tuningOperation ""
:type ""
:updateTime ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/models"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v2alpha/:parent/models"),
Content = new StringContent("{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:parent/models");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/models"
payload := strings.NewReader("{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v2alpha/:parent/models HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 643
{
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": {
"pageOptimizationEventType": "",
"panels": [
{
"candidates": [
{
"servingConfigId": ""
}
],
"defaultCandidate": {},
"displayName": ""
}
],
"restriction": ""
},
"periodicTuningState": "",
"servingConfigLists": [
{
"servingConfigIds": []
}
],
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:parent/models")
.setHeader("content-type", "application/json")
.setBody("{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/models"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/models")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:parent/models")
.header("content-type", "application/json")
.body("{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
createTime: '',
dataState: '',
displayName: '',
filteringOption: '',
lastTuneTime: '',
name: '',
optimizationObjective: '',
pageOptimizationConfig: {
pageOptimizationEventType: '',
panels: [
{
candidates: [
{
servingConfigId: ''
}
],
defaultCandidate: {},
displayName: ''
}
],
restriction: ''
},
periodicTuningState: '',
servingConfigLists: [
{
servingConfigIds: []
}
],
servingState: '',
trainingState: '',
tuningOperation: '',
type: '',
updateTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:parent/models');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/models',
headers: {'content-type': 'application/json'},
data: {
createTime: '',
dataState: '',
displayName: '',
filteringOption: '',
lastTuneTime: '',
name: '',
optimizationObjective: '',
pageOptimizationConfig: {
pageOptimizationEventType: '',
panels: [{candidates: [{servingConfigId: ''}], defaultCandidate: {}, displayName: ''}],
restriction: ''
},
periodicTuningState: '',
servingConfigLists: [{servingConfigIds: []}],
servingState: '',
trainingState: '',
tuningOperation: '',
type: '',
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/models';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","dataState":"","displayName":"","filteringOption":"","lastTuneTime":"","name":"","optimizationObjective":"","pageOptimizationConfig":{"pageOptimizationEventType":"","panels":[{"candidates":[{"servingConfigId":""}],"defaultCandidate":{},"displayName":""}],"restriction":""},"periodicTuningState":"","servingConfigLists":[{"servingConfigIds":[]}],"servingState":"","trainingState":"","tuningOperation":"","type":"","updateTime":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v2alpha/:parent/models',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "createTime": "",\n "dataState": "",\n "displayName": "",\n "filteringOption": "",\n "lastTuneTime": "",\n "name": "",\n "optimizationObjective": "",\n "pageOptimizationConfig": {\n "pageOptimizationEventType": "",\n "panels": [\n {\n "candidates": [\n {\n "servingConfigId": ""\n }\n ],\n "defaultCandidate": {},\n "displayName": ""\n }\n ],\n "restriction": ""\n },\n "periodicTuningState": "",\n "servingConfigLists": [\n {\n "servingConfigIds": []\n }\n ],\n "servingState": "",\n "trainingState": "",\n "tuningOperation": "",\n "type": "",\n "updateTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/models")
.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/v2alpha/:parent/models',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
createTime: '',
dataState: '',
displayName: '',
filteringOption: '',
lastTuneTime: '',
name: '',
optimizationObjective: '',
pageOptimizationConfig: {
pageOptimizationEventType: '',
panels: [{candidates: [{servingConfigId: ''}], defaultCandidate: {}, displayName: ''}],
restriction: ''
},
periodicTuningState: '',
servingConfigLists: [{servingConfigIds: []}],
servingState: '',
trainingState: '',
tuningOperation: '',
type: '',
updateTime: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/models',
headers: {'content-type': 'application/json'},
body: {
createTime: '',
dataState: '',
displayName: '',
filteringOption: '',
lastTuneTime: '',
name: '',
optimizationObjective: '',
pageOptimizationConfig: {
pageOptimizationEventType: '',
panels: [{candidates: [{servingConfigId: ''}], defaultCandidate: {}, displayName: ''}],
restriction: ''
},
periodicTuningState: '',
servingConfigLists: [{servingConfigIds: []}],
servingState: '',
trainingState: '',
tuningOperation: '',
type: '',
updateTime: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v2alpha/:parent/models');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
createTime: '',
dataState: '',
displayName: '',
filteringOption: '',
lastTuneTime: '',
name: '',
optimizationObjective: '',
pageOptimizationConfig: {
pageOptimizationEventType: '',
panels: [
{
candidates: [
{
servingConfigId: ''
}
],
defaultCandidate: {},
displayName: ''
}
],
restriction: ''
},
periodicTuningState: '',
servingConfigLists: [
{
servingConfigIds: []
}
],
servingState: '',
trainingState: '',
tuningOperation: '',
type: '',
updateTime: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/models',
headers: {'content-type': 'application/json'},
data: {
createTime: '',
dataState: '',
displayName: '',
filteringOption: '',
lastTuneTime: '',
name: '',
optimizationObjective: '',
pageOptimizationConfig: {
pageOptimizationEventType: '',
panels: [{candidates: [{servingConfigId: ''}], defaultCandidate: {}, displayName: ''}],
restriction: ''
},
periodicTuningState: '',
servingConfigLists: [{servingConfigIds: []}],
servingState: '',
trainingState: '',
tuningOperation: '',
type: '',
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/models';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","dataState":"","displayName":"","filteringOption":"","lastTuneTime":"","name":"","optimizationObjective":"","pageOptimizationConfig":{"pageOptimizationEventType":"","panels":[{"candidates":[{"servingConfigId":""}],"defaultCandidate":{},"displayName":""}],"restriction":""},"periodicTuningState":"","servingConfigLists":[{"servingConfigIds":[]}],"servingState":"","trainingState":"","tuningOperation":"","type":"","updateTime":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"createTime": @"",
@"dataState": @"",
@"displayName": @"",
@"filteringOption": @"",
@"lastTuneTime": @"",
@"name": @"",
@"optimizationObjective": @"",
@"pageOptimizationConfig": @{ @"pageOptimizationEventType": @"", @"panels": @[ @{ @"candidates": @[ @{ @"servingConfigId": @"" } ], @"defaultCandidate": @{ }, @"displayName": @"" } ], @"restriction": @"" },
@"periodicTuningState": @"",
@"servingConfigLists": @[ @{ @"servingConfigIds": @[ ] } ],
@"servingState": @"",
@"trainingState": @"",
@"tuningOperation": @"",
@"type": @"",
@"updateTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:parent/models"]
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}}/v2alpha/:parent/models" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/models",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'createTime' => '',
'dataState' => '',
'displayName' => '',
'filteringOption' => '',
'lastTuneTime' => '',
'name' => '',
'optimizationObjective' => '',
'pageOptimizationConfig' => [
'pageOptimizationEventType' => '',
'panels' => [
[
'candidates' => [
[
'servingConfigId' => ''
]
],
'defaultCandidate' => [
],
'displayName' => ''
]
],
'restriction' => ''
],
'periodicTuningState' => '',
'servingConfigLists' => [
[
'servingConfigIds' => [
]
]
],
'servingState' => '',
'trainingState' => '',
'tuningOperation' => '',
'type' => '',
'updateTime' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v2alpha/:parent/models', [
'body' => '{
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": {
"pageOptimizationEventType": "",
"panels": [
{
"candidates": [
{
"servingConfigId": ""
}
],
"defaultCandidate": {},
"displayName": ""
}
],
"restriction": ""
},
"periodicTuningState": "",
"servingConfigLists": [
{
"servingConfigIds": []
}
],
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/models');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'createTime' => '',
'dataState' => '',
'displayName' => '',
'filteringOption' => '',
'lastTuneTime' => '',
'name' => '',
'optimizationObjective' => '',
'pageOptimizationConfig' => [
'pageOptimizationEventType' => '',
'panels' => [
[
'candidates' => [
[
'servingConfigId' => ''
]
],
'defaultCandidate' => [
],
'displayName' => ''
]
],
'restriction' => ''
],
'periodicTuningState' => '',
'servingConfigLists' => [
[
'servingConfigIds' => [
]
]
],
'servingState' => '',
'trainingState' => '',
'tuningOperation' => '',
'type' => '',
'updateTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'createTime' => '',
'dataState' => '',
'displayName' => '',
'filteringOption' => '',
'lastTuneTime' => '',
'name' => '',
'optimizationObjective' => '',
'pageOptimizationConfig' => [
'pageOptimizationEventType' => '',
'panels' => [
[
'candidates' => [
[
'servingConfigId' => ''
]
],
'defaultCandidate' => [
],
'displayName' => ''
]
],
'restriction' => ''
],
'periodicTuningState' => '',
'servingConfigLists' => [
[
'servingConfigIds' => [
]
]
],
'servingState' => '',
'trainingState' => '',
'tuningOperation' => '',
'type' => '',
'updateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:parent/models');
$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}}/v2alpha/:parent/models' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": {
"pageOptimizationEventType": "",
"panels": [
{
"candidates": [
{
"servingConfigId": ""
}
],
"defaultCandidate": {},
"displayName": ""
}
],
"restriction": ""
},
"periodicTuningState": "",
"servingConfigLists": [
{
"servingConfigIds": []
}
],
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/models' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": {
"pageOptimizationEventType": "",
"panels": [
{
"candidates": [
{
"servingConfigId": ""
}
],
"defaultCandidate": {},
"displayName": ""
}
],
"restriction": ""
},
"periodicTuningState": "",
"servingConfigLists": [
{
"servingConfigIds": []
}
],
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:parent/models", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/models"
payload = {
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": {
"pageOptimizationEventType": "",
"panels": [
{
"candidates": [{ "servingConfigId": "" }],
"defaultCandidate": {},
"displayName": ""
}
],
"restriction": ""
},
"periodicTuningState": "",
"servingConfigLists": [{ "servingConfigIds": [] }],
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/models"
payload <- "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/:parent/models")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v2alpha/:parent/models') do |req|
req.body = "{\n \"createTime\": \"\",\n \"dataState\": \"\",\n \"displayName\": \"\",\n \"filteringOption\": \"\",\n \"lastTuneTime\": \"\",\n \"name\": \"\",\n \"optimizationObjective\": \"\",\n \"pageOptimizationConfig\": {\n \"pageOptimizationEventType\": \"\",\n \"panels\": [\n {\n \"candidates\": [\n {\n \"servingConfigId\": \"\"\n }\n ],\n \"defaultCandidate\": {},\n \"displayName\": \"\"\n }\n ],\n \"restriction\": \"\"\n },\n \"periodicTuningState\": \"\",\n \"servingConfigLists\": [\n {\n \"servingConfigIds\": []\n }\n ],\n \"servingState\": \"\",\n \"trainingState\": \"\",\n \"tuningOperation\": \"\",\n \"type\": \"\",\n \"updateTime\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/models";
let payload = json!({
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": json!({
"pageOptimizationEventType": "",
"panels": (
json!({
"candidates": (json!({"servingConfigId": ""})),
"defaultCandidate": json!({}),
"displayName": ""
})
),
"restriction": ""
}),
"periodicTuningState": "",
"servingConfigLists": (json!({"servingConfigIds": ()})),
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v2alpha/:parent/models \
--header 'content-type: application/json' \
--data '{
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": {
"pageOptimizationEventType": "",
"panels": [
{
"candidates": [
{
"servingConfigId": ""
}
],
"defaultCandidate": {},
"displayName": ""
}
],
"restriction": ""
},
"periodicTuningState": "",
"servingConfigLists": [
{
"servingConfigIds": []
}
],
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
}'
echo '{
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": {
"pageOptimizationEventType": "",
"panels": [
{
"candidates": [
{
"servingConfigId": ""
}
],
"defaultCandidate": {},
"displayName": ""
}
],
"restriction": ""
},
"periodicTuningState": "",
"servingConfigLists": [
{
"servingConfigIds": []
}
],
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
}' | \
http POST {{baseUrl}}/v2alpha/:parent/models \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "createTime": "",\n "dataState": "",\n "displayName": "",\n "filteringOption": "",\n "lastTuneTime": "",\n "name": "",\n "optimizationObjective": "",\n "pageOptimizationConfig": {\n "pageOptimizationEventType": "",\n "panels": [\n {\n "candidates": [\n {\n "servingConfigId": ""\n }\n ],\n "defaultCandidate": {},\n "displayName": ""\n }\n ],\n "restriction": ""\n },\n "periodicTuningState": "",\n "servingConfigLists": [\n {\n "servingConfigIds": []\n }\n ],\n "servingState": "",\n "trainingState": "",\n "tuningOperation": "",\n "type": "",\n "updateTime": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:parent/models
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"createTime": "",
"dataState": "",
"displayName": "",
"filteringOption": "",
"lastTuneTime": "",
"name": "",
"optimizationObjective": "",
"pageOptimizationConfig": [
"pageOptimizationEventType": "",
"panels": [
[
"candidates": [["servingConfigId": ""]],
"defaultCandidate": [],
"displayName": ""
]
],
"restriction": ""
],
"periodicTuningState": "",
"servingConfigLists": [["servingConfigIds": []]],
"servingState": "",
"trainingState": "",
"tuningOperation": "",
"type": "",
"updateTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/models")! 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
retail.projects.locations.catalogs.models.list
{{baseUrl}}/v2alpha/:parent/models
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/models");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:parent/models")
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/models"
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}}/v2alpha/:parent/models"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:parent/models");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/models"
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/v2alpha/:parent/models HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:parent/models")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/models"))
.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}}/v2alpha/:parent/models")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/:parent/models")
.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}}/v2alpha/:parent/models');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2alpha/:parent/models'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/models';
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}}/v2alpha/:parent/models',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/models")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2alpha/:parent/models',
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}}/v2alpha/:parent/models'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2alpha/:parent/models');
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}}/v2alpha/:parent/models'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/models';
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}}/v2alpha/:parent/models"]
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}}/v2alpha/:parent/models" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/models",
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}}/v2alpha/:parent/models');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/models');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:parent/models');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:parent/models' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/models' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:parent/models")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/models"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/models"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/:parent/models")
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/v2alpha/:parent/models') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/models";
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}}/v2alpha/:parent/models
http GET {{baseUrl}}/v2alpha/:parent/models
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:parent/models
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/models")! 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
retail.projects.locations.catalogs.models.pause
{{baseUrl}}/v2alpha/:name:pause
QUERY PARAMS
name
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:name:pause");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:name:pause" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v2alpha/:name:pause"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/v2alpha/:name:pause"),
Content = new StringContent("{}")
{
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}}/v2alpha/:name:pause");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:name:pause"
payload := strings.NewReader("{}")
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/v2alpha/:name:pause HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:name:pause")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:name:pause"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:name:pause")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:name:pause")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:name:pause');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name:pause',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:name:pause';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/v2alpha/:name:pause',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:name:pause")
.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/v2alpha/:name:pause',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name:pause',
headers: {'content-type': 'application/json'},
body: {},
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}}/v2alpha/:name:pause');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/v2alpha/:name:pause',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:name:pause';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:name:pause"]
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}}/v2alpha/:name:pause" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:name:pause",
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([
]),
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}}/v2alpha/:name:pause', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:name:pause');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:name:pause');
$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}}/v2alpha/:name:pause' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:name:pause' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:name:pause", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:name:pause"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:name:pause"
payload <- "{}"
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}}/v2alpha/:name:pause")
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 = "{}"
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/v2alpha/:name:pause') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:name:pause";
let payload = json!({});
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}}/v2alpha/:name:pause \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v2alpha/:name:pause \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v2alpha/:name:pause
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:name:pause")! 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
retail.projects.locations.catalogs.models.resume
{{baseUrl}}/v2alpha/:name:resume
QUERY PARAMS
name
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:name:resume");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:name:resume" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v2alpha/:name:resume"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/v2alpha/:name:resume"),
Content = new StringContent("{}")
{
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}}/v2alpha/:name:resume");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:name:resume"
payload := strings.NewReader("{}")
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/v2alpha/:name:resume HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:name:resume")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:name:resume"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:name:resume")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:name:resume")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:name:resume');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name:resume',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:name:resume';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/v2alpha/:name:resume',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:name:resume")
.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/v2alpha/:name:resume',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name:resume',
headers: {'content-type': 'application/json'},
body: {},
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}}/v2alpha/:name:resume');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/v2alpha/:name:resume',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:name:resume';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:name:resume"]
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}}/v2alpha/:name:resume" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:name:resume",
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([
]),
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}}/v2alpha/:name:resume', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:name:resume');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:name:resume');
$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}}/v2alpha/:name:resume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:name:resume' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:name:resume", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:name:resume"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:name:resume"
payload <- "{}"
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}}/v2alpha/:name:resume")
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 = "{}"
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/v2alpha/:name:resume') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:name:resume";
let payload = json!({});
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}}/v2alpha/:name:resume \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v2alpha/:name:resume \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v2alpha/:name:resume
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:name:resume")! 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
retail.projects.locations.catalogs.models.tune
{{baseUrl}}/v2alpha/:name:tune
QUERY PARAMS
name
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:name:tune");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:name:tune" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v2alpha/:name:tune"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/v2alpha/:name:tune"),
Content = new StringContent("{}")
{
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}}/v2alpha/:name:tune");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:name:tune"
payload := strings.NewReader("{}")
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/v2alpha/:name:tune HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:name:tune")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:name:tune"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:name:tune")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:name:tune")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:name:tune');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name:tune',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:name:tune';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/v2alpha/:name:tune',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:name:tune")
.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/v2alpha/:name:tune',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:name:tune',
headers: {'content-type': 'application/json'},
body: {},
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}}/v2alpha/:name:tune');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/v2alpha/:name:tune',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:name:tune';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:name:tune"]
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}}/v2alpha/:name:tune" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:name:tune",
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([
]),
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}}/v2alpha/:name:tune', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:name:tune');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:name:tune');
$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}}/v2alpha/:name:tune' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:name:tune' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:name:tune", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:name:tune"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:name:tune"
payload <- "{}"
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}}/v2alpha/:name:tune")
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 = "{}"
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/v2alpha/:name:tune') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:name:tune";
let payload = json!({});
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}}/v2alpha/:name:tune \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v2alpha/:name:tune \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v2alpha/:name:tune
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:name:tune")! 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
retail.projects.locations.catalogs.servingConfigs.addControl
{{baseUrl}}/v2alpha/:servingConfig:addControl
QUERY PARAMS
servingConfig
BODY json
{
"controlId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:servingConfig:addControl");
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 \"controlId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:servingConfig:addControl" {:content-type :json
:form-params {:controlId ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:servingConfig:addControl"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"controlId\": \"\"\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}}/v2alpha/:servingConfig:addControl"),
Content = new StringContent("{\n \"controlId\": \"\"\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}}/v2alpha/:servingConfig:addControl");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"controlId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:servingConfig:addControl"
payload := strings.NewReader("{\n \"controlId\": \"\"\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/v2alpha/:servingConfig:addControl HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"controlId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:servingConfig:addControl")
.setHeader("content-type", "application/json")
.setBody("{\n \"controlId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:servingConfig:addControl"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"controlId\": \"\"\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 \"controlId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:servingConfig:addControl")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:servingConfig:addControl")
.header("content-type", "application/json")
.body("{\n \"controlId\": \"\"\n}")
.asString();
const data = JSON.stringify({
controlId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:servingConfig:addControl');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:servingConfig:addControl',
headers: {'content-type': 'application/json'},
data: {controlId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:servingConfig:addControl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"controlId":""}'
};
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}}/v2alpha/:servingConfig:addControl',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "controlId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"controlId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:servingConfig:addControl")
.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/v2alpha/:servingConfig:addControl',
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({controlId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:servingConfig:addControl',
headers: {'content-type': 'application/json'},
body: {controlId: ''},
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}}/v2alpha/:servingConfig:addControl');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
controlId: ''
});
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}}/v2alpha/:servingConfig:addControl',
headers: {'content-type': 'application/json'},
data: {controlId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:servingConfig:addControl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"controlId":""}'
};
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 = @{ @"controlId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:servingConfig:addControl"]
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}}/v2alpha/:servingConfig:addControl" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"controlId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:servingConfig:addControl",
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([
'controlId' => ''
]),
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}}/v2alpha/:servingConfig:addControl', [
'body' => '{
"controlId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:servingConfig:addControl');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'controlId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'controlId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:servingConfig:addControl');
$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}}/v2alpha/:servingConfig:addControl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"controlId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:servingConfig:addControl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"controlId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"controlId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:servingConfig:addControl", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:servingConfig:addControl"
payload = { "controlId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:servingConfig:addControl"
payload <- "{\n \"controlId\": \"\"\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}}/v2alpha/:servingConfig:addControl")
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 \"controlId\": \"\"\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/v2alpha/:servingConfig:addControl') do |req|
req.body = "{\n \"controlId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:servingConfig:addControl";
let payload = json!({"controlId": ""});
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}}/v2alpha/:servingConfig:addControl \
--header 'content-type: application/json' \
--data '{
"controlId": ""
}'
echo '{
"controlId": ""
}' | \
http POST {{baseUrl}}/v2alpha/:servingConfig:addControl \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "controlId": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:servingConfig:addControl
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["controlId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:servingConfig:addControl")! 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
retail.projects.locations.catalogs.servingConfigs.create
{{baseUrl}}/v2alpha/:parent/servingConfigs
QUERY PARAMS
parent
BODY json
{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/servingConfigs");
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 \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:parent/servingConfigs" {:content-type :json
:form-params {:boostControlIds []
:displayName ""
:diversityLevel ""
:diversityType ""
:doNotAssociateControlIds []
:dynamicFacetSpec {:mode ""}
:enableCategoryFilterLevel ""
:facetControlIds []
:filterControlIds []
:ignoreControlIds []
:modelId ""
:name ""
:onewaySynonymsControlIds []
:personalizationSpec {:mode ""}
:priceRerankingLevel ""
:redirectControlIds []
:replacementControlIds []
:solutionTypes []
:twowaySynonymsControlIds []}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/servingConfigs"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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}}/v2alpha/:parent/servingConfigs"),
Content = new StringContent("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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}}/v2alpha/:parent/servingConfigs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/servingConfigs"
payload := strings.NewReader("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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/v2alpha/:parent/servingConfigs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 542
{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:parent/servingConfigs")
.setHeader("content-type", "application/json")
.setBody("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/servingConfigs"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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 \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/servingConfigs")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:parent/servingConfigs")
.header("content-type", "application/json")
.body("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}")
.asString();
const data = JSON.stringify({
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {
mode: ''
},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {
mode: ''
},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:parent/servingConfigs');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/servingConfigs',
headers: {'content-type': 'application/json'},
data: {
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {mode: ''},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {mode: ''},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/servingConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"boostControlIds":[],"displayName":"","diversityLevel":"","diversityType":"","doNotAssociateControlIds":[],"dynamicFacetSpec":{"mode":""},"enableCategoryFilterLevel":"","facetControlIds":[],"filterControlIds":[],"ignoreControlIds":[],"modelId":"","name":"","onewaySynonymsControlIds":[],"personalizationSpec":{"mode":""},"priceRerankingLevel":"","redirectControlIds":[],"replacementControlIds":[],"solutionTypes":[],"twowaySynonymsControlIds":[]}'
};
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}}/v2alpha/:parent/servingConfigs',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "boostControlIds": [],\n "displayName": "",\n "diversityLevel": "",\n "diversityType": "",\n "doNotAssociateControlIds": [],\n "dynamicFacetSpec": {\n "mode": ""\n },\n "enableCategoryFilterLevel": "",\n "facetControlIds": [],\n "filterControlIds": [],\n "ignoreControlIds": [],\n "modelId": "",\n "name": "",\n "onewaySynonymsControlIds": [],\n "personalizationSpec": {\n "mode": ""\n },\n "priceRerankingLevel": "",\n "redirectControlIds": [],\n "replacementControlIds": [],\n "solutionTypes": [],\n "twowaySynonymsControlIds": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/servingConfigs")
.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/v2alpha/:parent/servingConfigs',
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({
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {mode: ''},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {mode: ''},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/servingConfigs',
headers: {'content-type': 'application/json'},
body: {
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {mode: ''},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {mode: ''},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
},
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}}/v2alpha/:parent/servingConfigs');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {
mode: ''
},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {
mode: ''
},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
});
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}}/v2alpha/:parent/servingConfigs',
headers: {'content-type': 'application/json'},
data: {
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {mode: ''},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {mode: ''},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/servingConfigs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"boostControlIds":[],"displayName":"","diversityLevel":"","diversityType":"","doNotAssociateControlIds":[],"dynamicFacetSpec":{"mode":""},"enableCategoryFilterLevel":"","facetControlIds":[],"filterControlIds":[],"ignoreControlIds":[],"modelId":"","name":"","onewaySynonymsControlIds":[],"personalizationSpec":{"mode":""},"priceRerankingLevel":"","redirectControlIds":[],"replacementControlIds":[],"solutionTypes":[],"twowaySynonymsControlIds":[]}'
};
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 = @{ @"boostControlIds": @[ ],
@"displayName": @"",
@"diversityLevel": @"",
@"diversityType": @"",
@"doNotAssociateControlIds": @[ ],
@"dynamicFacetSpec": @{ @"mode": @"" },
@"enableCategoryFilterLevel": @"",
@"facetControlIds": @[ ],
@"filterControlIds": @[ ],
@"ignoreControlIds": @[ ],
@"modelId": @"",
@"name": @"",
@"onewaySynonymsControlIds": @[ ],
@"personalizationSpec": @{ @"mode": @"" },
@"priceRerankingLevel": @"",
@"redirectControlIds": @[ ],
@"replacementControlIds": @[ ],
@"solutionTypes": @[ ],
@"twowaySynonymsControlIds": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:parent/servingConfigs"]
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}}/v2alpha/:parent/servingConfigs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/servingConfigs",
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([
'boostControlIds' => [
],
'displayName' => '',
'diversityLevel' => '',
'diversityType' => '',
'doNotAssociateControlIds' => [
],
'dynamicFacetSpec' => [
'mode' => ''
],
'enableCategoryFilterLevel' => '',
'facetControlIds' => [
],
'filterControlIds' => [
],
'ignoreControlIds' => [
],
'modelId' => '',
'name' => '',
'onewaySynonymsControlIds' => [
],
'personalizationSpec' => [
'mode' => ''
],
'priceRerankingLevel' => '',
'redirectControlIds' => [
],
'replacementControlIds' => [
],
'solutionTypes' => [
],
'twowaySynonymsControlIds' => [
]
]),
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}}/v2alpha/:parent/servingConfigs', [
'body' => '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/servingConfigs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'boostControlIds' => [
],
'displayName' => '',
'diversityLevel' => '',
'diversityType' => '',
'doNotAssociateControlIds' => [
],
'dynamicFacetSpec' => [
'mode' => ''
],
'enableCategoryFilterLevel' => '',
'facetControlIds' => [
],
'filterControlIds' => [
],
'ignoreControlIds' => [
],
'modelId' => '',
'name' => '',
'onewaySynonymsControlIds' => [
],
'personalizationSpec' => [
'mode' => ''
],
'priceRerankingLevel' => '',
'redirectControlIds' => [
],
'replacementControlIds' => [
],
'solutionTypes' => [
],
'twowaySynonymsControlIds' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'boostControlIds' => [
],
'displayName' => '',
'diversityLevel' => '',
'diversityType' => '',
'doNotAssociateControlIds' => [
],
'dynamicFacetSpec' => [
'mode' => ''
],
'enableCategoryFilterLevel' => '',
'facetControlIds' => [
],
'filterControlIds' => [
],
'ignoreControlIds' => [
],
'modelId' => '',
'name' => '',
'onewaySynonymsControlIds' => [
],
'personalizationSpec' => [
'mode' => ''
],
'priceRerankingLevel' => '',
'redirectControlIds' => [
],
'replacementControlIds' => [
],
'solutionTypes' => [
],
'twowaySynonymsControlIds' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:parent/servingConfigs');
$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}}/v2alpha/:parent/servingConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/servingConfigs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:parent/servingConfigs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/servingConfigs"
payload = {
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": { "mode": "" },
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": { "mode": "" },
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/servingConfigs"
payload <- "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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}}/v2alpha/:parent/servingConfigs")
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 \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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/v2alpha/:parent/servingConfigs') do |req|
req.body = "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/servingConfigs";
let payload = json!({
"boostControlIds": (),
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": (),
"dynamicFacetSpec": json!({"mode": ""}),
"enableCategoryFilterLevel": "",
"facetControlIds": (),
"filterControlIds": (),
"ignoreControlIds": (),
"modelId": "",
"name": "",
"onewaySynonymsControlIds": (),
"personalizationSpec": json!({"mode": ""}),
"priceRerankingLevel": "",
"redirectControlIds": (),
"replacementControlIds": (),
"solutionTypes": (),
"twowaySynonymsControlIds": ()
});
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}}/v2alpha/:parent/servingConfigs \
--header 'content-type: application/json' \
--data '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}'
echo '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}' | \
http POST {{baseUrl}}/v2alpha/:parent/servingConfigs \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "boostControlIds": [],\n "displayName": "",\n "diversityLevel": "",\n "diversityType": "",\n "doNotAssociateControlIds": [],\n "dynamicFacetSpec": {\n "mode": ""\n },\n "enableCategoryFilterLevel": "",\n "facetControlIds": [],\n "filterControlIds": [],\n "ignoreControlIds": [],\n "modelId": "",\n "name": "",\n "onewaySynonymsControlIds": [],\n "personalizationSpec": {\n "mode": ""\n },\n "priceRerankingLevel": "",\n "redirectControlIds": [],\n "replacementControlIds": [],\n "solutionTypes": [],\n "twowaySynonymsControlIds": []\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:parent/servingConfigs
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": ["mode": ""],
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": ["mode": ""],
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/servingConfigs")! 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
retail.projects.locations.catalogs.servingConfigs.delete
{{baseUrl}}/v2alpha/: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}}/v2alpha/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v2alpha/:name")
require "http/client"
url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:name");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/: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/v2alpha/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v2alpha/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/: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}}/v2alpha/:name")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v2alpha/: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}}/v2alpha/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v2alpha/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/: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}}/v2alpha/:name',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:name" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/: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}}/v2alpha/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:name');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:name');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:name' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:name' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v2alpha/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:name"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:name"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:name
http DELETE {{baseUrl}}/v2alpha/:name
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v2alpha/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/: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
retail.projects.locations.catalogs.servingConfigs.list
{{baseUrl}}/v2alpha/:parent/servingConfigs
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:parent/servingConfigs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:parent/servingConfigs")
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/servingConfigs"
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}}/v2alpha/:parent/servingConfigs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:parent/servingConfigs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/servingConfigs"
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/v2alpha/:parent/servingConfigs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:parent/servingConfigs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/servingConfigs"))
.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}}/v2alpha/:parent/servingConfigs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/:parent/servingConfigs")
.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}}/v2alpha/:parent/servingConfigs');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v2alpha/:parent/servingConfigs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:parent/servingConfigs';
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}}/v2alpha/:parent/servingConfigs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/servingConfigs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2alpha/:parent/servingConfigs',
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}}/v2alpha/:parent/servingConfigs'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v2alpha/:parent/servingConfigs');
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}}/v2alpha/:parent/servingConfigs'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:parent/servingConfigs';
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}}/v2alpha/:parent/servingConfigs"]
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}}/v2alpha/:parent/servingConfigs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:parent/servingConfigs",
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}}/v2alpha/:parent/servingConfigs');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/servingConfigs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:parent/servingConfigs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:parent/servingConfigs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/servingConfigs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:parent/servingConfigs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/servingConfigs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/servingConfigs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/:parent/servingConfigs")
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/v2alpha/:parent/servingConfigs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/servingConfigs";
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}}/v2alpha/:parent/servingConfigs
http GET {{baseUrl}}/v2alpha/:parent/servingConfigs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:parent/servingConfigs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:parent/servingConfigs")! 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
retail.projects.locations.catalogs.servingConfigs.patch
{{baseUrl}}/v2alpha/:name
QUERY PARAMS
name
BODY json
{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/: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 \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/v2alpha/:name" {:content-type :json
:form-params {:boostControlIds []
:displayName ""
:diversityLevel ""
:diversityType ""
:doNotAssociateControlIds []
:dynamicFacetSpec {:mode ""}
:enableCategoryFilterLevel ""
:facetControlIds []
:filterControlIds []
:ignoreControlIds []
:modelId ""
:name ""
:onewaySynonymsControlIds []
:personalizationSpec {:mode ""}
:priceRerankingLevel ""
:redirectControlIds []
:replacementControlIds []
:solutionTypes []
:twowaySynonymsControlIds []}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:name"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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}}/v2alpha/:name"),
Content = new StringContent("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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}}/v2alpha/:name");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:name"
payload := strings.NewReader("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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/v2alpha/:name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 542
{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/v2alpha/:name")
.setHeader("content-type", "application/json")
.setBody("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:name"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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 \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:name")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/v2alpha/:name")
.header("content-type", "application/json")
.body("{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}")
.asString();
const data = JSON.stringify({
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {
mode: ''
},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {
mode: ''
},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/v2alpha/:name');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v2alpha/:name',
headers: {'content-type': 'application/json'},
data: {
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {mode: ''},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {mode: ''},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"boostControlIds":[],"displayName":"","diversityLevel":"","diversityType":"","doNotAssociateControlIds":[],"dynamicFacetSpec":{"mode":""},"enableCategoryFilterLevel":"","facetControlIds":[],"filterControlIds":[],"ignoreControlIds":[],"modelId":"","name":"","onewaySynonymsControlIds":[],"personalizationSpec":{"mode":""},"priceRerankingLevel":"","redirectControlIds":[],"replacementControlIds":[],"solutionTypes":[],"twowaySynonymsControlIds":[]}'
};
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}}/v2alpha/:name',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "boostControlIds": [],\n "displayName": "",\n "diversityLevel": "",\n "diversityType": "",\n "doNotAssociateControlIds": [],\n "dynamicFacetSpec": {\n "mode": ""\n },\n "enableCategoryFilterLevel": "",\n "facetControlIds": [],\n "filterControlIds": [],\n "ignoreControlIds": [],\n "modelId": "",\n "name": "",\n "onewaySynonymsControlIds": [],\n "personalizationSpec": {\n "mode": ""\n },\n "priceRerankingLevel": "",\n "redirectControlIds": [],\n "replacementControlIds": [],\n "solutionTypes": [],\n "twowaySynonymsControlIds": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/: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/v2alpha/: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({
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {mode: ''},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {mode: ''},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v2alpha/:name',
headers: {'content-type': 'application/json'},
body: {
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {mode: ''},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {mode: ''},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
},
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}}/v2alpha/:name');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {
mode: ''
},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {
mode: ''
},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
});
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}}/v2alpha/:name',
headers: {'content-type': 'application/json'},
data: {
boostControlIds: [],
displayName: '',
diversityLevel: '',
diversityType: '',
doNotAssociateControlIds: [],
dynamicFacetSpec: {mode: ''},
enableCategoryFilterLevel: '',
facetControlIds: [],
filterControlIds: [],
ignoreControlIds: [],
modelId: '',
name: '',
onewaySynonymsControlIds: [],
personalizationSpec: {mode: ''},
priceRerankingLevel: '',
redirectControlIds: [],
replacementControlIds: [],
solutionTypes: [],
twowaySynonymsControlIds: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"boostControlIds":[],"displayName":"","diversityLevel":"","diversityType":"","doNotAssociateControlIds":[],"dynamicFacetSpec":{"mode":""},"enableCategoryFilterLevel":"","facetControlIds":[],"filterControlIds":[],"ignoreControlIds":[],"modelId":"","name":"","onewaySynonymsControlIds":[],"personalizationSpec":{"mode":""},"priceRerankingLevel":"","redirectControlIds":[],"replacementControlIds":[],"solutionTypes":[],"twowaySynonymsControlIds":[]}'
};
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 = @{ @"boostControlIds": @[ ],
@"displayName": @"",
@"diversityLevel": @"",
@"diversityType": @"",
@"doNotAssociateControlIds": @[ ],
@"dynamicFacetSpec": @{ @"mode": @"" },
@"enableCategoryFilterLevel": @"",
@"facetControlIds": @[ ],
@"filterControlIds": @[ ],
@"ignoreControlIds": @[ ],
@"modelId": @"",
@"name": @"",
@"onewaySynonymsControlIds": @[ ],
@"personalizationSpec": @{ @"mode": @"" },
@"priceRerankingLevel": @"",
@"redirectControlIds": @[ ],
@"replacementControlIds": @[ ],
@"solutionTypes": @[ ],
@"twowaySynonymsControlIds": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/: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}}/v2alpha/:name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/: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([
'boostControlIds' => [
],
'displayName' => '',
'diversityLevel' => '',
'diversityType' => '',
'doNotAssociateControlIds' => [
],
'dynamicFacetSpec' => [
'mode' => ''
],
'enableCategoryFilterLevel' => '',
'facetControlIds' => [
],
'filterControlIds' => [
],
'ignoreControlIds' => [
],
'modelId' => '',
'name' => '',
'onewaySynonymsControlIds' => [
],
'personalizationSpec' => [
'mode' => ''
],
'priceRerankingLevel' => '',
'redirectControlIds' => [
],
'replacementControlIds' => [
],
'solutionTypes' => [
],
'twowaySynonymsControlIds' => [
]
]),
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}}/v2alpha/:name', [
'body' => '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:name');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'boostControlIds' => [
],
'displayName' => '',
'diversityLevel' => '',
'diversityType' => '',
'doNotAssociateControlIds' => [
],
'dynamicFacetSpec' => [
'mode' => ''
],
'enableCategoryFilterLevel' => '',
'facetControlIds' => [
],
'filterControlIds' => [
],
'ignoreControlIds' => [
],
'modelId' => '',
'name' => '',
'onewaySynonymsControlIds' => [
],
'personalizationSpec' => [
'mode' => ''
],
'priceRerankingLevel' => '',
'redirectControlIds' => [
],
'replacementControlIds' => [
],
'solutionTypes' => [
],
'twowaySynonymsControlIds' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'boostControlIds' => [
],
'displayName' => '',
'diversityLevel' => '',
'diversityType' => '',
'doNotAssociateControlIds' => [
],
'dynamicFacetSpec' => [
'mode' => ''
],
'enableCategoryFilterLevel' => '',
'facetControlIds' => [
],
'filterControlIds' => [
],
'ignoreControlIds' => [
],
'modelId' => '',
'name' => '',
'onewaySynonymsControlIds' => [
],
'personalizationSpec' => [
'mode' => ''
],
'priceRerankingLevel' => '',
'redirectControlIds' => [
],
'replacementControlIds' => [
],
'solutionTypes' => [
],
'twowaySynonymsControlIds' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/: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}}/v2alpha/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/v2alpha/:name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:name"
payload = {
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": { "mode": "" },
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": { "mode": "" },
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:name"
payload <- "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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}}/v2alpha/: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 \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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/v2alpha/:name') do |req|
req.body = "{\n \"boostControlIds\": [],\n \"displayName\": \"\",\n \"diversityLevel\": \"\",\n \"diversityType\": \"\",\n \"doNotAssociateControlIds\": [],\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"enableCategoryFilterLevel\": \"\",\n \"facetControlIds\": [],\n \"filterControlIds\": [],\n \"ignoreControlIds\": [],\n \"modelId\": \"\",\n \"name\": \"\",\n \"onewaySynonymsControlIds\": [],\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"priceRerankingLevel\": \"\",\n \"redirectControlIds\": [],\n \"replacementControlIds\": [],\n \"solutionTypes\": [],\n \"twowaySynonymsControlIds\": []\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}}/v2alpha/:name";
let payload = json!({
"boostControlIds": (),
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": (),
"dynamicFacetSpec": json!({"mode": ""}),
"enableCategoryFilterLevel": "",
"facetControlIds": (),
"filterControlIds": (),
"ignoreControlIds": (),
"modelId": "",
"name": "",
"onewaySynonymsControlIds": (),
"personalizationSpec": json!({"mode": ""}),
"priceRerankingLevel": "",
"redirectControlIds": (),
"replacementControlIds": (),
"solutionTypes": (),
"twowaySynonymsControlIds": ()
});
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}}/v2alpha/:name \
--header 'content-type: application/json' \
--data '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}'
echo '{
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": {
"mode": ""
},
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": {
"mode": ""
},
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
}' | \
http PATCH {{baseUrl}}/v2alpha/:name \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "boostControlIds": [],\n "displayName": "",\n "diversityLevel": "",\n "diversityType": "",\n "doNotAssociateControlIds": [],\n "dynamicFacetSpec": {\n "mode": ""\n },\n "enableCategoryFilterLevel": "",\n "facetControlIds": [],\n "filterControlIds": [],\n "ignoreControlIds": [],\n "modelId": "",\n "name": "",\n "onewaySynonymsControlIds": [],\n "personalizationSpec": {\n "mode": ""\n },\n "priceRerankingLevel": "",\n "redirectControlIds": [],\n "replacementControlIds": [],\n "solutionTypes": [],\n "twowaySynonymsControlIds": []\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:name
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"boostControlIds": [],
"displayName": "",
"diversityLevel": "",
"diversityType": "",
"doNotAssociateControlIds": [],
"dynamicFacetSpec": ["mode": ""],
"enableCategoryFilterLevel": "",
"facetControlIds": [],
"filterControlIds": [],
"ignoreControlIds": [],
"modelId": "",
"name": "",
"onewaySynonymsControlIds": [],
"personalizationSpec": ["mode": ""],
"priceRerankingLevel": "",
"redirectControlIds": [],
"replacementControlIds": [],
"solutionTypes": [],
"twowaySynonymsControlIds": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/: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()
POST
retail.projects.locations.catalogs.servingConfigs.predict
{{baseUrl}}/v2alpha/:placement:predict
QUERY PARAMS
placement
BODY json
{
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
},
"validateOnly": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:placement: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 \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:placement:predict" {:content-type :json
:form-params {:filter ""
:labels {}
:pageSize 0
:pageToken ""
:params {}
:userEvent {:attributes {}
:attributionToken ""
:cartId ""
:completionDetail {:completionAttributionToken ""
:selectedPosition 0
:selectedSuggestion ""}
:entity ""
:eventTime ""
:eventType ""
:experimentIds []
:filter ""
:offset 0
:orderBy ""
:pageCategories []
:pageViewId ""
:productDetails [{:product {:attributes {}
:audience {:ageGroups []
:genders []}
:availability ""
:availableQuantity 0
:availableTime ""
:brands []
:categories []
:collectionMemberIds []
:colorInfo {:colorFamilies []
:colors []}
:conditions []
:description ""
:expireTime ""
:fulfillmentInfo [{:placeIds []
:type ""}]
:gtin ""
:id ""
:images [{:height 0
:uri ""
:width 0}]
:languageCode ""
:localInventories [{:attributes {}
:fulfillmentTypes []
:placeId ""
:priceInfo {:cost ""
:currencyCode ""
:originalPrice ""
:price ""
:priceEffectiveTime ""
:priceExpireTime ""
:priceRange {:originalPrice {:exclusiveMaximum ""
:exclusiveMinimum ""
:maximum ""
:minimum ""}
:price {}}}}]
:materials []
:name ""
:patterns []
:priceInfo {}
:primaryProductId ""
:promotions [{:promotionId ""}]
:publishTime ""
:rating {:averageRating ""
:ratingCount 0
:ratingHistogram []}
:retrievableFields ""
:sizes []
:tags []
:title ""
:ttl ""
:type ""
:uri ""
:variants []}
:quantity 0}]
:purchaseTransaction {:cost ""
:currencyCode ""
:id ""
:revenue ""
:tax ""}
:referrerUri ""
:searchQuery ""
:sessionId ""
:uri ""
:userInfo {:directUserRequest false
:ipAddress ""
:userAgent ""
:userId ""}
:visitorId ""}
:validateOnly false}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:placement:predict"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": 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}}/v2alpha/:placement:predict"),
Content = new StringContent("{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": 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}}/v2alpha/:placement:predict");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:placement:predict"
payload := strings.NewReader("{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": 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/v2alpha/:placement:predict HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 3116
{
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
},
"validateOnly": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:placement:predict")
.setHeader("content-type", "application/json")
.setBody("{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:placement:predict"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": 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 \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:placement:predict")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:placement:predict")
.header("content-type", "application/json")
.body("{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": false\n}")
.asString();
const data = JSON.stringify({
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {
completionAttributionToken: '',
selectedPosition: 0,
selectedSuggestion: ''
},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {
cost: '',
currencyCode: '',
id: '',
revenue: '',
tax: ''
},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: ''
},
visitorId: ''
},
validateOnly: 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}}/v2alpha/:placement:predict');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:placement:predict',
headers: {'content-type': 'application/json'},
data: {
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
visitorId: ''
},
validateOnly: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:placement:predict';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filter":"","labels":{},"pageSize":0,"pageToken":"","params":{},"userEvent":{"attributes":{},"attributionToken":"","cartId":"","completionDetail":{"completionAttributionToken":"","selectedPosition":0,"selectedSuggestion":""},"entity":"","eventTime":"","eventType":"","experimentIds":[],"filter":"","offset":0,"orderBy":"","pageCategories":[],"pageViewId":"","productDetails":[{"product":{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]},"quantity":0}],"purchaseTransaction":{"cost":"","currencyCode":"","id":"","revenue":"","tax":""},"referrerUri":"","searchQuery":"","sessionId":"","uri":"","userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":""},"visitorId":""},"validateOnly":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}}/v2alpha/:placement:predict',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "filter": "",\n "labels": {},\n "pageSize": 0,\n "pageToken": "",\n "params": {},\n "userEvent": {\n "attributes": {},\n "attributionToken": "",\n "cartId": "",\n "completionDetail": {\n "completionAttributionToken": "",\n "selectedPosition": 0,\n "selectedSuggestion": ""\n },\n "entity": "",\n "eventTime": "",\n "eventType": "",\n "experimentIds": [],\n "filter": "",\n "offset": 0,\n "orderBy": "",\n "pageCategories": [],\n "pageViewId": "",\n "productDetails": [\n {\n "product": {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n },\n "quantity": 0\n }\n ],\n "purchaseTransaction": {\n "cost": "",\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "tax": ""\n },\n "referrerUri": "",\n "searchQuery": "",\n "sessionId": "",\n "uri": "",\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": ""\n },\n "visitorId": ""\n },\n "validateOnly": 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 \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:placement: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/v2alpha/:placement: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({
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
visitorId: ''
},
validateOnly: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:placement:predict',
headers: {'content-type': 'application/json'},
body: {
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
visitorId: ''
},
validateOnly: 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}}/v2alpha/:placement:predict');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {
completionAttributionToken: '',
selectedPosition: 0,
selectedSuggestion: ''
},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {
cost: '',
currencyCode: '',
id: '',
revenue: '',
tax: ''
},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: ''
},
visitorId: ''
},
validateOnly: 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}}/v2alpha/:placement:predict',
headers: {'content-type': 'application/json'},
data: {
filter: '',
labels: {},
pageSize: 0,
pageToken: '',
params: {},
userEvent: {
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
visitorId: ''
},
validateOnly: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:placement:predict';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"filter":"","labels":{},"pageSize":0,"pageToken":"","params":{},"userEvent":{"attributes":{},"attributionToken":"","cartId":"","completionDetail":{"completionAttributionToken":"","selectedPosition":0,"selectedSuggestion":""},"entity":"","eventTime":"","eventType":"","experimentIds":[],"filter":"","offset":0,"orderBy":"","pageCategories":[],"pageViewId":"","productDetails":[{"product":{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]},"quantity":0}],"purchaseTransaction":{"cost":"","currencyCode":"","id":"","revenue":"","tax":""},"referrerUri":"","searchQuery":"","sessionId":"","uri":"","userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":""},"visitorId":""},"validateOnly":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": @"",
@"labels": @{ },
@"pageSize": @0,
@"pageToken": @"",
@"params": @{ },
@"userEvent": @{ @"attributes": @{ }, @"attributionToken": @"", @"cartId": @"", @"completionDetail": @{ @"completionAttributionToken": @"", @"selectedPosition": @0, @"selectedSuggestion": @"" }, @"entity": @"", @"eventTime": @"", @"eventType": @"", @"experimentIds": @[ ], @"filter": @"", @"offset": @0, @"orderBy": @"", @"pageCategories": @[ ], @"pageViewId": @"", @"productDetails": @[ @{ @"product": @{ @"attributes": @{ }, @"audience": @{ @"ageGroups": @[ ], @"genders": @[ ] }, @"availability": @"", @"availableQuantity": @0, @"availableTime": @"", @"brands": @[ ], @"categories": @[ ], @"collectionMemberIds": @[ ], @"colorInfo": @{ @"colorFamilies": @[ ], @"colors": @[ ] }, @"conditions": @[ ], @"description": @"", @"expireTime": @"", @"fulfillmentInfo": @[ @{ @"placeIds": @[ ], @"type": @"" } ], @"gtin": @"", @"id": @"", @"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ], @"languageCode": @"", @"localInventories": @[ @{ @"attributes": @{ }, @"fulfillmentTypes": @[ ], @"placeId": @"", @"priceInfo": @{ @"cost": @"", @"currencyCode": @"", @"originalPrice": @"", @"price": @"", @"priceEffectiveTime": @"", @"priceExpireTime": @"", @"priceRange": @{ @"originalPrice": @{ @"exclusiveMaximum": @"", @"exclusiveMinimum": @"", @"maximum": @"", @"minimum": @"" }, @"price": @{ } } } } ], @"materials": @[ ], @"name": @"", @"patterns": @[ ], @"priceInfo": @{ }, @"primaryProductId": @"", @"promotions": @[ @{ @"promotionId": @"" } ], @"publishTime": @"", @"rating": @{ @"averageRating": @"", @"ratingCount": @0, @"ratingHistogram": @[ ] }, @"retrievableFields": @"", @"sizes": @[ ], @"tags": @[ ], @"title": @"", @"ttl": @"", @"type": @"", @"uri": @"", @"variants": @[ ] }, @"quantity": @0 } ], @"purchaseTransaction": @{ @"cost": @"", @"currencyCode": @"", @"id": @"", @"revenue": @"", @"tax": @"" }, @"referrerUri": @"", @"searchQuery": @"", @"sessionId": @"", @"uri": @"", @"userInfo": @{ @"directUserRequest": @NO, @"ipAddress": @"", @"userAgent": @"", @"userId": @"" }, @"visitorId": @"" },
@"validateOnly": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:placement: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}}/v2alpha/:placement:predict" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:placement: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([
'filter' => '',
'labels' => [
],
'pageSize' => 0,
'pageToken' => '',
'params' => [
],
'userEvent' => [
'attributes' => [
],
'attributionToken' => '',
'cartId' => '',
'completionDetail' => [
'completionAttributionToken' => '',
'selectedPosition' => 0,
'selectedSuggestion' => ''
],
'entity' => '',
'eventTime' => '',
'eventType' => '',
'experimentIds' => [
],
'filter' => '',
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageViewId' => '',
'productDetails' => [
[
'product' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'quantity' => 0
]
],
'purchaseTransaction' => [
'cost' => '',
'currencyCode' => '',
'id' => '',
'revenue' => '',
'tax' => ''
],
'referrerUri' => '',
'searchQuery' => '',
'sessionId' => '',
'uri' => '',
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'visitorId' => ''
],
'validateOnly' => 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}}/v2alpha/:placement:predict', [
'body' => '{
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
},
"validateOnly": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:placement:predict');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'filter' => '',
'labels' => [
],
'pageSize' => 0,
'pageToken' => '',
'params' => [
],
'userEvent' => [
'attributes' => [
],
'attributionToken' => '',
'cartId' => '',
'completionDetail' => [
'completionAttributionToken' => '',
'selectedPosition' => 0,
'selectedSuggestion' => ''
],
'entity' => '',
'eventTime' => '',
'eventType' => '',
'experimentIds' => [
],
'filter' => '',
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageViewId' => '',
'productDetails' => [
[
'product' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'quantity' => 0
]
],
'purchaseTransaction' => [
'cost' => '',
'currencyCode' => '',
'id' => '',
'revenue' => '',
'tax' => ''
],
'referrerUri' => '',
'searchQuery' => '',
'sessionId' => '',
'uri' => '',
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'visitorId' => ''
],
'validateOnly' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'filter' => '',
'labels' => [
],
'pageSize' => 0,
'pageToken' => '',
'params' => [
],
'userEvent' => [
'attributes' => [
],
'attributionToken' => '',
'cartId' => '',
'completionDetail' => [
'completionAttributionToken' => '',
'selectedPosition' => 0,
'selectedSuggestion' => ''
],
'entity' => '',
'eventTime' => '',
'eventType' => '',
'experimentIds' => [
],
'filter' => '',
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageViewId' => '',
'productDetails' => [
[
'product' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'quantity' => 0
]
],
'purchaseTransaction' => [
'cost' => '',
'currencyCode' => '',
'id' => '',
'revenue' => '',
'tax' => ''
],
'referrerUri' => '',
'searchQuery' => '',
'sessionId' => '',
'uri' => '',
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'visitorId' => ''
],
'validateOnly' => null
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:placement: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}}/v2alpha/:placement:predict' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
},
"validateOnly": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:placement:predict' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
},
"validateOnly": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:placement:predict", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:placement:predict"
payload = {
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [{ "promotionId": "" }],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": False,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
},
"validateOnly": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:placement:predict"
payload <- "{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": 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}}/v2alpha/:placement: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 \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": 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/v2alpha/:placement:predict') do |req|
req.body = "{\n \"filter\": \"\",\n \"labels\": {},\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"params\": {},\n \"userEvent\": {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n },\n \"validateOnly\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:placement:predict";
let payload = json!({
"filter": "",
"labels": json!({}),
"pageSize": 0,
"pageToken": "",
"params": json!({}),
"userEvent": json!({
"attributes": json!({}),
"attributionToken": "",
"cartId": "",
"completionDetail": json!({
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
}),
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": (),
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": (),
"pageViewId": "",
"productDetails": (
json!({
"product": json!({
"attributes": json!({}),
"audience": json!({
"ageGroups": (),
"genders": ()
}),
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": (),
"categories": (),
"collectionMemberIds": (),
"colorInfo": json!({
"colorFamilies": (),
"colors": ()
}),
"conditions": (),
"description": "",
"expireTime": "",
"fulfillmentInfo": (
json!({
"placeIds": (),
"type": ""
})
),
"gtin": "",
"id": "",
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"languageCode": "",
"localInventories": (
json!({
"attributes": json!({}),
"fulfillmentTypes": (),
"placeId": "",
"priceInfo": json!({
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": json!({
"originalPrice": json!({
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}),
"price": json!({})
})
})
})
),
"materials": (),
"name": "",
"patterns": (),
"priceInfo": json!({}),
"primaryProductId": "",
"promotions": (json!({"promotionId": ""})),
"publishTime": "",
"rating": json!({
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": ()
}),
"retrievableFields": "",
"sizes": (),
"tags": (),
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": ()
}),
"quantity": 0
})
),
"purchaseTransaction": json!({
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
}),
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": json!({
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
}),
"visitorId": ""
}),
"validateOnly": 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}}/v2alpha/:placement:predict \
--header 'content-type: application/json' \
--data '{
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
},
"validateOnly": false
}'
echo '{
"filter": "",
"labels": {},
"pageSize": 0,
"pageToken": "",
"params": {},
"userEvent": {
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
},
"validateOnly": false
}' | \
http POST {{baseUrl}}/v2alpha/:placement:predict \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "filter": "",\n "labels": {},\n "pageSize": 0,\n "pageToken": "",\n "params": {},\n "userEvent": {\n "attributes": {},\n "attributionToken": "",\n "cartId": "",\n "completionDetail": {\n "completionAttributionToken": "",\n "selectedPosition": 0,\n "selectedSuggestion": ""\n },\n "entity": "",\n "eventTime": "",\n "eventType": "",\n "experimentIds": [],\n "filter": "",\n "offset": 0,\n "orderBy": "",\n "pageCategories": [],\n "pageViewId": "",\n "productDetails": [\n {\n "product": {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n },\n "quantity": 0\n }\n ],\n "purchaseTransaction": {\n "cost": "",\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "tax": ""\n },\n "referrerUri": "",\n "searchQuery": "",\n "sessionId": "",\n "uri": "",\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": ""\n },\n "visitorId": ""\n },\n "validateOnly": false\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:placement:predict
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"filter": "",
"labels": [],
"pageSize": 0,
"pageToken": "",
"params": [],
"userEvent": [
"attributes": [],
"attributionToken": "",
"cartId": "",
"completionDetail": [
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
],
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
[
"product": [
"attributes": [],
"audience": [
"ageGroups": [],
"genders": []
],
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": [
"colorFamilies": [],
"colors": []
],
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
[
"placeIds": [],
"type": ""
]
],
"gtin": "",
"id": "",
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"languageCode": "",
"localInventories": [
[
"attributes": [],
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": [
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": [
"originalPrice": [
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
],
"price": []
]
]
]
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": [],
"primaryProductId": "",
"promotions": [["promotionId": ""]],
"publishTime": "",
"rating": [
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
],
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
],
"quantity": 0
]
],
"purchaseTransaction": [
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
],
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": [
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
],
"visitorId": ""
],
"validateOnly": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:placement: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
retail.projects.locations.catalogs.servingConfigs.removeControl
{{baseUrl}}/v2alpha/:servingConfig:removeControl
QUERY PARAMS
servingConfig
BODY json
{
"controlId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:servingConfig:removeControl");
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 \"controlId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:servingConfig:removeControl" {:content-type :json
:form-params {:controlId ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:servingConfig:removeControl"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"controlId\": \"\"\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}}/v2alpha/:servingConfig:removeControl"),
Content = new StringContent("{\n \"controlId\": \"\"\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}}/v2alpha/:servingConfig:removeControl");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"controlId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:servingConfig:removeControl"
payload := strings.NewReader("{\n \"controlId\": \"\"\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/v2alpha/:servingConfig:removeControl HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"controlId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:servingConfig:removeControl")
.setHeader("content-type", "application/json")
.setBody("{\n \"controlId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:servingConfig:removeControl"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"controlId\": \"\"\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 \"controlId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:servingConfig:removeControl")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:servingConfig:removeControl")
.header("content-type", "application/json")
.body("{\n \"controlId\": \"\"\n}")
.asString();
const data = JSON.stringify({
controlId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:servingConfig:removeControl');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:servingConfig:removeControl',
headers: {'content-type': 'application/json'},
data: {controlId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:servingConfig:removeControl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"controlId":""}'
};
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}}/v2alpha/:servingConfig:removeControl',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "controlId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"controlId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:servingConfig:removeControl")
.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/v2alpha/:servingConfig:removeControl',
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({controlId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:servingConfig:removeControl',
headers: {'content-type': 'application/json'},
body: {controlId: ''},
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}}/v2alpha/:servingConfig:removeControl');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
controlId: ''
});
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}}/v2alpha/:servingConfig:removeControl',
headers: {'content-type': 'application/json'},
data: {controlId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:servingConfig:removeControl';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"controlId":""}'
};
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 = @{ @"controlId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:servingConfig:removeControl"]
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}}/v2alpha/:servingConfig:removeControl" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"controlId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:servingConfig:removeControl",
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([
'controlId' => ''
]),
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}}/v2alpha/:servingConfig:removeControl', [
'body' => '{
"controlId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:servingConfig:removeControl');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'controlId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'controlId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:servingConfig:removeControl');
$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}}/v2alpha/:servingConfig:removeControl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"controlId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:servingConfig:removeControl' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"controlId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"controlId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:servingConfig:removeControl", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:servingConfig:removeControl"
payload = { "controlId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:servingConfig:removeControl"
payload <- "{\n \"controlId\": \"\"\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}}/v2alpha/:servingConfig:removeControl")
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 \"controlId\": \"\"\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/v2alpha/:servingConfig:removeControl') do |req|
req.body = "{\n \"controlId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:servingConfig:removeControl";
let payload = json!({"controlId": ""});
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}}/v2alpha/:servingConfig:removeControl \
--header 'content-type: application/json' \
--data '{
"controlId": ""
}'
echo '{
"controlId": ""
}' | \
http POST {{baseUrl}}/v2alpha/:servingConfig:removeControl \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "controlId": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:servingConfig:removeControl
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["controlId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:servingConfig:removeControl")! 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
retail.projects.locations.catalogs.servingConfigs.search
{{baseUrl}}/v2alpha/:placement:search
QUERY PARAMS
placement
BODY json
{
"boostSpec": {
"conditionBoostSpecs": [
{
"boost": "",
"condition": ""
}
],
"skipBoostSpecValidation": false
},
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": {
"mode": ""
},
"entity": "",
"facetSpecs": [
{
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
}
],
"filter": "",
"labels": {},
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageSize": 0,
"pageToken": "",
"personalizationSpec": {
"mode": ""
},
"query": "",
"queryExpansionSpec": {
"condition": "",
"pinUnexpandedResults": false
},
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": {
"mode": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"variantRollupKeys": [],
"visitorId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:placement:search");
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 \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:placement:search" {:content-type :json
:form-params {:boostSpec {:conditionBoostSpecs [{:boost ""
:condition ""}]
:skipBoostSpecValidation false}
:branch ""
:canonicalFilter ""
:dynamicFacetSpec {:mode ""}
:entity ""
:facetSpecs [{:enableDynamicPosition false
:excludedFilterKeys []
:facetKey {:caseInsensitive false
:contains []
:intervals [{:exclusiveMaximum ""
:exclusiveMinimum ""
:maximum ""
:minimum ""}]
:key ""
:orderBy ""
:prefixes []
:query ""
:restrictedValues []
:returnMinMax false}
:limit 0}]
:filter ""
:labels {}
:offset 0
:orderBy ""
:pageCategories []
:pageSize 0
:pageToken ""
:personalizationSpec {:mode ""}
:query ""
:queryExpansionSpec {:condition ""
:pinUnexpandedResults false}
:relevanceThreshold ""
:searchMode ""
:spellCorrectionSpec {:mode ""}
:userInfo {:directUserRequest false
:ipAddress ""
:userAgent ""
:userId ""}
:variantRollupKeys []
:visitorId ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:placement:search"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\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}}/v2alpha/:placement:search"),
Content = new StringContent("{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\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}}/v2alpha/:placement:search");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:placement:search"
payload := strings.NewReader("{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\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/v2alpha/:placement:search HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1325
{
"boostSpec": {
"conditionBoostSpecs": [
{
"boost": "",
"condition": ""
}
],
"skipBoostSpecValidation": false
},
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": {
"mode": ""
},
"entity": "",
"facetSpecs": [
{
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
}
],
"filter": "",
"labels": {},
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageSize": 0,
"pageToken": "",
"personalizationSpec": {
"mode": ""
},
"query": "",
"queryExpansionSpec": {
"condition": "",
"pinUnexpandedResults": false
},
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": {
"mode": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"variantRollupKeys": [],
"visitorId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:placement:search")
.setHeader("content-type", "application/json")
.setBody("{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:placement:search"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\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 \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:placement:search")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:placement:search")
.header("content-type", "application/json")
.body("{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\n}")
.asString();
const data = JSON.stringify({
boostSpec: {
conditionBoostSpecs: [
{
boost: '',
condition: ''
}
],
skipBoostSpecValidation: false
},
branch: '',
canonicalFilter: '',
dynamicFacetSpec: {
mode: ''
},
entity: '',
facetSpecs: [
{
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [
{
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
}
],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
}
],
filter: '',
labels: {},
offset: 0,
orderBy: '',
pageCategories: [],
pageSize: 0,
pageToken: '',
personalizationSpec: {
mode: ''
},
query: '',
queryExpansionSpec: {
condition: '',
pinUnexpandedResults: false
},
relevanceThreshold: '',
searchMode: '',
spellCorrectionSpec: {
mode: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: ''
},
variantRollupKeys: [],
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}}/v2alpha/:placement:search');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:placement:search',
headers: {'content-type': 'application/json'},
data: {
boostSpec: {
conditionBoostSpecs: [{boost: '', condition: ''}],
skipBoostSpecValidation: false
},
branch: '',
canonicalFilter: '',
dynamicFacetSpec: {mode: ''},
entity: '',
facetSpecs: [
{
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [{exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''}],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
}
],
filter: '',
labels: {},
offset: 0,
orderBy: '',
pageCategories: [],
pageSize: 0,
pageToken: '',
personalizationSpec: {mode: ''},
query: '',
queryExpansionSpec: {condition: '', pinUnexpandedResults: false},
relevanceThreshold: '',
searchMode: '',
spellCorrectionSpec: {mode: ''},
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
variantRollupKeys: [],
visitorId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:placement:search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"boostSpec":{"conditionBoostSpecs":[{"boost":"","condition":""}],"skipBoostSpecValidation":false},"branch":"","canonicalFilter":"","dynamicFacetSpec":{"mode":""},"entity":"","facetSpecs":[{"enableDynamicPosition":false,"excludedFilterKeys":[],"facetKey":{"caseInsensitive":false,"contains":[],"intervals":[{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""}],"key":"","orderBy":"","prefixes":[],"query":"","restrictedValues":[],"returnMinMax":false},"limit":0}],"filter":"","labels":{},"offset":0,"orderBy":"","pageCategories":[],"pageSize":0,"pageToken":"","personalizationSpec":{"mode":""},"query":"","queryExpansionSpec":{"condition":"","pinUnexpandedResults":false},"relevanceThreshold":"","searchMode":"","spellCorrectionSpec":{"mode":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":""},"variantRollupKeys":[],"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}}/v2alpha/:placement:search',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "boostSpec": {\n "conditionBoostSpecs": [\n {\n "boost": "",\n "condition": ""\n }\n ],\n "skipBoostSpecValidation": false\n },\n "branch": "",\n "canonicalFilter": "",\n "dynamicFacetSpec": {\n "mode": ""\n },\n "entity": "",\n "facetSpecs": [\n {\n "enableDynamicPosition": false,\n "excludedFilterKeys": [],\n "facetKey": {\n "caseInsensitive": false,\n "contains": [],\n "intervals": [\n {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n }\n ],\n "key": "",\n "orderBy": "",\n "prefixes": [],\n "query": "",\n "restrictedValues": [],\n "returnMinMax": false\n },\n "limit": 0\n }\n ],\n "filter": "",\n "labels": {},\n "offset": 0,\n "orderBy": "",\n "pageCategories": [],\n "pageSize": 0,\n "pageToken": "",\n "personalizationSpec": {\n "mode": ""\n },\n "query": "",\n "queryExpansionSpec": {\n "condition": "",\n "pinUnexpandedResults": false\n },\n "relevanceThreshold": "",\n "searchMode": "",\n "spellCorrectionSpec": {\n "mode": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": ""\n },\n "variantRollupKeys": [],\n "visitorId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:placement:search")
.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/v2alpha/:placement:search',
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({
boostSpec: {
conditionBoostSpecs: [{boost: '', condition: ''}],
skipBoostSpecValidation: false
},
branch: '',
canonicalFilter: '',
dynamicFacetSpec: {mode: ''},
entity: '',
facetSpecs: [
{
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [{exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''}],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
}
],
filter: '',
labels: {},
offset: 0,
orderBy: '',
pageCategories: [],
pageSize: 0,
pageToken: '',
personalizationSpec: {mode: ''},
query: '',
queryExpansionSpec: {condition: '', pinUnexpandedResults: false},
relevanceThreshold: '',
searchMode: '',
spellCorrectionSpec: {mode: ''},
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
variantRollupKeys: [],
visitorId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:placement:search',
headers: {'content-type': 'application/json'},
body: {
boostSpec: {
conditionBoostSpecs: [{boost: '', condition: ''}],
skipBoostSpecValidation: false
},
branch: '',
canonicalFilter: '',
dynamicFacetSpec: {mode: ''},
entity: '',
facetSpecs: [
{
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [{exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''}],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
}
],
filter: '',
labels: {},
offset: 0,
orderBy: '',
pageCategories: [],
pageSize: 0,
pageToken: '',
personalizationSpec: {mode: ''},
query: '',
queryExpansionSpec: {condition: '', pinUnexpandedResults: false},
relevanceThreshold: '',
searchMode: '',
spellCorrectionSpec: {mode: ''},
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
variantRollupKeys: [],
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}}/v2alpha/:placement:search');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
boostSpec: {
conditionBoostSpecs: [
{
boost: '',
condition: ''
}
],
skipBoostSpecValidation: false
},
branch: '',
canonicalFilter: '',
dynamicFacetSpec: {
mode: ''
},
entity: '',
facetSpecs: [
{
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [
{
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
}
],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
}
],
filter: '',
labels: {},
offset: 0,
orderBy: '',
pageCategories: [],
pageSize: 0,
pageToken: '',
personalizationSpec: {
mode: ''
},
query: '',
queryExpansionSpec: {
condition: '',
pinUnexpandedResults: false
},
relevanceThreshold: '',
searchMode: '',
spellCorrectionSpec: {
mode: ''
},
userInfo: {
directUserRequest: false,
ipAddress: '',
userAgent: '',
userId: ''
},
variantRollupKeys: [],
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}}/v2alpha/:placement:search',
headers: {'content-type': 'application/json'},
data: {
boostSpec: {
conditionBoostSpecs: [{boost: '', condition: ''}],
skipBoostSpecValidation: false
},
branch: '',
canonicalFilter: '',
dynamicFacetSpec: {mode: ''},
entity: '',
facetSpecs: [
{
enableDynamicPosition: false,
excludedFilterKeys: [],
facetKey: {
caseInsensitive: false,
contains: [],
intervals: [{exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''}],
key: '',
orderBy: '',
prefixes: [],
query: '',
restrictedValues: [],
returnMinMax: false
},
limit: 0
}
],
filter: '',
labels: {},
offset: 0,
orderBy: '',
pageCategories: [],
pageSize: 0,
pageToken: '',
personalizationSpec: {mode: ''},
query: '',
queryExpansionSpec: {condition: '', pinUnexpandedResults: false},
relevanceThreshold: '',
searchMode: '',
spellCorrectionSpec: {mode: ''},
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
variantRollupKeys: [],
visitorId: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:placement:search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"boostSpec":{"conditionBoostSpecs":[{"boost":"","condition":""}],"skipBoostSpecValidation":false},"branch":"","canonicalFilter":"","dynamicFacetSpec":{"mode":""},"entity":"","facetSpecs":[{"enableDynamicPosition":false,"excludedFilterKeys":[],"facetKey":{"caseInsensitive":false,"contains":[],"intervals":[{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""}],"key":"","orderBy":"","prefixes":[],"query":"","restrictedValues":[],"returnMinMax":false},"limit":0}],"filter":"","labels":{},"offset":0,"orderBy":"","pageCategories":[],"pageSize":0,"pageToken":"","personalizationSpec":{"mode":""},"query":"","queryExpansionSpec":{"condition":"","pinUnexpandedResults":false},"relevanceThreshold":"","searchMode":"","spellCorrectionSpec":{"mode":""},"userInfo":{"directUserRequest":false,"ipAddress":"","userAgent":"","userId":""},"variantRollupKeys":[],"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 = @{ @"boostSpec": @{ @"conditionBoostSpecs": @[ @{ @"boost": @"", @"condition": @"" } ], @"skipBoostSpecValidation": @NO },
@"branch": @"",
@"canonicalFilter": @"",
@"dynamicFacetSpec": @{ @"mode": @"" },
@"entity": @"",
@"facetSpecs": @[ @{ @"enableDynamicPosition": @NO, @"excludedFilterKeys": @[ ], @"facetKey": @{ @"caseInsensitive": @NO, @"contains": @[ ], @"intervals": @[ @{ @"exclusiveMaximum": @"", @"exclusiveMinimum": @"", @"maximum": @"", @"minimum": @"" } ], @"key": @"", @"orderBy": @"", @"prefixes": @[ ], @"query": @"", @"restrictedValues": @[ ], @"returnMinMax": @NO }, @"limit": @0 } ],
@"filter": @"",
@"labels": @{ },
@"offset": @0,
@"orderBy": @"",
@"pageCategories": @[ ],
@"pageSize": @0,
@"pageToken": @"",
@"personalizationSpec": @{ @"mode": @"" },
@"query": @"",
@"queryExpansionSpec": @{ @"condition": @"", @"pinUnexpandedResults": @NO },
@"relevanceThreshold": @"",
@"searchMode": @"",
@"spellCorrectionSpec": @{ @"mode": @"" },
@"userInfo": @{ @"directUserRequest": @NO, @"ipAddress": @"", @"userAgent": @"", @"userId": @"" },
@"variantRollupKeys": @[ ],
@"visitorId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:placement:search"]
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}}/v2alpha/:placement:search" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:placement:search",
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([
'boostSpec' => [
'conditionBoostSpecs' => [
[
'boost' => '',
'condition' => ''
]
],
'skipBoostSpecValidation' => null
],
'branch' => '',
'canonicalFilter' => '',
'dynamicFacetSpec' => [
'mode' => ''
],
'entity' => '',
'facetSpecs' => [
[
'enableDynamicPosition' => null,
'excludedFilterKeys' => [
],
'facetKey' => [
'caseInsensitive' => null,
'contains' => [
],
'intervals' => [
[
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
]
],
'key' => '',
'orderBy' => '',
'prefixes' => [
],
'query' => '',
'restrictedValues' => [
],
'returnMinMax' => null
],
'limit' => 0
]
],
'filter' => '',
'labels' => [
],
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageSize' => 0,
'pageToken' => '',
'personalizationSpec' => [
'mode' => ''
],
'query' => '',
'queryExpansionSpec' => [
'condition' => '',
'pinUnexpandedResults' => null
],
'relevanceThreshold' => '',
'searchMode' => '',
'spellCorrectionSpec' => [
'mode' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'variantRollupKeys' => [
],
'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}}/v2alpha/:placement:search', [
'body' => '{
"boostSpec": {
"conditionBoostSpecs": [
{
"boost": "",
"condition": ""
}
],
"skipBoostSpecValidation": false
},
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": {
"mode": ""
},
"entity": "",
"facetSpecs": [
{
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
}
],
"filter": "",
"labels": {},
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageSize": 0,
"pageToken": "",
"personalizationSpec": {
"mode": ""
},
"query": "",
"queryExpansionSpec": {
"condition": "",
"pinUnexpandedResults": false
},
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": {
"mode": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"variantRollupKeys": [],
"visitorId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:placement:search');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'boostSpec' => [
'conditionBoostSpecs' => [
[
'boost' => '',
'condition' => ''
]
],
'skipBoostSpecValidation' => null
],
'branch' => '',
'canonicalFilter' => '',
'dynamicFacetSpec' => [
'mode' => ''
],
'entity' => '',
'facetSpecs' => [
[
'enableDynamicPosition' => null,
'excludedFilterKeys' => [
],
'facetKey' => [
'caseInsensitive' => null,
'contains' => [
],
'intervals' => [
[
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
]
],
'key' => '',
'orderBy' => '',
'prefixes' => [
],
'query' => '',
'restrictedValues' => [
],
'returnMinMax' => null
],
'limit' => 0
]
],
'filter' => '',
'labels' => [
],
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageSize' => 0,
'pageToken' => '',
'personalizationSpec' => [
'mode' => ''
],
'query' => '',
'queryExpansionSpec' => [
'condition' => '',
'pinUnexpandedResults' => null
],
'relevanceThreshold' => '',
'searchMode' => '',
'spellCorrectionSpec' => [
'mode' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'variantRollupKeys' => [
],
'visitorId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'boostSpec' => [
'conditionBoostSpecs' => [
[
'boost' => '',
'condition' => ''
]
],
'skipBoostSpecValidation' => null
],
'branch' => '',
'canonicalFilter' => '',
'dynamicFacetSpec' => [
'mode' => ''
],
'entity' => '',
'facetSpecs' => [
[
'enableDynamicPosition' => null,
'excludedFilterKeys' => [
],
'facetKey' => [
'caseInsensitive' => null,
'contains' => [
],
'intervals' => [
[
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
]
],
'key' => '',
'orderBy' => '',
'prefixes' => [
],
'query' => '',
'restrictedValues' => [
],
'returnMinMax' => null
],
'limit' => 0
]
],
'filter' => '',
'labels' => [
],
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageSize' => 0,
'pageToken' => '',
'personalizationSpec' => [
'mode' => ''
],
'query' => '',
'queryExpansionSpec' => [
'condition' => '',
'pinUnexpandedResults' => null
],
'relevanceThreshold' => '',
'searchMode' => '',
'spellCorrectionSpec' => [
'mode' => ''
],
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'variantRollupKeys' => [
],
'visitorId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:placement:search');
$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}}/v2alpha/:placement:search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"boostSpec": {
"conditionBoostSpecs": [
{
"boost": "",
"condition": ""
}
],
"skipBoostSpecValidation": false
},
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": {
"mode": ""
},
"entity": "",
"facetSpecs": [
{
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
}
],
"filter": "",
"labels": {},
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageSize": 0,
"pageToken": "",
"personalizationSpec": {
"mode": ""
},
"query": "",
"queryExpansionSpec": {
"condition": "",
"pinUnexpandedResults": false
},
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": {
"mode": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"variantRollupKeys": [],
"visitorId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:placement:search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"boostSpec": {
"conditionBoostSpecs": [
{
"boost": "",
"condition": ""
}
],
"skipBoostSpecValidation": false
},
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": {
"mode": ""
},
"entity": "",
"facetSpecs": [
{
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
}
],
"filter": "",
"labels": {},
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageSize": 0,
"pageToken": "",
"personalizationSpec": {
"mode": ""
},
"query": "",
"queryExpansionSpec": {
"condition": "",
"pinUnexpandedResults": false
},
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": {
"mode": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"variantRollupKeys": [],
"visitorId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:placement:search", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:placement:search"
payload = {
"boostSpec": {
"conditionBoostSpecs": [
{
"boost": "",
"condition": ""
}
],
"skipBoostSpecValidation": False
},
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": { "mode": "" },
"entity": "",
"facetSpecs": [
{
"enableDynamicPosition": False,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": False,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": False
},
"limit": 0
}
],
"filter": "",
"labels": {},
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageSize": 0,
"pageToken": "",
"personalizationSpec": { "mode": "" },
"query": "",
"queryExpansionSpec": {
"condition": "",
"pinUnexpandedResults": False
},
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": { "mode": "" },
"userInfo": {
"directUserRequest": False,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"variantRollupKeys": [],
"visitorId": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:placement:search"
payload <- "{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\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}}/v2alpha/:placement:search")
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 \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\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/v2alpha/:placement:search') do |req|
req.body = "{\n \"boostSpec\": {\n \"conditionBoostSpecs\": [\n {\n \"boost\": \"\",\n \"condition\": \"\"\n }\n ],\n \"skipBoostSpecValidation\": false\n },\n \"branch\": \"\",\n \"canonicalFilter\": \"\",\n \"dynamicFacetSpec\": {\n \"mode\": \"\"\n },\n \"entity\": \"\",\n \"facetSpecs\": [\n {\n \"enableDynamicPosition\": false,\n \"excludedFilterKeys\": [],\n \"facetKey\": {\n \"caseInsensitive\": false,\n \"contains\": [],\n \"intervals\": [\n {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n }\n ],\n \"key\": \"\",\n \"orderBy\": \"\",\n \"prefixes\": [],\n \"query\": \"\",\n \"restrictedValues\": [],\n \"returnMinMax\": false\n },\n \"limit\": 0\n }\n ],\n \"filter\": \"\",\n \"labels\": {},\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageSize\": 0,\n \"pageToken\": \"\",\n \"personalizationSpec\": {\n \"mode\": \"\"\n },\n \"query\": \"\",\n \"queryExpansionSpec\": {\n \"condition\": \"\",\n \"pinUnexpandedResults\": false\n },\n \"relevanceThreshold\": \"\",\n \"searchMode\": \"\",\n \"spellCorrectionSpec\": {\n \"mode\": \"\"\n },\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"variantRollupKeys\": [],\n \"visitorId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:placement:search";
let payload = json!({
"boostSpec": json!({
"conditionBoostSpecs": (
json!({
"boost": "",
"condition": ""
})
),
"skipBoostSpecValidation": false
}),
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": json!({"mode": ""}),
"entity": "",
"facetSpecs": (
json!({
"enableDynamicPosition": false,
"excludedFilterKeys": (),
"facetKey": json!({
"caseInsensitive": false,
"contains": (),
"intervals": (
json!({
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
})
),
"key": "",
"orderBy": "",
"prefixes": (),
"query": "",
"restrictedValues": (),
"returnMinMax": false
}),
"limit": 0
})
),
"filter": "",
"labels": json!({}),
"offset": 0,
"orderBy": "",
"pageCategories": (),
"pageSize": 0,
"pageToken": "",
"personalizationSpec": json!({"mode": ""}),
"query": "",
"queryExpansionSpec": json!({
"condition": "",
"pinUnexpandedResults": false
}),
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": json!({"mode": ""}),
"userInfo": json!({
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
}),
"variantRollupKeys": (),
"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}}/v2alpha/:placement:search \
--header 'content-type: application/json' \
--data '{
"boostSpec": {
"conditionBoostSpecs": [
{
"boost": "",
"condition": ""
}
],
"skipBoostSpecValidation": false
},
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": {
"mode": ""
},
"entity": "",
"facetSpecs": [
{
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
}
],
"filter": "",
"labels": {},
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageSize": 0,
"pageToken": "",
"personalizationSpec": {
"mode": ""
},
"query": "",
"queryExpansionSpec": {
"condition": "",
"pinUnexpandedResults": false
},
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": {
"mode": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"variantRollupKeys": [],
"visitorId": ""
}'
echo '{
"boostSpec": {
"conditionBoostSpecs": [
{
"boost": "",
"condition": ""
}
],
"skipBoostSpecValidation": false
},
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": {
"mode": ""
},
"entity": "",
"facetSpecs": [
{
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": {
"caseInsensitive": false,
"contains": [],
"intervals": [
{
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
},
"limit": 0
}
],
"filter": "",
"labels": {},
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageSize": 0,
"pageToken": "",
"personalizationSpec": {
"mode": ""
},
"query": "",
"queryExpansionSpec": {
"condition": "",
"pinUnexpandedResults": false
},
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": {
"mode": ""
},
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"variantRollupKeys": [],
"visitorId": ""
}' | \
http POST {{baseUrl}}/v2alpha/:placement:search \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "boostSpec": {\n "conditionBoostSpecs": [\n {\n "boost": "",\n "condition": ""\n }\n ],\n "skipBoostSpecValidation": false\n },\n "branch": "",\n "canonicalFilter": "",\n "dynamicFacetSpec": {\n "mode": ""\n },\n "entity": "",\n "facetSpecs": [\n {\n "enableDynamicPosition": false,\n "excludedFilterKeys": [],\n "facetKey": {\n "caseInsensitive": false,\n "contains": [],\n "intervals": [\n {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n }\n ],\n "key": "",\n "orderBy": "",\n "prefixes": [],\n "query": "",\n "restrictedValues": [],\n "returnMinMax": false\n },\n "limit": 0\n }\n ],\n "filter": "",\n "labels": {},\n "offset": 0,\n "orderBy": "",\n "pageCategories": [],\n "pageSize": 0,\n "pageToken": "",\n "personalizationSpec": {\n "mode": ""\n },\n "query": "",\n "queryExpansionSpec": {\n "condition": "",\n "pinUnexpandedResults": false\n },\n "relevanceThreshold": "",\n "searchMode": "",\n "spellCorrectionSpec": {\n "mode": ""\n },\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": ""\n },\n "variantRollupKeys": [],\n "visitorId": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:placement:search
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"boostSpec": [
"conditionBoostSpecs": [
[
"boost": "",
"condition": ""
]
],
"skipBoostSpecValidation": false
],
"branch": "",
"canonicalFilter": "",
"dynamicFacetSpec": ["mode": ""],
"entity": "",
"facetSpecs": [
[
"enableDynamicPosition": false,
"excludedFilterKeys": [],
"facetKey": [
"caseInsensitive": false,
"contains": [],
"intervals": [
[
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
]
],
"key": "",
"orderBy": "",
"prefixes": [],
"query": "",
"restrictedValues": [],
"returnMinMax": false
],
"limit": 0
]
],
"filter": "",
"labels": [],
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageSize": 0,
"pageToken": "",
"personalizationSpec": ["mode": ""],
"query": "",
"queryExpansionSpec": [
"condition": "",
"pinUnexpandedResults": false
],
"relevanceThreshold": "",
"searchMode": "",
"spellCorrectionSpec": ["mode": ""],
"userInfo": [
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
],
"variantRollupKeys": [],
"visitorId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:placement:search")! 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
retail.projects.locations.catalogs.setDefaultBranch
{{baseUrl}}/v2alpha/:catalog:setDefaultBranch
QUERY PARAMS
catalog
BODY json
{
"branchId": "",
"force": false,
"note": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v2alpha/:catalog:setDefaultBranch");
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 \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:catalog:setDefaultBranch" {:content-type :json
:form-params {:branchId ""
:force false
:note ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:catalog:setDefaultBranch"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\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}}/v2alpha/:catalog:setDefaultBranch"),
Content = new StringContent("{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\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}}/v2alpha/:catalog:setDefaultBranch");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:catalog:setDefaultBranch"
payload := strings.NewReader("{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\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/v2alpha/:catalog:setDefaultBranch HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 52
{
"branchId": "",
"force": false,
"note": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:catalog:setDefaultBranch")
.setHeader("content-type", "application/json")
.setBody("{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:catalog:setDefaultBranch"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\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 \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:catalog:setDefaultBranch")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:catalog:setDefaultBranch")
.header("content-type", "application/json")
.body("{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\n}")
.asString();
const data = JSON.stringify({
branchId: '',
force: false,
note: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v2alpha/:catalog:setDefaultBranch');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:catalog:setDefaultBranch',
headers: {'content-type': 'application/json'},
data: {branchId: '', force: false, note: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/:catalog:setDefaultBranch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"branchId":"","force":false,"note":""}'
};
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}}/v2alpha/:catalog:setDefaultBranch',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "branchId": "",\n "force": false,\n "note": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:catalog:setDefaultBranch")
.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/v2alpha/:catalog:setDefaultBranch',
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({branchId: '', force: false, note: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:catalog:setDefaultBranch',
headers: {'content-type': 'application/json'},
body: {branchId: '', force: false, note: ''},
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}}/v2alpha/:catalog:setDefaultBranch');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
branchId: '',
force: false,
note: ''
});
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}}/v2alpha/:catalog:setDefaultBranch',
headers: {'content-type': 'application/json'},
data: {branchId: '', force: false, note: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/:catalog:setDefaultBranch';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"branchId":"","force":false,"note":""}'
};
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 = @{ @"branchId": @"",
@"force": @NO,
@"note": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/:catalog:setDefaultBranch"]
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}}/v2alpha/:catalog:setDefaultBranch" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/:catalog:setDefaultBranch",
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([
'branchId' => '',
'force' => null,
'note' => ''
]),
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}}/v2alpha/:catalog:setDefaultBranch', [
'body' => '{
"branchId": "",
"force": false,
"note": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:catalog:setDefaultBranch');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'branchId' => '',
'force' => null,
'note' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'branchId' => '',
'force' => null,
'note' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/:catalog:setDefaultBranch');
$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}}/v2alpha/:catalog:setDefaultBranch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"branchId": "",
"force": false,
"note": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:catalog:setDefaultBranch' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"branchId": "",
"force": false,
"note": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:catalog:setDefaultBranch", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:catalog:setDefaultBranch"
payload = {
"branchId": "",
"force": False,
"note": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:catalog:setDefaultBranch"
payload <- "{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\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}}/v2alpha/:catalog:setDefaultBranch")
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 \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\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/v2alpha/:catalog:setDefaultBranch') do |req|
req.body = "{\n \"branchId\": \"\",\n \"force\": false,\n \"note\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:catalog:setDefaultBranch";
let payload = json!({
"branchId": "",
"force": false,
"note": ""
});
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}}/v2alpha/:catalog:setDefaultBranch \
--header 'content-type: application/json' \
--data '{
"branchId": "",
"force": false,
"note": ""
}'
echo '{
"branchId": "",
"force": false,
"note": ""
}' | \
http POST {{baseUrl}}/v2alpha/:catalog:setDefaultBranch \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "branchId": "",\n "force": false,\n "note": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:catalog:setDefaultBranch
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"branchId": "",
"force": false,
"note": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:catalog:setDefaultBranch")! 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
retail.projects.locations.catalogs.userEvents.collect
{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:collect");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:parent/userEvents:collect")
require "http/client"
url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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/v2alpha/:parent/userEvents:collect HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:parent/userEvents:collect")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:collect")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:collect');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v2alpha/:parent/userEvents:collect'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:collect',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:collect" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:collect');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/userEvents:collect');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:parent/userEvents:collect');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:parent/userEvents:collect' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/userEvents:collect' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:parent/userEvents:collect")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/userEvents:collect"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:parent/userEvents:collect"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/: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/v2alpha/:parent/userEvents:collect') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:collect
http GET {{baseUrl}}/v2alpha/:parent/userEvents:collect
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:parent/userEvents:collect
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/: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
retail.projects.locations.catalogs.userEvents.import
{{baseUrl}}/v2alpha/:parent/userEvents:import
QUERY PARAMS
parent
BODY json
{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"userEventInlineSource": {
"userEvents": [
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"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}}/v2alpha/: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:parent/userEvents:import" {:content-type :json
:form-params {:errorsConfig {:gcsPrefix ""}
:inputConfig {:bigQuerySource {:dataSchema ""
:datasetId ""
:gcsStagingDir ""
:partitionDate {:day 0
:month 0
:year 0}
:projectId ""
:tableId ""}
:gcsSource {:dataSchema ""
:inputUris []}
:userEventInlineSource {:userEvents [{:attributes {}
:attributionToken ""
:cartId ""
:completionDetail {:completionAttributionToken ""
:selectedPosition 0
:selectedSuggestion ""}
:entity ""
:eventTime ""
:eventType ""
:experimentIds []
:filter ""
:offset 0
:orderBy ""
:pageCategories []
:pageViewId ""
:productDetails [{:product {:attributes {}
:audience {:ageGroups []
:genders []}
:availability ""
:availableQuantity 0
:availableTime ""
:brands []
:categories []
:collectionMemberIds []
:colorInfo {:colorFamilies []
:colors []}
:conditions []
:description ""
:expireTime ""
:fulfillmentInfo [{:placeIds []
:type ""}]
:gtin ""
:id ""
:images [{:height 0
:uri ""
:width 0}]
:languageCode ""
:localInventories [{:attributes {}
:fulfillmentTypes []
:placeId ""
:priceInfo {:cost ""
:currencyCode ""
:originalPrice ""
:price ""
:priceEffectiveTime ""
:priceExpireTime ""
:priceRange {:originalPrice {:exclusiveMaximum ""
:exclusiveMinimum ""
:maximum ""
:minimum ""}
:price {}}}}]
:materials []
:name ""
:patterns []
:priceInfo {}
:primaryProductId ""
:promotions [{:promotionId ""}]
:publishTime ""
:rating {:averageRating ""
:ratingCount 0
:ratingHistogram []}
:retrievableFields ""
:sizes []
:tags []
:title ""
:ttl ""
:type ""
:uri ""
:variants []}
:quantity 0}]
:purchaseTransaction {:cost ""
:currencyCode ""
:id ""
:revenue ""
:tax ""}
:referrerUri ""
:searchQuery ""
:sessionId ""
:uri ""
:userInfo {:directUserRequest false
:ipAddress ""
:userAgent ""
:userId ""}
:visitorId ""}]}}}})
require "http/client"
url = "{{baseUrl}}/v2alpha/: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\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}}/v2alpha/:parent/userEvents:import"),
Content = new StringContent("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\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}}/v2alpha/: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/userEvents:import"
payload := strings.NewReader("{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\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/v2alpha/:parent/userEvents:import HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 4195
{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"userEventInlineSource": {
"userEvents": [
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}
]
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\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 \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/userEvents:import")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\n }\n }\n}")
.asString();
const data = JSON.stringify({
errorsConfig: {
gcsPrefix: ''
},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {
day: 0,
month: 0,
year: 0
},
projectId: '',
tableId: ''
},
gcsSource: {
dataSchema: '',
inputUris: []
},
userEventInlineSource: {
userEvents: [
{
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {
completionAttributionToken: '',
selectedPosition: 0,
selectedSuggestion: ''
},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {
cost: '',
currencyCode: '',
id: '',
revenue: '',
tax: ''
},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:import');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/userEvents:import',
headers: {'content-type': 'application/json'},
data: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
},
gcsSource: {dataSchema: '', inputUris: []},
userEventInlineSource: {
userEvents: [
{
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"errorsConfig":{"gcsPrefix":""},"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","partitionDate":{"day":0,"month":0,"year":0},"projectId":"","tableId":""},"gcsSource":{"dataSchema":"","inputUris":[]},"userEventInlineSource":{"userEvents":[{"attributes":{},"attributionToken":"","cartId":"","completionDetail":{"completionAttributionToken":"","selectedPosition":0,"selectedSuggestion":""},"entity":"","eventTime":"","eventType":"","experimentIds":[],"filter":"","offset":0,"orderBy":"","pageCategories":[],"pageViewId":"","productDetails":[{"product":{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]},"quantity":0}],"purchaseTransaction":{"cost":"","currencyCode":"","id":"","revenue":"","tax":""},"referrerUri":"","searchQuery":"","sessionId":"","uri":"","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}}/v2alpha/: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 "partitionDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "projectId": "",\n "tableId": ""\n },\n "gcsSource": {\n "dataSchema": "",\n "inputUris": []\n },\n "userEventInlineSource": {\n "userEvents": [\n {\n "attributes": {},\n "attributionToken": "",\n "cartId": "",\n "completionDetail": {\n "completionAttributionToken": "",\n "selectedPosition": 0,\n "selectedSuggestion": ""\n },\n "entity": "",\n "eventTime": "",\n "eventType": "",\n "experimentIds": [],\n "filter": "",\n "offset": 0,\n "orderBy": "",\n "pageCategories": [],\n "pageViewId": "",\n "productDetails": [\n {\n "product": {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n },\n "quantity": 0\n }\n ],\n "purchaseTransaction": {\n "cost": "",\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "tax": ""\n },\n "referrerUri": "",\n "searchQuery": "",\n "sessionId": "",\n "uri": "",\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": ""\n },\n "visitorId": ""\n }\n ]\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 \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/: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/v2alpha/: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: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
},
gcsSource: {dataSchema: '', inputUris: []},
userEventInlineSource: {
userEvents: [
{
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
visitorId: ''
}
]
}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/userEvents:import',
headers: {'content-type': 'application/json'},
body: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
},
gcsSource: {dataSchema: '', inputUris: []},
userEventInlineSource: {
userEvents: [
{
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:import');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
errorsConfig: {
gcsPrefix: ''
},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {
day: 0,
month: 0,
year: 0
},
projectId: '',
tableId: ''
},
gcsSource: {
dataSchema: '',
inputUris: []
},
userEventInlineSource: {
userEvents: [
{
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {
completionAttributionToken: '',
selectedPosition: 0,
selectedSuggestion: ''
},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {
cost: '',
currencyCode: '',
id: '',
revenue: '',
tax: ''
},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:import',
headers: {'content-type': 'application/json'},
data: {
errorsConfig: {gcsPrefix: ''},
inputConfig: {
bigQuerySource: {
dataSchema: '',
datasetId: '',
gcsStagingDir: '',
partitionDate: {day: 0, month: 0, year: 0},
projectId: '',
tableId: ''
},
gcsSource: {dataSchema: '', inputUris: []},
userEventInlineSource: {
userEvents: [
{
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:import';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"errorsConfig":{"gcsPrefix":""},"inputConfig":{"bigQuerySource":{"dataSchema":"","datasetId":"","gcsStagingDir":"","partitionDate":{"day":0,"month":0,"year":0},"projectId":"","tableId":""},"gcsSource":{"dataSchema":"","inputUris":[]},"userEventInlineSource":{"userEvents":[{"attributes":{},"attributionToken":"","cartId":"","completionDetail":{"completionAttributionToken":"","selectedPosition":0,"selectedSuggestion":""},"entity":"","eventTime":"","eventType":"","experimentIds":[],"filter":"","offset":0,"orderBy":"","pageCategories":[],"pageViewId":"","productDetails":[{"product":{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]},"quantity":0}],"purchaseTransaction":{"cost":"","currencyCode":"","id":"","revenue":"","tax":""},"referrerUri":"","searchQuery":"","sessionId":"","uri":"","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 = @{ @"errorsConfig": @{ @"gcsPrefix": @"" },
@"inputConfig": @{ @"bigQuerySource": @{ @"dataSchema": @"", @"datasetId": @"", @"gcsStagingDir": @"", @"partitionDate": @{ @"day": @0, @"month": @0, @"year": @0 }, @"projectId": @"", @"tableId": @"" }, @"gcsSource": @{ @"dataSchema": @"", @"inputUris": @[ ] }, @"userEventInlineSource": @{ @"userEvents": @[ @{ @"attributes": @{ }, @"attributionToken": @"", @"cartId": @"", @"completionDetail": @{ @"completionAttributionToken": @"", @"selectedPosition": @0, @"selectedSuggestion": @"" }, @"entity": @"", @"eventTime": @"", @"eventType": @"", @"experimentIds": @[ ], @"filter": @"", @"offset": @0, @"orderBy": @"", @"pageCategories": @[ ], @"pageViewId": @"", @"productDetails": @[ @{ @"product": @{ @"attributes": @{ }, @"audience": @{ @"ageGroups": @[ ], @"genders": @[ ] }, @"availability": @"", @"availableQuantity": @0, @"availableTime": @"", @"brands": @[ ], @"categories": @[ ], @"collectionMemberIds": @[ ], @"colorInfo": @{ @"colorFamilies": @[ ], @"colors": @[ ] }, @"conditions": @[ ], @"description": @"", @"expireTime": @"", @"fulfillmentInfo": @[ @{ @"placeIds": @[ ], @"type": @"" } ], @"gtin": @"", @"id": @"", @"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ], @"languageCode": @"", @"localInventories": @[ @{ @"attributes": @{ }, @"fulfillmentTypes": @[ ], @"placeId": @"", @"priceInfo": @{ @"cost": @"", @"currencyCode": @"", @"originalPrice": @"", @"price": @"", @"priceEffectiveTime": @"", @"priceExpireTime": @"", @"priceRange": @{ @"originalPrice": @{ @"exclusiveMaximum": @"", @"exclusiveMinimum": @"", @"maximum": @"", @"minimum": @"" }, @"price": @{ } } } } ], @"materials": @[ ], @"name": @"", @"patterns": @[ ], @"priceInfo": @{ }, @"primaryProductId": @"", @"promotions": @[ @{ @"promotionId": @"" } ], @"publishTime": @"", @"rating": @{ @"averageRating": @"", @"ratingCount": @0, @"ratingHistogram": @[ ] }, @"retrievableFields": @"", @"sizes": @[ ], @"tags": @[ ], @"title": @"", @"ttl": @"", @"type": @"", @"uri": @"", @"variants": @[ ] }, @"quantity": @0 } ], @"purchaseTransaction": @{ @"cost": @"", @"currencyCode": @"", @"id": @"", @"revenue": @"", @"tax": @"" }, @"referrerUri": @"", @"searchQuery": @"", @"sessionId": @"", @"uri": @"", @"userInfo": @{ @"directUserRequest": @NO, @"ipAddress": @"", @"userAgent": @"", @"userId": @"" }, @"visitorId": @"" } ] } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/: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}}/v2alpha/: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/: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' => '',
'partitionDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'projectId' => '',
'tableId' => ''
],
'gcsSource' => [
'dataSchema' => '',
'inputUris' => [
]
],
'userEventInlineSource' => [
'userEvents' => [
[
'attributes' => [
],
'attributionToken' => '',
'cartId' => '',
'completionDetail' => [
'completionAttributionToken' => '',
'selectedPosition' => 0,
'selectedSuggestion' => ''
],
'entity' => '',
'eventTime' => '',
'eventType' => '',
'experimentIds' => [
],
'filter' => '',
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageViewId' => '',
'productDetails' => [
[
'product' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'quantity' => 0
]
],
'purchaseTransaction' => [
'cost' => '',
'currencyCode' => '',
'id' => '',
'revenue' => '',
'tax' => ''
],
'referrerUri' => '',
'searchQuery' => '',
'sessionId' => '',
'uri' => '',
'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}}/v2alpha/:parent/userEvents:import', [
'body' => '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"userEventInlineSource": {
"userEvents": [
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}
]
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/: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' => '',
'partitionDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'projectId' => '',
'tableId' => ''
],
'gcsSource' => [
'dataSchema' => '',
'inputUris' => [
]
],
'userEventInlineSource' => [
'userEvents' => [
[
'attributes' => [
],
'attributionToken' => '',
'cartId' => '',
'completionDetail' => [
'completionAttributionToken' => '',
'selectedPosition' => 0,
'selectedSuggestion' => ''
],
'entity' => '',
'eventTime' => '',
'eventType' => '',
'experimentIds' => [
],
'filter' => '',
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageViewId' => '',
'productDetails' => [
[
'product' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'quantity' => 0
]
],
'purchaseTransaction' => [
'cost' => '',
'currencyCode' => '',
'id' => '',
'revenue' => '',
'tax' => ''
],
'referrerUri' => '',
'searchQuery' => '',
'sessionId' => '',
'uri' => '',
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'visitorId' => ''
]
]
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'errorsConfig' => [
'gcsPrefix' => ''
],
'inputConfig' => [
'bigQuerySource' => [
'dataSchema' => '',
'datasetId' => '',
'gcsStagingDir' => '',
'partitionDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'projectId' => '',
'tableId' => ''
],
'gcsSource' => [
'dataSchema' => '',
'inputUris' => [
]
],
'userEventInlineSource' => [
'userEvents' => [
[
'attributes' => [
],
'attributionToken' => '',
'cartId' => '',
'completionDetail' => [
'completionAttributionToken' => '',
'selectedPosition' => 0,
'selectedSuggestion' => ''
],
'entity' => '',
'eventTime' => '',
'eventType' => '',
'experimentIds' => [
],
'filter' => '',
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageViewId' => '',
'productDetails' => [
[
'product' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'quantity' => 0
]
],
'purchaseTransaction' => [
'cost' => '',
'currencyCode' => '',
'id' => '',
'revenue' => '',
'tax' => ''
],
'referrerUri' => '',
'searchQuery' => '',
'sessionId' => '',
'uri' => '',
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'visitorId' => ''
]
]
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"userEventInlineSource": {
"userEvents": [
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}
]
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/userEvents:import' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"userEventInlineSource": {
"userEvents": [
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}
]
}
}
}'
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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:parent/userEvents:import", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/userEvents:import"
payload = {
"errorsConfig": { "gcsPrefix": "" },
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"userEventInlineSource": { "userEvents": [
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [{ "promotionId": "" }],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"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}}/v2alpha/:parent/userEvents:import"
payload <- "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\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}}/v2alpha/: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 \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\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/v2alpha/:parent/userEvents:import') do |req|
req.body = "{\n \"errorsConfig\": {\n \"gcsPrefix\": \"\"\n },\n \"inputConfig\": {\n \"bigQuerySource\": {\n \"dataSchema\": \"\",\n \"datasetId\": \"\",\n \"gcsStagingDir\": \"\",\n \"partitionDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"projectId\": \"\",\n \"tableId\": \"\"\n },\n \"gcsSource\": {\n \"dataSchema\": \"\",\n \"inputUris\": []\n },\n \"userEventInlineSource\": {\n \"userEvents\": [\n {\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n }\n ]\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}}/v2alpha/:parent/userEvents:import";
let payload = json!({
"errorsConfig": json!({"gcsPrefix": ""}),
"inputConfig": json!({
"bigQuerySource": json!({
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": json!({
"day": 0,
"month": 0,
"year": 0
}),
"projectId": "",
"tableId": ""
}),
"gcsSource": json!({
"dataSchema": "",
"inputUris": ()
}),
"userEventInlineSource": json!({"userEvents": (
json!({
"attributes": json!({}),
"attributionToken": "",
"cartId": "",
"completionDetail": json!({
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
}),
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": (),
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": (),
"pageViewId": "",
"productDetails": (
json!({
"product": json!({
"attributes": json!({}),
"audience": json!({
"ageGroups": (),
"genders": ()
}),
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": (),
"categories": (),
"collectionMemberIds": (),
"colorInfo": json!({
"colorFamilies": (),
"colors": ()
}),
"conditions": (),
"description": "",
"expireTime": "",
"fulfillmentInfo": (
json!({
"placeIds": (),
"type": ""
})
),
"gtin": "",
"id": "",
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"languageCode": "",
"localInventories": (
json!({
"attributes": json!({}),
"fulfillmentTypes": (),
"placeId": "",
"priceInfo": json!({
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": json!({
"originalPrice": json!({
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}),
"price": json!({})
})
})
})
),
"materials": (),
"name": "",
"patterns": (),
"priceInfo": json!({}),
"primaryProductId": "",
"promotions": (json!({"promotionId": ""})),
"publishTime": "",
"rating": json!({
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": ()
}),
"retrievableFields": "",
"sizes": (),
"tags": (),
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": ()
}),
"quantity": 0
})
),
"purchaseTransaction": json!({
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
}),
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"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}}/v2alpha/:parent/userEvents:import \
--header 'content-type: application/json' \
--data '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"userEventInlineSource": {
"userEvents": [
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}
]
}
}
}'
echo '{
"errorsConfig": {
"gcsPrefix": ""
},
"inputConfig": {
"bigQuerySource": {
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": {
"day": 0,
"month": 0,
"year": 0
},
"projectId": "",
"tableId": ""
},
"gcsSource": {
"dataSchema": "",
"inputUris": []
},
"userEventInlineSource": {
"userEvents": [
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}
]
}
}
}' | \
http POST {{baseUrl}}/v2alpha/: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 "partitionDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "projectId": "",\n "tableId": ""\n },\n "gcsSource": {\n "dataSchema": "",\n "inputUris": []\n },\n "userEventInlineSource": {\n "userEvents": [\n {\n "attributes": {},\n "attributionToken": "",\n "cartId": "",\n "completionDetail": {\n "completionAttributionToken": "",\n "selectedPosition": 0,\n "selectedSuggestion": ""\n },\n "entity": "",\n "eventTime": "",\n "eventType": "",\n "experimentIds": [],\n "filter": "",\n "offset": 0,\n "orderBy": "",\n "pageCategories": [],\n "pageViewId": "",\n "productDetails": [\n {\n "product": {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n },\n "quantity": 0\n }\n ],\n "purchaseTransaction": {\n "cost": "",\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "tax": ""\n },\n "referrerUri": "",\n "searchQuery": "",\n "sessionId": "",\n "uri": "",\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": ""\n },\n "visitorId": ""\n }\n ]\n }\n }\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:parent/userEvents:import
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"errorsConfig": ["gcsPrefix": ""],
"inputConfig": [
"bigQuerySource": [
"dataSchema": "",
"datasetId": "",
"gcsStagingDir": "",
"partitionDate": [
"day": 0,
"month": 0,
"year": 0
],
"projectId": "",
"tableId": ""
],
"gcsSource": [
"dataSchema": "",
"inputUris": []
],
"userEventInlineSource": ["userEvents": [
[
"attributes": [],
"attributionToken": "",
"cartId": "",
"completionDetail": [
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
],
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
[
"product": [
"attributes": [],
"audience": [
"ageGroups": [],
"genders": []
],
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": [
"colorFamilies": [],
"colors": []
],
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
[
"placeIds": [],
"type": ""
]
],
"gtin": "",
"id": "",
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"languageCode": "",
"localInventories": [
[
"attributes": [],
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": [
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": [
"originalPrice": [
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
],
"price": []
]
]
]
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": [],
"primaryProductId": "",
"promotions": [["promotionId": ""]],
"publishTime": "",
"rating": [
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
],
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
],
"quantity": 0
]
],
"purchaseTransaction": [
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
],
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": [
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
],
"visitorId": ""
]
]]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/: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()
POST
retail.projects.locations.catalogs.userEvents.purge
{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:purge" {:content-type :json
:form-params {:filter ""
:force false}})
require "http/client"
url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:purge")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:purge');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:purge', [
'body' => '{
"filter": "",
"force": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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/v2alpha/:parent/userEvents:purge", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:purge \
--header 'content-type: application/json' \
--data '{
"filter": "",
"force": false
}'
echo '{
"filter": "",
"force": false
}' | \
http POST {{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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
retail.projects.locations.catalogs.userEvents.rejoin
{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:rejoin" {:content-type :json
:form-params {:userEventRejoinScope ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:rejoin")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:rejoin');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:rejoin', [
'body' => '{
"userEventRejoinScope": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:rejoin' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"userEventRejoinScope": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/: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/v2alpha/:parent/userEvents:rejoin", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:parent/userEvents:rejoin \
--header 'content-type: application/json' \
--data '{
"userEventRejoinScope": ""
}'
echo '{
"userEventRejoinScope": ""
}' | \
http POST {{baseUrl}}/v2alpha/:parent/userEvents:rejoin \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "userEventRejoinScope": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/: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}}/v2alpha/: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
retail.projects.locations.catalogs.userEvents.write
{{baseUrl}}/v2alpha/:parent/userEvents:write
QUERY PARAMS
parent
BODY json
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"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}}/v2alpha/: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 \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v2alpha/:parent/userEvents:write" {:content-type :json
:form-params {:attributes {}
:attributionToken ""
:cartId ""
:completionDetail {:completionAttributionToken ""
:selectedPosition 0
:selectedSuggestion ""}
:entity ""
:eventTime ""
:eventType ""
:experimentIds []
:filter ""
:offset 0
:orderBy ""
:pageCategories []
:pageViewId ""
:productDetails [{:product {:attributes {}
:audience {:ageGroups []
:genders []}
:availability ""
:availableQuantity 0
:availableTime ""
:brands []
:categories []
:collectionMemberIds []
:colorInfo {:colorFamilies []
:colors []}
:conditions []
:description ""
:expireTime ""
:fulfillmentInfo [{:placeIds []
:type ""}]
:gtin ""
:id ""
:images [{:height 0
:uri ""
:width 0}]
:languageCode ""
:localInventories [{:attributes {}
:fulfillmentTypes []
:placeId ""
:priceInfo {:cost ""
:currencyCode ""
:originalPrice ""
:price ""
:priceEffectiveTime ""
:priceExpireTime ""
:priceRange {:originalPrice {:exclusiveMaximum ""
:exclusiveMinimum ""
:maximum ""
:minimum ""}
:price {}}}}]
:materials []
:name ""
:patterns []
:priceInfo {}
:primaryProductId ""
:promotions [{:promotionId ""}]
:publishTime ""
:rating {:averageRating ""
:ratingCount 0
:ratingHistogram []}
:retrievableFields ""
:sizes []
:tags []
:title ""
:ttl ""
:type ""
:uri ""
:variants []}
:quantity 0}]
:purchaseTransaction {:cost ""
:currencyCode ""
:id ""
:revenue ""
:tax ""}
:referrerUri ""
:searchQuery ""
:sessionId ""
:uri ""
:userInfo {:directUserRequest false
:ipAddress ""
:userAgent ""
:userId ""}
:visitorId ""}})
require "http/client"
url = "{{baseUrl}}/v2alpha/:parent/userEvents:write"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\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}}/v2alpha/:parent/userEvents:write"),
Content = new StringContent("{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\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}}/v2alpha/:parent/userEvents:write");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/:parent/userEvents:write"
payload := strings.NewReader("{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\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/v2alpha/:parent/userEvents:write HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2738
{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v2alpha/:parent/userEvents:write")
.setHeader("content-type", "application/json")
.setBody("{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/:parent/userEvents:write"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\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 \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v2alpha/:parent/userEvents:write")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v2alpha/:parent/userEvents:write")
.header("content-type", "application/json")
.body("{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n}")
.asString();
const data = JSON.stringify({
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {
completionAttributionToken: '',
selectedPosition: 0,
selectedSuggestion: ''
},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {
cost: '',
currencyCode: '',
id: '',
revenue: '',
tax: ''
},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:write');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/userEvents:write',
headers: {'content-type': 'application/json'},
data: {
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:write';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attributes":{},"attributionToken":"","cartId":"","completionDetail":{"completionAttributionToken":"","selectedPosition":0,"selectedSuggestion":""},"entity":"","eventTime":"","eventType":"","experimentIds":[],"filter":"","offset":0,"orderBy":"","pageCategories":[],"pageViewId":"","productDetails":[{"product":{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]},"quantity":0}],"purchaseTransaction":{"cost":"","currencyCode":"","id":"","revenue":"","tax":""},"referrerUri":"","searchQuery":"","sessionId":"","uri":"","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}}/v2alpha/:parent/userEvents:write',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "attributes": {},\n "attributionToken": "",\n "cartId": "",\n "completionDetail": {\n "completionAttributionToken": "",\n "selectedPosition": 0,\n "selectedSuggestion": ""\n },\n "entity": "",\n "eventTime": "",\n "eventType": "",\n "experimentIds": [],\n "filter": "",\n "offset": 0,\n "orderBy": "",\n "pageCategories": [],\n "pageViewId": "",\n "productDetails": [\n {\n "product": {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n },\n "quantity": 0\n }\n ],\n "purchaseTransaction": {\n "cost": "",\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "tax": ""\n },\n "referrerUri": "",\n "searchQuery": "",\n "sessionId": "",\n "uri": "",\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": ""\n },\n "visitorId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/: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/v2alpha/: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({
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
userInfo: {directUserRequest: false, ipAddress: '', userAgent: '', userId: ''},
visitorId: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v2alpha/:parent/userEvents:write',
headers: {'content-type': 'application/json'},
body: {
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:write');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {
completionAttributionToken: '',
selectedPosition: 0,
selectedSuggestion: ''
},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {
ageGroups: [],
genders: []
},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {
colorFamilies: [],
colors: []
},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [
{
placeIds: [],
type: ''
}
],
gtin: '',
id: '',
images: [
{
height: 0,
uri: '',
width: 0
}
],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {
exclusiveMaximum: '',
exclusiveMinimum: '',
maximum: '',
minimum: ''
},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [
{
promotionId: ''
}
],
publishTime: '',
rating: {
averageRating: '',
ratingCount: 0,
ratingHistogram: []
},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {
cost: '',
currencyCode: '',
id: '',
revenue: '',
tax: ''
},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:write',
headers: {'content-type': 'application/json'},
data: {
attributes: {},
attributionToken: '',
cartId: '',
completionDetail: {completionAttributionToken: '', selectedPosition: 0, selectedSuggestion: ''},
entity: '',
eventTime: '',
eventType: '',
experimentIds: [],
filter: '',
offset: 0,
orderBy: '',
pageCategories: [],
pageViewId: '',
productDetails: [
{
product: {
attributes: {},
audience: {ageGroups: [], genders: []},
availability: '',
availableQuantity: 0,
availableTime: '',
brands: [],
categories: [],
collectionMemberIds: [],
colorInfo: {colorFamilies: [], colors: []},
conditions: [],
description: '',
expireTime: '',
fulfillmentInfo: [{placeIds: [], type: ''}],
gtin: '',
id: '',
images: [{height: 0, uri: '', width: 0}],
languageCode: '',
localInventories: [
{
attributes: {},
fulfillmentTypes: [],
placeId: '',
priceInfo: {
cost: '',
currencyCode: '',
originalPrice: '',
price: '',
priceEffectiveTime: '',
priceExpireTime: '',
priceRange: {
originalPrice: {exclusiveMaximum: '', exclusiveMinimum: '', maximum: '', minimum: ''},
price: {}
}
}
}
],
materials: [],
name: '',
patterns: [],
priceInfo: {},
primaryProductId: '',
promotions: [{promotionId: ''}],
publishTime: '',
rating: {averageRating: '', ratingCount: 0, ratingHistogram: []},
retrievableFields: '',
sizes: [],
tags: [],
title: '',
ttl: '',
type: '',
uri: '',
variants: []
},
quantity: 0
}
],
purchaseTransaction: {cost: '', currencyCode: '', id: '', revenue: '', tax: ''},
referrerUri: '',
searchQuery: '',
sessionId: '',
uri: '',
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}}/v2alpha/:parent/userEvents:write';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attributes":{},"attributionToken":"","cartId":"","completionDetail":{"completionAttributionToken":"","selectedPosition":0,"selectedSuggestion":""},"entity":"","eventTime":"","eventType":"","experimentIds":[],"filter":"","offset":0,"orderBy":"","pageCategories":[],"pageViewId":"","productDetails":[{"product":{"attributes":{},"audience":{"ageGroups":[],"genders":[]},"availability":"","availableQuantity":0,"availableTime":"","brands":[],"categories":[],"collectionMemberIds":[],"colorInfo":{"colorFamilies":[],"colors":[]},"conditions":[],"description":"","expireTime":"","fulfillmentInfo":[{"placeIds":[],"type":""}],"gtin":"","id":"","images":[{"height":0,"uri":"","width":0}],"languageCode":"","localInventories":[{"attributes":{},"fulfillmentTypes":[],"placeId":"","priceInfo":{"cost":"","currencyCode":"","originalPrice":"","price":"","priceEffectiveTime":"","priceExpireTime":"","priceRange":{"originalPrice":{"exclusiveMaximum":"","exclusiveMinimum":"","maximum":"","minimum":""},"price":{}}}}],"materials":[],"name":"","patterns":[],"priceInfo":{},"primaryProductId":"","promotions":[{"promotionId":""}],"publishTime":"","rating":{"averageRating":"","ratingCount":0,"ratingHistogram":[]},"retrievableFields":"","sizes":[],"tags":[],"title":"","ttl":"","type":"","uri":"","variants":[]},"quantity":0}],"purchaseTransaction":{"cost":"","currencyCode":"","id":"","revenue":"","tax":""},"referrerUri":"","searchQuery":"","sessionId":"","uri":"","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 = @{ @"attributes": @{ },
@"attributionToken": @"",
@"cartId": @"",
@"completionDetail": @{ @"completionAttributionToken": @"", @"selectedPosition": @0, @"selectedSuggestion": @"" },
@"entity": @"",
@"eventTime": @"",
@"eventType": @"",
@"experimentIds": @[ ],
@"filter": @"",
@"offset": @0,
@"orderBy": @"",
@"pageCategories": @[ ],
@"pageViewId": @"",
@"productDetails": @[ @{ @"product": @{ @"attributes": @{ }, @"audience": @{ @"ageGroups": @[ ], @"genders": @[ ] }, @"availability": @"", @"availableQuantity": @0, @"availableTime": @"", @"brands": @[ ], @"categories": @[ ], @"collectionMemberIds": @[ ], @"colorInfo": @{ @"colorFamilies": @[ ], @"colors": @[ ] }, @"conditions": @[ ], @"description": @"", @"expireTime": @"", @"fulfillmentInfo": @[ @{ @"placeIds": @[ ], @"type": @"" } ], @"gtin": @"", @"id": @"", @"images": @[ @{ @"height": @0, @"uri": @"", @"width": @0 } ], @"languageCode": @"", @"localInventories": @[ @{ @"attributes": @{ }, @"fulfillmentTypes": @[ ], @"placeId": @"", @"priceInfo": @{ @"cost": @"", @"currencyCode": @"", @"originalPrice": @"", @"price": @"", @"priceEffectiveTime": @"", @"priceExpireTime": @"", @"priceRange": @{ @"originalPrice": @{ @"exclusiveMaximum": @"", @"exclusiveMinimum": @"", @"maximum": @"", @"minimum": @"" }, @"price": @{ } } } } ], @"materials": @[ ], @"name": @"", @"patterns": @[ ], @"priceInfo": @{ }, @"primaryProductId": @"", @"promotions": @[ @{ @"promotionId": @"" } ], @"publishTime": @"", @"rating": @{ @"averageRating": @"", @"ratingCount": @0, @"ratingHistogram": @[ ] }, @"retrievableFields": @"", @"sizes": @[ ], @"tags": @[ ], @"title": @"", @"ttl": @"", @"type": @"", @"uri": @"", @"variants": @[ ] }, @"quantity": @0 } ],
@"purchaseTransaction": @{ @"cost": @"", @"currencyCode": @"", @"id": @"", @"revenue": @"", @"tax": @"" },
@"referrerUri": @"",
@"searchQuery": @"",
@"sessionId": @"",
@"uri": @"",
@"userInfo": @{ @"directUserRequest": @NO, @"ipAddress": @"", @"userAgent": @"", @"userId": @"" },
@"visitorId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:write" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/: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([
'attributes' => [
],
'attributionToken' => '',
'cartId' => '',
'completionDetail' => [
'completionAttributionToken' => '',
'selectedPosition' => 0,
'selectedSuggestion' => ''
],
'entity' => '',
'eventTime' => '',
'eventType' => '',
'experimentIds' => [
],
'filter' => '',
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageViewId' => '',
'productDetails' => [
[
'product' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'quantity' => 0
]
],
'purchaseTransaction' => [
'cost' => '',
'currencyCode' => '',
'id' => '',
'revenue' => '',
'tax' => ''
],
'referrerUri' => '',
'searchQuery' => '',
'sessionId' => '',
'uri' => '',
'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}}/v2alpha/:parent/userEvents:write', [
'body' => '{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:parent/userEvents:write');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attributes' => [
],
'attributionToken' => '',
'cartId' => '',
'completionDetail' => [
'completionAttributionToken' => '',
'selectedPosition' => 0,
'selectedSuggestion' => ''
],
'entity' => '',
'eventTime' => '',
'eventType' => '',
'experimentIds' => [
],
'filter' => '',
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageViewId' => '',
'productDetails' => [
[
'product' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'quantity' => 0
]
],
'purchaseTransaction' => [
'cost' => '',
'currencyCode' => '',
'id' => '',
'revenue' => '',
'tax' => ''
],
'referrerUri' => '',
'searchQuery' => '',
'sessionId' => '',
'uri' => '',
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'visitorId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attributes' => [
],
'attributionToken' => '',
'cartId' => '',
'completionDetail' => [
'completionAttributionToken' => '',
'selectedPosition' => 0,
'selectedSuggestion' => ''
],
'entity' => '',
'eventTime' => '',
'eventType' => '',
'experimentIds' => [
],
'filter' => '',
'offset' => 0,
'orderBy' => '',
'pageCategories' => [
],
'pageViewId' => '',
'productDetails' => [
[
'product' => [
'attributes' => [
],
'audience' => [
'ageGroups' => [
],
'genders' => [
]
],
'availability' => '',
'availableQuantity' => 0,
'availableTime' => '',
'brands' => [
],
'categories' => [
],
'collectionMemberIds' => [
],
'colorInfo' => [
'colorFamilies' => [
],
'colors' => [
]
],
'conditions' => [
],
'description' => '',
'expireTime' => '',
'fulfillmentInfo' => [
[
'placeIds' => [
],
'type' => ''
]
],
'gtin' => '',
'id' => '',
'images' => [
[
'height' => 0,
'uri' => '',
'width' => 0
]
],
'languageCode' => '',
'localInventories' => [
[
'attributes' => [
],
'fulfillmentTypes' => [
],
'placeId' => '',
'priceInfo' => [
'cost' => '',
'currencyCode' => '',
'originalPrice' => '',
'price' => '',
'priceEffectiveTime' => '',
'priceExpireTime' => '',
'priceRange' => [
'originalPrice' => [
'exclusiveMaximum' => '',
'exclusiveMinimum' => '',
'maximum' => '',
'minimum' => ''
],
'price' => [
]
]
]
]
],
'materials' => [
],
'name' => '',
'patterns' => [
],
'priceInfo' => [
],
'primaryProductId' => '',
'promotions' => [
[
'promotionId' => ''
]
],
'publishTime' => '',
'rating' => [
'averageRating' => '',
'ratingCount' => 0,
'ratingHistogram' => [
]
],
'retrievableFields' => '',
'sizes' => [
],
'tags' => [
],
'title' => '',
'ttl' => '',
'type' => '',
'uri' => '',
'variants' => [
]
],
'quantity' => 0
]
],
'purchaseTransaction' => [
'cost' => '',
'currencyCode' => '',
'id' => '',
'revenue' => '',
'tax' => ''
],
'referrerUri' => '',
'searchQuery' => '',
'sessionId' => '',
'uri' => '',
'userInfo' => [
'directUserRequest' => null,
'ipAddress' => '',
'userAgent' => '',
'userId' => ''
],
'visitorId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v2alpha/: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}}/v2alpha/:parent/userEvents:write' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:parent/userEvents:write' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v2alpha/:parent/userEvents:write", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:parent/userEvents:write"
payload = {
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [{ "promotionId": "" }],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"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}}/v2alpha/:parent/userEvents:write"
payload <- "{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\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}}/v2alpha/: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 \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\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/v2alpha/:parent/userEvents:write') do |req|
req.body = "{\n \"attributes\": {},\n \"attributionToken\": \"\",\n \"cartId\": \"\",\n \"completionDetail\": {\n \"completionAttributionToken\": \"\",\n \"selectedPosition\": 0,\n \"selectedSuggestion\": \"\"\n },\n \"entity\": \"\",\n \"eventTime\": \"\",\n \"eventType\": \"\",\n \"experimentIds\": [],\n \"filter\": \"\",\n \"offset\": 0,\n \"orderBy\": \"\",\n \"pageCategories\": [],\n \"pageViewId\": \"\",\n \"productDetails\": [\n {\n \"product\": {\n \"attributes\": {},\n \"audience\": {\n \"ageGroups\": [],\n \"genders\": []\n },\n \"availability\": \"\",\n \"availableQuantity\": 0,\n \"availableTime\": \"\",\n \"brands\": [],\n \"categories\": [],\n \"collectionMemberIds\": [],\n \"colorInfo\": {\n \"colorFamilies\": [],\n \"colors\": []\n },\n \"conditions\": [],\n \"description\": \"\",\n \"expireTime\": \"\",\n \"fulfillmentInfo\": [\n {\n \"placeIds\": [],\n \"type\": \"\"\n }\n ],\n \"gtin\": \"\",\n \"id\": \"\",\n \"images\": [\n {\n \"height\": 0,\n \"uri\": \"\",\n \"width\": 0\n }\n ],\n \"languageCode\": \"\",\n \"localInventories\": [\n {\n \"attributes\": {},\n \"fulfillmentTypes\": [],\n \"placeId\": \"\",\n \"priceInfo\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"originalPrice\": \"\",\n \"price\": \"\",\n \"priceEffectiveTime\": \"\",\n \"priceExpireTime\": \"\",\n \"priceRange\": {\n \"originalPrice\": {\n \"exclusiveMaximum\": \"\",\n \"exclusiveMinimum\": \"\",\n \"maximum\": \"\",\n \"minimum\": \"\"\n },\n \"price\": {}\n }\n }\n }\n ],\n \"materials\": [],\n \"name\": \"\",\n \"patterns\": [],\n \"priceInfo\": {},\n \"primaryProductId\": \"\",\n \"promotions\": [\n {\n \"promotionId\": \"\"\n }\n ],\n \"publishTime\": \"\",\n \"rating\": {\n \"averageRating\": \"\",\n \"ratingCount\": 0,\n \"ratingHistogram\": []\n },\n \"retrievableFields\": \"\",\n \"sizes\": [],\n \"tags\": [],\n \"title\": \"\",\n \"ttl\": \"\",\n \"type\": \"\",\n \"uri\": \"\",\n \"variants\": []\n },\n \"quantity\": 0\n }\n ],\n \"purchaseTransaction\": {\n \"cost\": \"\",\n \"currencyCode\": \"\",\n \"id\": \"\",\n \"revenue\": \"\",\n \"tax\": \"\"\n },\n \"referrerUri\": \"\",\n \"searchQuery\": \"\",\n \"sessionId\": \"\",\n \"uri\": \"\",\n \"userInfo\": {\n \"directUserRequest\": false,\n \"ipAddress\": \"\",\n \"userAgent\": \"\",\n \"userId\": \"\"\n },\n \"visitorId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/:parent/userEvents:write";
let payload = json!({
"attributes": json!({}),
"attributionToken": "",
"cartId": "",
"completionDetail": json!({
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
}),
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": (),
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": (),
"pageViewId": "",
"productDetails": (
json!({
"product": json!({
"attributes": json!({}),
"audience": json!({
"ageGroups": (),
"genders": ()
}),
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": (),
"categories": (),
"collectionMemberIds": (),
"colorInfo": json!({
"colorFamilies": (),
"colors": ()
}),
"conditions": (),
"description": "",
"expireTime": "",
"fulfillmentInfo": (
json!({
"placeIds": (),
"type": ""
})
),
"gtin": "",
"id": "",
"images": (
json!({
"height": 0,
"uri": "",
"width": 0
})
),
"languageCode": "",
"localInventories": (
json!({
"attributes": json!({}),
"fulfillmentTypes": (),
"placeId": "",
"priceInfo": json!({
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": json!({
"originalPrice": json!({
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
}),
"price": json!({})
})
})
})
),
"materials": (),
"name": "",
"patterns": (),
"priceInfo": json!({}),
"primaryProductId": "",
"promotions": (json!({"promotionId": ""})),
"publishTime": "",
"rating": json!({
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": ()
}),
"retrievableFields": "",
"sizes": (),
"tags": (),
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": ()
}),
"quantity": 0
})
),
"purchaseTransaction": json!({
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
}),
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"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}}/v2alpha/:parent/userEvents:write \
--header 'content-type: application/json' \
--data '{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}'
echo '{
"attributes": {},
"attributionToken": "",
"cartId": "",
"completionDetail": {
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
},
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
{
"product": {
"attributes": {},
"audience": {
"ageGroups": [],
"genders": []
},
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": {
"colorFamilies": [],
"colors": []
},
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
{
"placeIds": [],
"type": ""
}
],
"gtin": "",
"id": "",
"images": [
{
"height": 0,
"uri": "",
"width": 0
}
],
"languageCode": "",
"localInventories": [
{
"attributes": {},
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": {
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": {
"originalPrice": {
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
},
"price": {}
}
}
}
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": {},
"primaryProductId": "",
"promotions": [
{
"promotionId": ""
}
],
"publishTime": "",
"rating": {
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
},
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
},
"quantity": 0
}
],
"purchaseTransaction": {
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
},
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": {
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
},
"visitorId": ""
}' | \
http POST {{baseUrl}}/v2alpha/:parent/userEvents:write \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "attributes": {},\n "attributionToken": "",\n "cartId": "",\n "completionDetail": {\n "completionAttributionToken": "",\n "selectedPosition": 0,\n "selectedSuggestion": ""\n },\n "entity": "",\n "eventTime": "",\n "eventType": "",\n "experimentIds": [],\n "filter": "",\n "offset": 0,\n "orderBy": "",\n "pageCategories": [],\n "pageViewId": "",\n "productDetails": [\n {\n "product": {\n "attributes": {},\n "audience": {\n "ageGroups": [],\n "genders": []\n },\n "availability": "",\n "availableQuantity": 0,\n "availableTime": "",\n "brands": [],\n "categories": [],\n "collectionMemberIds": [],\n "colorInfo": {\n "colorFamilies": [],\n "colors": []\n },\n "conditions": [],\n "description": "",\n "expireTime": "",\n "fulfillmentInfo": [\n {\n "placeIds": [],\n "type": ""\n }\n ],\n "gtin": "",\n "id": "",\n "images": [\n {\n "height": 0,\n "uri": "",\n "width": 0\n }\n ],\n "languageCode": "",\n "localInventories": [\n {\n "attributes": {},\n "fulfillmentTypes": [],\n "placeId": "",\n "priceInfo": {\n "cost": "",\n "currencyCode": "",\n "originalPrice": "",\n "price": "",\n "priceEffectiveTime": "",\n "priceExpireTime": "",\n "priceRange": {\n "originalPrice": {\n "exclusiveMaximum": "",\n "exclusiveMinimum": "",\n "maximum": "",\n "minimum": ""\n },\n "price": {}\n }\n }\n }\n ],\n "materials": [],\n "name": "",\n "patterns": [],\n "priceInfo": {},\n "primaryProductId": "",\n "promotions": [\n {\n "promotionId": ""\n }\n ],\n "publishTime": "",\n "rating": {\n "averageRating": "",\n "ratingCount": 0,\n "ratingHistogram": []\n },\n "retrievableFields": "",\n "sizes": [],\n "tags": [],\n "title": "",\n "ttl": "",\n "type": "",\n "uri": "",\n "variants": []\n },\n "quantity": 0\n }\n ],\n "purchaseTransaction": {\n "cost": "",\n "currencyCode": "",\n "id": "",\n "revenue": "",\n "tax": ""\n },\n "referrerUri": "",\n "searchQuery": "",\n "sessionId": "",\n "uri": "",\n "userInfo": {\n "directUserRequest": false,\n "ipAddress": "",\n "userAgent": "",\n "userId": ""\n },\n "visitorId": ""\n}' \
--output-document \
- {{baseUrl}}/v2alpha/:parent/userEvents:write
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"attributes": [],
"attributionToken": "",
"cartId": "",
"completionDetail": [
"completionAttributionToken": "",
"selectedPosition": 0,
"selectedSuggestion": ""
],
"entity": "",
"eventTime": "",
"eventType": "",
"experimentIds": [],
"filter": "",
"offset": 0,
"orderBy": "",
"pageCategories": [],
"pageViewId": "",
"productDetails": [
[
"product": [
"attributes": [],
"audience": [
"ageGroups": [],
"genders": []
],
"availability": "",
"availableQuantity": 0,
"availableTime": "",
"brands": [],
"categories": [],
"collectionMemberIds": [],
"colorInfo": [
"colorFamilies": [],
"colors": []
],
"conditions": [],
"description": "",
"expireTime": "",
"fulfillmentInfo": [
[
"placeIds": [],
"type": ""
]
],
"gtin": "",
"id": "",
"images": [
[
"height": 0,
"uri": "",
"width": 0
]
],
"languageCode": "",
"localInventories": [
[
"attributes": [],
"fulfillmentTypes": [],
"placeId": "",
"priceInfo": [
"cost": "",
"currencyCode": "",
"originalPrice": "",
"price": "",
"priceEffectiveTime": "",
"priceExpireTime": "",
"priceRange": [
"originalPrice": [
"exclusiveMaximum": "",
"exclusiveMinimum": "",
"maximum": "",
"minimum": ""
],
"price": []
]
]
]
],
"materials": [],
"name": "",
"patterns": [],
"priceInfo": [],
"primaryProductId": "",
"promotions": [["promotionId": ""]],
"publishTime": "",
"rating": [
"averageRating": "",
"ratingCount": 0,
"ratingHistogram": []
],
"retrievableFields": "",
"sizes": [],
"tags": [],
"title": "",
"ttl": "",
"type": "",
"uri": "",
"variants": []
],
"quantity": 0
]
],
"purchaseTransaction": [
"cost": "",
"currencyCode": "",
"id": "",
"revenue": "",
"tax": ""
],
"referrerUri": "",
"searchQuery": "",
"sessionId": "",
"uri": "",
"userInfo": [
"directUserRequest": false,
"ipAddress": "",
"userAgent": "",
"userId": ""
],
"visitorId": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/: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
retail.projects.operations.get
{{baseUrl}}/v2alpha/: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}}/v2alpha/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:name")
require "http/client"
url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v2alpha/:name");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/: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/v2alpha/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/: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}}/v2alpha/:name")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/: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}}/v2alpha/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2alpha/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/: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}}/v2alpha/:name',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/:name")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:name" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/: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}}/v2alpha/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:name');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:name');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:name' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:name' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:name"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:name"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/: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/v2alpha/:name') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/:name
http GET {{baseUrl}}/v2alpha/:name
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/:name")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
retail.projects.operations.list
{{baseUrl}}/v2alpha/: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}}/v2alpha/:name/operations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v2alpha/:name/operations")
require "http/client"
url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:name/operations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v2alpha/: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/v2alpha/:name/operations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v2alpha/:name/operations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v2alpha/: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}}/v2alpha/:name/operations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v2alpha/: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}}/v2alpha/:name/operations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v2alpha/:name/operations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v2alpha/: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}}/v2alpha/:name/operations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v2alpha/: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/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/: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}}/v2alpha/:name/operations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v2alpha/: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}}/v2alpha/:name/operations');
echo $response->getBody();
setUrl('{{baseUrl}}/v2alpha/:name/operations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v2alpha/:name/operations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v2alpha/:name/operations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v2alpha/:name/operations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v2alpha/:name/operations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v2alpha/:name/operations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v2alpha/:name/operations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v2alpha/: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/v2alpha/:name/operations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v2alpha/: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}}/v2alpha/:name/operations
http GET {{baseUrl}}/v2alpha/:name/operations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v2alpha/:name/operations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v2alpha/: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()