Google My Business API
POST
mybusiness.accounts.create
{{baseUrl}}/v4/accounts
BODY json
{
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": {
"phoneNumber": "",
"postalAddress": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"registeredDomain": ""
},
"permissionLevel": "",
"role": "",
"state": {
"status": ""
},
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/accounts");
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 \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/accounts" {:content-type :json
:form-params {:accountName ""
:accountNumber ""
:name ""
:organizationInfo {:phoneNumber ""
:postalAddress {:addressLines []
:administrativeArea ""
:languageCode ""
:locality ""
:organization ""
:postalCode ""
:recipients []
:regionCode ""
:revision 0
:sortingCode ""
:sublocality ""}
:registeredDomain ""}
:permissionLevel ""
:role ""
:state {:status ""}
:type ""}})
require "http/client"
url = "{{baseUrl}}/v4/accounts"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\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}}/v4/accounts"),
Content = new StringContent("{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\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}}/v4/accounts");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/accounts"
payload := strings.NewReader("{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\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/v4/accounts HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 531
{
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": {
"phoneNumber": "",
"postalAddress": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"registeredDomain": ""
},
"permissionLevel": "",
"role": "",
"state": {
"status": ""
},
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/accounts")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/accounts"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\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 \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/accounts")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/accounts")
.header("content-type", "application/json")
.body("{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
accountName: '',
accountNumber: '',
name: '',
organizationInfo: {
phoneNumber: '',
postalAddress: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
registeredDomain: ''
},
permissionLevel: '',
role: '',
state: {
status: ''
},
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}}/v4/accounts');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/accounts',
headers: {'content-type': 'application/json'},
data: {
accountName: '',
accountNumber: '',
name: '',
organizationInfo: {
phoneNumber: '',
postalAddress: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
registeredDomain: ''
},
permissionLevel: '',
role: '',
state: {status: ''},
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/accounts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountName":"","accountNumber":"","name":"","organizationInfo":{"phoneNumber":"","postalAddress":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"registeredDomain":""},"permissionLevel":"","role":"","state":{"status":""},"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}}/v4/accounts',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountName": "",\n "accountNumber": "",\n "name": "",\n "organizationInfo": {\n "phoneNumber": "",\n "postalAddress": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n },\n "registeredDomain": ""\n },\n "permissionLevel": "",\n "role": "",\n "state": {\n "status": ""\n },\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 \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/accounts")
.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/v4/accounts',
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({
accountName: '',
accountNumber: '',
name: '',
organizationInfo: {
phoneNumber: '',
postalAddress: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
registeredDomain: ''
},
permissionLevel: '',
role: '',
state: {status: ''},
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/accounts',
headers: {'content-type': 'application/json'},
body: {
accountName: '',
accountNumber: '',
name: '',
organizationInfo: {
phoneNumber: '',
postalAddress: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
registeredDomain: ''
},
permissionLevel: '',
role: '',
state: {status: ''},
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}}/v4/accounts');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountName: '',
accountNumber: '',
name: '',
organizationInfo: {
phoneNumber: '',
postalAddress: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
registeredDomain: ''
},
permissionLevel: '',
role: '',
state: {
status: ''
},
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}}/v4/accounts',
headers: {'content-type': 'application/json'},
data: {
accountName: '',
accountNumber: '',
name: '',
organizationInfo: {
phoneNumber: '',
postalAddress: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
registeredDomain: ''
},
permissionLevel: '',
role: '',
state: {status: ''},
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/accounts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountName":"","accountNumber":"","name":"","organizationInfo":{"phoneNumber":"","postalAddress":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"registeredDomain":""},"permissionLevel":"","role":"","state":{"status":""},"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 = @{ @"accountName": @"",
@"accountNumber": @"",
@"name": @"",
@"organizationInfo": @{ @"phoneNumber": @"", @"postalAddress": @{ @"addressLines": @[ ], @"administrativeArea": @"", @"languageCode": @"", @"locality": @"", @"organization": @"", @"postalCode": @"", @"recipients": @[ ], @"regionCode": @"", @"revision": @0, @"sortingCode": @"", @"sublocality": @"" }, @"registeredDomain": @"" },
@"permissionLevel": @"",
@"role": @"",
@"state": @{ @"status": @"" },
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/accounts"]
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}}/v4/accounts" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/accounts",
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([
'accountName' => '',
'accountNumber' => '',
'name' => '',
'organizationInfo' => [
'phoneNumber' => '',
'postalAddress' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'registeredDomain' => ''
],
'permissionLevel' => '',
'role' => '',
'state' => [
'status' => ''
],
'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}}/v4/accounts', [
'body' => '{
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": {
"phoneNumber": "",
"postalAddress": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"registeredDomain": ""
},
"permissionLevel": "",
"role": "",
"state": {
"status": ""
},
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/accounts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountName' => '',
'accountNumber' => '',
'name' => '',
'organizationInfo' => [
'phoneNumber' => '',
'postalAddress' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'registeredDomain' => ''
],
'permissionLevel' => '',
'role' => '',
'state' => [
'status' => ''
],
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountName' => '',
'accountNumber' => '',
'name' => '',
'organizationInfo' => [
'phoneNumber' => '',
'postalAddress' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'registeredDomain' => ''
],
'permissionLevel' => '',
'role' => '',
'state' => [
'status' => ''
],
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/accounts');
$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}}/v4/accounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": {
"phoneNumber": "",
"postalAddress": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"registeredDomain": ""
},
"permissionLevel": "",
"role": "",
"state": {
"status": ""
},
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/accounts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": {
"phoneNumber": "",
"postalAddress": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"registeredDomain": ""
},
"permissionLevel": "",
"role": "",
"state": {
"status": ""
},
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/accounts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/accounts"
payload = {
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": {
"phoneNumber": "",
"postalAddress": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"registeredDomain": ""
},
"permissionLevel": "",
"role": "",
"state": { "status": "" },
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/accounts"
payload <- "{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\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}}/v4/accounts")
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 \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\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/v4/accounts') do |req|
req.body = "{\n \"accountName\": \"\",\n \"accountNumber\": \"\",\n \"name\": \"\",\n \"organizationInfo\": {\n \"phoneNumber\": \"\",\n \"postalAddress\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"registeredDomain\": \"\"\n },\n \"permissionLevel\": \"\",\n \"role\": \"\",\n \"state\": {\n \"status\": \"\"\n },\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}}/v4/accounts";
let payload = json!({
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": json!({
"phoneNumber": "",
"postalAddress": json!({
"addressLines": (),
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": (),
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}),
"registeredDomain": ""
}),
"permissionLevel": "",
"role": "",
"state": json!({"status": ""}),
"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}}/v4/accounts \
--header 'content-type: application/json' \
--data '{
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": {
"phoneNumber": "",
"postalAddress": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"registeredDomain": ""
},
"permissionLevel": "",
"role": "",
"state": {
"status": ""
},
"type": ""
}'
echo '{
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": {
"phoneNumber": "",
"postalAddress": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"registeredDomain": ""
},
"permissionLevel": "",
"role": "",
"state": {
"status": ""
},
"type": ""
}' | \
http POST {{baseUrl}}/v4/accounts \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accountName": "",\n "accountNumber": "",\n "name": "",\n "organizationInfo": {\n "phoneNumber": "",\n "postalAddress": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n },\n "registeredDomain": ""\n },\n "permissionLevel": "",\n "role": "",\n "state": {\n "status": ""\n },\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/v4/accounts
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountName": "",
"accountNumber": "",
"name": "",
"organizationInfo": [
"phoneNumber": "",
"postalAddress": [
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
],
"registeredDomain": ""
],
"permissionLevel": "",
"role": "",
"state": ["status": ""],
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/accounts")! 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
mybusiness.accounts.generateAccountNumber
{{baseUrl}}/v4/:name:generateAccountNumber
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}}/v4/:name:generateAccountNumber");
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}}/v4/:name:generateAccountNumber" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v4/:name:generateAccountNumber"
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}}/v4/:name:generateAccountNumber"),
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}}/v4/:name:generateAccountNumber");
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}}/v4/:name:generateAccountNumber"
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/v4/:name:generateAccountNumber HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:generateAccountNumber")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:generateAccountNumber"))
.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}}/v4/:name:generateAccountNumber")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:generateAccountNumber")
.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}}/v4/:name:generateAccountNumber');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:generateAccountNumber',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:generateAccountNumber';
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}}/v4/:name:generateAccountNumber',
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}}/v4/:name:generateAccountNumber")
.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/v4/:name:generateAccountNumber',
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}}/v4/:name:generateAccountNumber',
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}}/v4/:name:generateAccountNumber');
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}}/v4/:name:generateAccountNumber',
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}}/v4/:name:generateAccountNumber';
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}}/v4/:name:generateAccountNumber"]
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}}/v4/:name:generateAccountNumber" 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}}/v4/:name:generateAccountNumber",
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}}/v4/:name:generateAccountNumber', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:generateAccountNumber');
$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}}/v4/:name:generateAccountNumber');
$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}}/v4/:name:generateAccountNumber' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:generateAccountNumber' -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/v4/:name:generateAccountNumber", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:generateAccountNumber"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:generateAccountNumber"
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}}/v4/:name:generateAccountNumber")
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/v4/:name:generateAccountNumber') 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}}/v4/:name:generateAccountNumber";
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}}/v4/:name:generateAccountNumber \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v4/:name:generateAccountNumber \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v4/:name:generateAccountNumber
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}}/v4/:name:generateAccountNumber")! 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
mybusiness.accounts.invitations.accept
{{baseUrl}}/v4/:name:accept
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}}/v4/:name:accept");
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}}/v4/:name:accept" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v4/:name:accept"
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}}/v4/:name:accept"),
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}}/v4/:name:accept");
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}}/v4/:name:accept"
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/v4/:name:accept HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:accept")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:accept"))
.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}}/v4/:name:accept")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:accept")
.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}}/v4/:name:accept');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:accept',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:accept';
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}}/v4/:name:accept',
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}}/v4/:name:accept")
.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/v4/:name:accept',
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}}/v4/:name:accept',
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}}/v4/:name:accept');
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}}/v4/:name:accept',
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}}/v4/:name:accept';
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}}/v4/:name:accept"]
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}}/v4/:name:accept" 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}}/v4/:name:accept",
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}}/v4/:name:accept', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:accept');
$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}}/v4/:name:accept');
$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}}/v4/:name:accept' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:accept' -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/v4/:name:accept", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:accept"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:accept"
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}}/v4/:name:accept")
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/v4/:name:accept') 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}}/v4/:name:accept";
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}}/v4/:name:accept \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v4/:name:accept \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v4/:name:accept
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}}/v4/:name:accept")! 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
mybusiness.accounts.invitations.decline
{{baseUrl}}/v4/:name:decline
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}}/v4/:name:decline");
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}}/v4/:name:decline" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v4/:name:decline"
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}}/v4/:name:decline"),
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}}/v4/:name:decline");
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}}/v4/:name:decline"
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/v4/:name:decline HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:decline")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:decline"))
.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}}/v4/:name:decline")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:decline")
.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}}/v4/:name:decline');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:decline',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:decline';
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}}/v4/:name:decline',
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}}/v4/:name:decline")
.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/v4/:name:decline',
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}}/v4/:name:decline',
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}}/v4/:name:decline');
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}}/v4/:name:decline',
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}}/v4/:name:decline';
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}}/v4/:name:decline"]
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}}/v4/:name:decline" 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}}/v4/:name:decline",
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}}/v4/:name:decline', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:decline');
$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}}/v4/:name:decline');
$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}}/v4/:name:decline' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:decline' -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/v4/:name:decline", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:decline"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:decline"
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}}/v4/:name:decline")
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/v4/:name:decline') 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}}/v4/:name:decline";
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}}/v4/:name:decline \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v4/:name:decline \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v4/:name:decline
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}}/v4/:name:decline")! 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
mybusiness.accounts.invitations.list
{{baseUrl}}/v4/:parent/invitations
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/invitations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/invitations")
require "http/client"
url = "{{baseUrl}}/v4/:parent/invitations"
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}}/v4/:parent/invitations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/invitations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/invitations"
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/v4/:parent/invitations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/invitations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/invitations"))
.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}}/v4/:parent/invitations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/invitations")
.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}}/v4/:parent/invitations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/invitations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/invitations';
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}}/v4/:parent/invitations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/invitations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/invitations',
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}}/v4/:parent/invitations'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/invitations');
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}}/v4/:parent/invitations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/invitations';
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}}/v4/:parent/invitations"]
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}}/v4/:parent/invitations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/invitations",
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}}/v4/:parent/invitations');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/invitations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/invitations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/invitations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/invitations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/invitations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/invitations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/invitations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/invitations")
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/v4/:parent/invitations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/invitations";
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}}/v4/:parent/invitations
http GET {{baseUrl}}/v4/:parent/invitations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/invitations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/invitations")! 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
mybusiness.accounts.list
{{baseUrl}}/v4/accounts
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/accounts");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/accounts")
require "http/client"
url = "{{baseUrl}}/v4/accounts"
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}}/v4/accounts"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/accounts");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/accounts"
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/v4/accounts HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/accounts")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/accounts"))
.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}}/v4/accounts")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/accounts")
.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}}/v4/accounts');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/accounts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/accounts';
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}}/v4/accounts',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/accounts")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/accounts',
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}}/v4/accounts'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/accounts');
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}}/v4/accounts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/accounts';
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}}/v4/accounts"]
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}}/v4/accounts" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/accounts",
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}}/v4/accounts');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/accounts');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/accounts');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/accounts' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/accounts' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/accounts")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/accounts"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/accounts"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/accounts")
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/v4/accounts') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/accounts";
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}}/v4/accounts
http GET {{baseUrl}}/v4/accounts
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/accounts
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/accounts")! 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
mybusiness.accounts.listRecommendGoogleLocations
{{baseUrl}}/v4/:name:recommendGoogleLocations
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:recommendGoogleLocations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:name:recommendGoogleLocations")
require "http/client"
url = "{{baseUrl}}/v4/:name:recommendGoogleLocations"
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}}/v4/:name:recommendGoogleLocations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:name:recommendGoogleLocations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:recommendGoogleLocations"
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/v4/:name:recommendGoogleLocations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:name:recommendGoogleLocations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:recommendGoogleLocations"))
.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}}/v4/:name:recommendGoogleLocations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:name:recommendGoogleLocations")
.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}}/v4/:name:recommendGoogleLocations');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v4/:name:recommendGoogleLocations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:recommendGoogleLocations';
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}}/v4/:name:recommendGoogleLocations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:recommendGoogleLocations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:name:recommendGoogleLocations',
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}}/v4/:name:recommendGoogleLocations'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:name:recommendGoogleLocations');
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}}/v4/:name:recommendGoogleLocations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:recommendGoogleLocations';
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}}/v4/:name:recommendGoogleLocations"]
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}}/v4/:name:recommendGoogleLocations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:recommendGoogleLocations",
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}}/v4/:name:recommendGoogleLocations');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:recommendGoogleLocations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:name:recommendGoogleLocations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:name:recommendGoogleLocations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:recommendGoogleLocations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:name:recommendGoogleLocations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:recommendGoogleLocations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:recommendGoogleLocations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:name:recommendGoogleLocations")
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/v4/:name:recommendGoogleLocations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:recommendGoogleLocations";
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}}/v4/:name:recommendGoogleLocations
http GET {{baseUrl}}/v4/:name:recommendGoogleLocations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:name:recommendGoogleLocations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:recommendGoogleLocations")! 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
mybusiness.accounts.locations.admins.create
{{baseUrl}}/v4/:parent/admins
QUERY PARAMS
parent
BODY json
{
"adminName": "",
"name": "",
"pendingInvitation": false,
"role": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/admins");
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 \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:parent/admins" {:content-type :json
:form-params {:adminName ""
:name ""
:pendingInvitation false
:role ""}})
require "http/client"
url = "{{baseUrl}}/v4/:parent/admins"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\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}}/v4/:parent/admins"),
Content = new StringContent("{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\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}}/v4/:parent/admins");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/admins"
payload := strings.NewReader("{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\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/v4/:parent/admins HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 79
{
"adminName": "",
"name": "",
"pendingInvitation": false,
"role": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:parent/admins")
.setHeader("content-type", "application/json")
.setBody("{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/admins"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\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 \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:parent/admins")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:parent/admins")
.header("content-type", "application/json")
.body("{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\n}")
.asString();
const data = JSON.stringify({
adminName: '',
name: '',
pendingInvitation: false,
role: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:parent/admins');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/admins',
headers: {'content-type': 'application/json'},
data: {adminName: '', name: '', pendingInvitation: false, role: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/admins';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"adminName":"","name":"","pendingInvitation":false,"role":""}'
};
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}}/v4/:parent/admins',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "adminName": "",\n "name": "",\n "pendingInvitation": false,\n "role": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/admins")
.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/v4/:parent/admins',
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({adminName: '', name: '', pendingInvitation: false, role: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/admins',
headers: {'content-type': 'application/json'},
body: {adminName: '', name: '', pendingInvitation: false, role: ''},
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}}/v4/:parent/admins');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
adminName: '',
name: '',
pendingInvitation: false,
role: ''
});
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}}/v4/:parent/admins',
headers: {'content-type': 'application/json'},
data: {adminName: '', name: '', pendingInvitation: false, role: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/admins';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"adminName":"","name":"","pendingInvitation":false,"role":""}'
};
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 = @{ @"adminName": @"",
@"name": @"",
@"pendingInvitation": @NO,
@"role": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:parent/admins"]
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}}/v4/:parent/admins" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/admins",
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([
'adminName' => '',
'name' => '',
'pendingInvitation' => null,
'role' => ''
]),
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}}/v4/:parent/admins', [
'body' => '{
"adminName": "",
"name": "",
"pendingInvitation": false,
"role": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/admins');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'adminName' => '',
'name' => '',
'pendingInvitation' => null,
'role' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'adminName' => '',
'name' => '',
'pendingInvitation' => null,
'role' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:parent/admins');
$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}}/v4/:parent/admins' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"adminName": "",
"name": "",
"pendingInvitation": false,
"role": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/admins' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"adminName": "",
"name": "",
"pendingInvitation": false,
"role": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:parent/admins", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/admins"
payload = {
"adminName": "",
"name": "",
"pendingInvitation": False,
"role": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/admins"
payload <- "{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\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}}/v4/:parent/admins")
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 \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\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/v4/:parent/admins') do |req|
req.body = "{\n \"adminName\": \"\",\n \"name\": \"\",\n \"pendingInvitation\": false,\n \"role\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/admins";
let payload = json!({
"adminName": "",
"name": "",
"pendingInvitation": false,
"role": ""
});
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}}/v4/:parent/admins \
--header 'content-type: application/json' \
--data '{
"adminName": "",
"name": "",
"pendingInvitation": false,
"role": ""
}'
echo '{
"adminName": "",
"name": "",
"pendingInvitation": false,
"role": ""
}' | \
http POST {{baseUrl}}/v4/:parent/admins \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "adminName": "",\n "name": "",\n "pendingInvitation": false,\n "role": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:parent/admins
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"adminName": "",
"name": "",
"pendingInvitation": false,
"role": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/admins")! 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
mybusiness.accounts.locations.admins.list
{{baseUrl}}/v4/:parent/admins
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/admins");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/admins")
require "http/client"
url = "{{baseUrl}}/v4/:parent/admins"
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}}/v4/:parent/admins"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/admins");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/admins"
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/v4/:parent/admins HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/admins")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/admins"))
.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}}/v4/:parent/admins")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/admins")
.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}}/v4/:parent/admins');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/admins'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/admins';
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}}/v4/:parent/admins',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/admins")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/admins',
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}}/v4/:parent/admins'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/admins');
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}}/v4/:parent/admins'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/admins';
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}}/v4/:parent/admins"]
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}}/v4/:parent/admins" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/admins",
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}}/v4/:parent/admins');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/admins');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/admins');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/admins' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/admins' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/admins")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/admins"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/admins"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/admins")
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/v4/:parent/admins') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/admins";
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}}/v4/:parent/admins
http GET {{baseUrl}}/v4/:parent/admins
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/admins
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/admins")! 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
mybusiness.accounts.locations.associate
{{baseUrl}}/v4/:name:associate
QUERY PARAMS
name
BODY json
{
"placeId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:associate");
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 \"placeId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name:associate" {:content-type :json
:form-params {:placeId ""}})
require "http/client"
url = "{{baseUrl}}/v4/:name:associate"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"placeId\": \"\"\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}}/v4/:name:associate"),
Content = new StringContent("{\n \"placeId\": \"\"\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}}/v4/:name:associate");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"placeId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:associate"
payload := strings.NewReader("{\n \"placeId\": \"\"\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/v4/:name:associate HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 19
{
"placeId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:associate")
.setHeader("content-type", "application/json")
.setBody("{\n \"placeId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:associate"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"placeId\": \"\"\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 \"placeId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name:associate")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:associate")
.header("content-type", "application/json")
.body("{\n \"placeId\": \"\"\n}")
.asString();
const data = JSON.stringify({
placeId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name:associate');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:associate',
headers: {'content-type': 'application/json'},
data: {placeId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:associate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"placeId":""}'
};
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}}/v4/:name:associate',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "placeId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"placeId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:associate")
.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/v4/:name:associate',
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({placeId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:associate',
headers: {'content-type': 'application/json'},
body: {placeId: ''},
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}}/v4/:name:associate');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
placeId: ''
});
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}}/v4/:name:associate',
headers: {'content-type': 'application/json'},
data: {placeId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:associate';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"placeId":""}'
};
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 = @{ @"placeId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name:associate"]
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}}/v4/:name:associate" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"placeId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:associate",
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([
'placeId' => ''
]),
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}}/v4/:name:associate', [
'body' => '{
"placeId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:associate');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'placeId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'placeId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name:associate');
$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}}/v4/:name:associate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"placeId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:associate' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"placeId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"placeId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name:associate", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:associate"
payload = { "placeId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:associate"
payload <- "{\n \"placeId\": \"\"\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}}/v4/:name:associate")
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 \"placeId\": \"\"\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/v4/:name:associate') do |req|
req.body = "{\n \"placeId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:associate";
let payload = json!({"placeId": ""});
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}}/v4/:name:associate \
--header 'content-type: application/json' \
--data '{
"placeId": ""
}'
echo '{
"placeId": ""
}' | \
http POST {{baseUrl}}/v4/:name:associate \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "placeId": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:name:associate
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["placeId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:associate")! 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
mybusiness.accounts.locations.batchGet
{{baseUrl}}/v4/:name/locations:batchGet
QUERY PARAMS
name
BODY json
{
"locationNames": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name/locations:batchGet");
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 \"locationNames\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name/locations:batchGet" {:content-type :json
:form-params {:locationNames []}})
require "http/client"
url = "{{baseUrl}}/v4/:name/locations:batchGet"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"locationNames\": []\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}}/v4/:name/locations:batchGet"),
Content = new StringContent("{\n \"locationNames\": []\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}}/v4/:name/locations:batchGet");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"locationNames\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name/locations:batchGet"
payload := strings.NewReader("{\n \"locationNames\": []\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/v4/:name/locations:batchGet HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 25
{
"locationNames": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name/locations:batchGet")
.setHeader("content-type", "application/json")
.setBody("{\n \"locationNames\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name/locations:batchGet"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"locationNames\": []\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 \"locationNames\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name/locations:batchGet")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name/locations:batchGet")
.header("content-type", "application/json")
.body("{\n \"locationNames\": []\n}")
.asString();
const data = JSON.stringify({
locationNames: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name/locations:batchGet');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name/locations:batchGet',
headers: {'content-type': 'application/json'},
data: {locationNames: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name/locations:batchGet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"locationNames":[]}'
};
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}}/v4/:name/locations:batchGet',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "locationNames": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"locationNames\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name/locations:batchGet")
.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/v4/:name/locations:batchGet',
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({locationNames: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name/locations:batchGet',
headers: {'content-type': 'application/json'},
body: {locationNames: []},
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}}/v4/:name/locations:batchGet');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
locationNames: []
});
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}}/v4/:name/locations:batchGet',
headers: {'content-type': 'application/json'},
data: {locationNames: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name/locations:batchGet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"locationNames":[]}'
};
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 = @{ @"locationNames": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name/locations:batchGet"]
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}}/v4/:name/locations:batchGet" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"locationNames\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name/locations:batchGet",
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([
'locationNames' => [
]
]),
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}}/v4/:name/locations:batchGet', [
'body' => '{
"locationNames": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name/locations:batchGet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'locationNames' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'locationNames' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name/locations:batchGet');
$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}}/v4/:name/locations:batchGet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"locationNames": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name/locations:batchGet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"locationNames": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"locationNames\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name/locations:batchGet", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name/locations:batchGet"
payload = { "locationNames": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name/locations:batchGet"
payload <- "{\n \"locationNames\": []\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}}/v4/:name/locations:batchGet")
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 \"locationNames\": []\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/v4/:name/locations:batchGet') do |req|
req.body = "{\n \"locationNames\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name/locations:batchGet";
let payload = json!({"locationNames": ()});
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}}/v4/:name/locations:batchGet \
--header 'content-type: application/json' \
--data '{
"locationNames": []
}'
echo '{
"locationNames": []
}' | \
http POST {{baseUrl}}/v4/:name/locations:batchGet \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "locationNames": []\n}' \
--output-document \
- {{baseUrl}}/v4/:name/locations:batchGet
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["locationNames": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name/locations:batchGet")! 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
mybusiness.accounts.locations.batchGetReviews
{{baseUrl}}/v4/:name/locations:batchGetReviews
QUERY PARAMS
name
BODY json
{
"ignoreRatingOnlyReviews": false,
"locationNames": [],
"orderBy": "",
"pageSize": 0,
"pageToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name/locations:batchGetReviews");
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 \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name/locations:batchGetReviews" {:content-type :json
:form-params {:ignoreRatingOnlyReviews false
:locationNames []
:orderBy ""
:pageSize 0
:pageToken ""}})
require "http/client"
url = "{{baseUrl}}/v4/:name/locations:batchGetReviews"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\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}}/v4/:name/locations:batchGetReviews"),
Content = new StringContent("{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\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}}/v4/:name/locations:batchGetReviews");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name/locations:batchGetReviews"
payload := strings.NewReader("{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\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/v4/:name/locations:batchGetReviews HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 114
{
"ignoreRatingOnlyReviews": false,
"locationNames": [],
"orderBy": "",
"pageSize": 0,
"pageToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name/locations:batchGetReviews")
.setHeader("content-type", "application/json")
.setBody("{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name/locations:batchGetReviews"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\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 \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name/locations:batchGetReviews")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name/locations:batchGetReviews")
.header("content-type", "application/json")
.body("{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
ignoreRatingOnlyReviews: false,
locationNames: [],
orderBy: '',
pageSize: 0,
pageToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name/locations:batchGetReviews');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name/locations:batchGetReviews',
headers: {'content-type': 'application/json'},
data: {
ignoreRatingOnlyReviews: false,
locationNames: [],
orderBy: '',
pageSize: 0,
pageToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name/locations:batchGetReviews';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignoreRatingOnlyReviews":false,"locationNames":[],"orderBy":"","pageSize":0,"pageToken":""}'
};
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}}/v4/:name/locations:batchGetReviews',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "ignoreRatingOnlyReviews": false,\n "locationNames": [],\n "orderBy": "",\n "pageSize": 0,\n "pageToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name/locations:batchGetReviews")
.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/v4/:name/locations:batchGetReviews',
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({
ignoreRatingOnlyReviews: false,
locationNames: [],
orderBy: '',
pageSize: 0,
pageToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name/locations:batchGetReviews',
headers: {'content-type': 'application/json'},
body: {
ignoreRatingOnlyReviews: false,
locationNames: [],
orderBy: '',
pageSize: 0,
pageToken: ''
},
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}}/v4/:name/locations:batchGetReviews');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
ignoreRatingOnlyReviews: false,
locationNames: [],
orderBy: '',
pageSize: 0,
pageToken: ''
});
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}}/v4/:name/locations:batchGetReviews',
headers: {'content-type': 'application/json'},
data: {
ignoreRatingOnlyReviews: false,
locationNames: [],
orderBy: '',
pageSize: 0,
pageToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name/locations:batchGetReviews';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"ignoreRatingOnlyReviews":false,"locationNames":[],"orderBy":"","pageSize":0,"pageToken":""}'
};
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 = @{ @"ignoreRatingOnlyReviews": @NO,
@"locationNames": @[ ],
@"orderBy": @"",
@"pageSize": @0,
@"pageToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name/locations:batchGetReviews"]
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}}/v4/:name/locations:batchGetReviews" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name/locations:batchGetReviews",
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([
'ignoreRatingOnlyReviews' => null,
'locationNames' => [
],
'orderBy' => '',
'pageSize' => 0,
'pageToken' => ''
]),
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}}/v4/:name/locations:batchGetReviews', [
'body' => '{
"ignoreRatingOnlyReviews": false,
"locationNames": [],
"orderBy": "",
"pageSize": 0,
"pageToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name/locations:batchGetReviews');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'ignoreRatingOnlyReviews' => null,
'locationNames' => [
],
'orderBy' => '',
'pageSize' => 0,
'pageToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'ignoreRatingOnlyReviews' => null,
'locationNames' => [
],
'orderBy' => '',
'pageSize' => 0,
'pageToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name/locations:batchGetReviews');
$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}}/v4/:name/locations:batchGetReviews' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignoreRatingOnlyReviews": false,
"locationNames": [],
"orderBy": "",
"pageSize": 0,
"pageToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name/locations:batchGetReviews' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"ignoreRatingOnlyReviews": false,
"locationNames": [],
"orderBy": "",
"pageSize": 0,
"pageToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name/locations:batchGetReviews", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name/locations:batchGetReviews"
payload = {
"ignoreRatingOnlyReviews": False,
"locationNames": [],
"orderBy": "",
"pageSize": 0,
"pageToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name/locations:batchGetReviews"
payload <- "{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\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}}/v4/:name/locations:batchGetReviews")
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 \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\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/v4/:name/locations:batchGetReviews') do |req|
req.body = "{\n \"ignoreRatingOnlyReviews\": false,\n \"locationNames\": [],\n \"orderBy\": \"\",\n \"pageSize\": 0,\n \"pageToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name/locations:batchGetReviews";
let payload = json!({
"ignoreRatingOnlyReviews": false,
"locationNames": (),
"orderBy": "",
"pageSize": 0,
"pageToken": ""
});
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}}/v4/:name/locations:batchGetReviews \
--header 'content-type: application/json' \
--data '{
"ignoreRatingOnlyReviews": false,
"locationNames": [],
"orderBy": "",
"pageSize": 0,
"pageToken": ""
}'
echo '{
"ignoreRatingOnlyReviews": false,
"locationNames": [],
"orderBy": "",
"pageSize": 0,
"pageToken": ""
}' | \
http POST {{baseUrl}}/v4/:name/locations:batchGetReviews \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "ignoreRatingOnlyReviews": false,\n "locationNames": [],\n "orderBy": "",\n "pageSize": 0,\n "pageToken": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:name/locations:batchGetReviews
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"ignoreRatingOnlyReviews": false,
"locationNames": [],
"orderBy": "",
"pageSize": 0,
"pageToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name/locations:batchGetReviews")! 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
mybusiness.accounts.locations.clearAssociation
{{baseUrl}}/v4/:name:clearAssociation
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}}/v4/:name:clearAssociation");
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}}/v4/:name:clearAssociation" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v4/:name:clearAssociation"
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}}/v4/:name:clearAssociation"),
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}}/v4/:name:clearAssociation");
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}}/v4/:name:clearAssociation"
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/v4/:name:clearAssociation HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:clearAssociation")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:clearAssociation"))
.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}}/v4/:name:clearAssociation")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:clearAssociation")
.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}}/v4/:name:clearAssociation');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:clearAssociation',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:clearAssociation';
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}}/v4/:name:clearAssociation',
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}}/v4/:name:clearAssociation")
.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/v4/:name:clearAssociation',
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}}/v4/:name:clearAssociation',
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}}/v4/:name:clearAssociation');
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}}/v4/:name:clearAssociation',
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}}/v4/:name:clearAssociation';
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}}/v4/:name:clearAssociation"]
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}}/v4/:name:clearAssociation" 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}}/v4/:name:clearAssociation",
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}}/v4/:name:clearAssociation', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:clearAssociation');
$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}}/v4/:name:clearAssociation');
$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}}/v4/:name:clearAssociation' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:clearAssociation' -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/v4/:name:clearAssociation", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:clearAssociation"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:clearAssociation"
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}}/v4/:name:clearAssociation")
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/v4/:name:clearAssociation') 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}}/v4/:name:clearAssociation";
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}}/v4/:name:clearAssociation \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v4/:name:clearAssociation \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v4/:name:clearAssociation
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}}/v4/:name:clearAssociation")! 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
mybusiness.accounts.locations.create
{{baseUrl}}/v4/:parent/locations
QUERY PARAMS
parent
BODY json
{
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/locations");
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 \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:parent/locations" {:content-type :json
:form-params {:adWordsLocationExtensions {:adPhone ""}
:additionalCategories [{:categoryId ""
:displayName ""
:moreHoursTypes [{:displayName ""
:hoursTypeId ""
:localizedDisplayName ""}]
:serviceTypes [{:displayName ""
:serviceTypeId ""}]}]
:additionalPhones []
:address {:addressLines []
:administrativeArea ""
:languageCode ""
:locality ""
:organization ""
:postalCode ""
:recipients []
:regionCode ""
:revision 0
:sortingCode ""
:sublocality ""}
:attributes [{:attributeId ""
:repeatedEnumValue {:setValues []
:unsetValues []}
:urlValues [{:url ""}]
:valueType ""
:values []}]
:labels []
:languageCode ""
:latlng {:latitude ""
:longitude ""}
:locationKey {:explicitNoPlaceId false
:placeId ""
:plusPageId ""
:requestId ""}
:locationName ""
:locationState {:canDelete false
:canHaveFoodMenus false
:canModifyServiceList false
:canOperateHealthData false
:canOperateLodgingData false
:canUpdate false
:hasPendingEdits false
:hasPendingVerification false
:isDisabled false
:isDisconnected false
:isDuplicate false
:isGoogleUpdated false
:isLocalPostApiDisabled false
:isPendingReview false
:isPublished false
:isSuspended false
:isVerified false
:needsReverification false}
:metadata {:duplicate {:access ""
:locationName ""
:placeId ""}
:mapsUrl ""
:newReviewUrl ""}
:moreHours [{:hoursTypeId ""
:periods [{:closeDay ""
:closeTime ""
:openDay ""
:openTime ""}]}]
:name ""
:openInfo {:canReopen false
:openingDate {:day 0
:month 0
:year 0}
:status ""}
:priceLists [{:labels [{:description ""
:displayName ""
:languageCode ""}]
:priceListId ""
:sections [{:items [{:itemId ""
:labels [{}]
:price {:currencyCode ""
:nanos 0
:units ""}}]
:labels [{}]
:sectionId ""
:sectionType ""}]
:sourceUrl ""}]
:primaryCategory {}
:primaryPhone ""
:profile {:description ""}
:regularHours {:periods [{}]}
:relationshipData {:parentChain ""}
:serviceArea {:businessType ""
:places {:placeInfos [{:name ""
:placeId ""}]}
:radius {:latlng {}
:radiusKm ""}}
:specialHours {:specialHourPeriods [{:closeTime ""
:endDate {}
:isClosed false
:openTime ""
:startDate {}}]}
:storeCode ""
:websiteUrl ""}})
require "http/client"
url = "{{baseUrl}}/v4/:parent/locations"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\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}}/v4/:parent/locations"),
Content = new StringContent("{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\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}}/v4/:parent/locations");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/locations"
payload := strings.NewReader("{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\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/v4/:parent/locations HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 3610
{
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:parent/locations")
.setHeader("content-type", "application/json")
.setBody("{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/locations"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\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 \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:parent/locations")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:parent/locations")
.header("content-type", "application/json")
.body("{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
adWordsLocationExtensions: {
adPhone: ''
},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [
{
displayName: '',
hoursTypeId: '',
localizedDisplayName: ''
}
],
serviceTypes: [
{
displayName: '',
serviceTypeId: ''
}
]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {
setValues: [],
unsetValues: []
},
urlValues: [
{
url: ''
}
],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {
latitude: '',
longitude: ''
},
locationKey: {
explicitNoPlaceId: false,
placeId: '',
plusPageId: '',
requestId: ''
},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {
access: '',
locationName: '',
placeId: ''
},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [
{
closeDay: '',
closeTime: '',
openDay: '',
openTime: ''
}
]
}
],
name: '',
openInfo: {
canReopen: false,
openingDate: {
day: 0,
month: 0,
year: 0
},
status: ''
},
priceLists: [
{
labels: [
{
description: '',
displayName: '',
languageCode: ''
}
],
priceListId: '',
sections: [
{
items: [
{
itemId: '',
labels: [
{}
],
price: {
currencyCode: '',
nanos: 0,
units: ''
}
}
],
labels: [
{}
],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {
description: ''
},
regularHours: {
periods: [
{}
]
},
relationshipData: {
parentChain: ''
},
serviceArea: {
businessType: '',
places: {
placeInfos: [
{
name: '',
placeId: ''
}
]
},
radius: {
latlng: {},
radiusKm: ''
}
},
specialHours: {
specialHourPeriods: [
{
closeTime: '',
endDate: {},
isClosed: false,
openTime: '',
startDate: {}
}
]
},
storeCode: '',
websiteUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:parent/locations');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/locations',
headers: {'content-type': 'application/json'},
data: {
adWordsLocationExtensions: {adPhone: ''},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [{displayName: '', hoursTypeId: '', localizedDisplayName: ''}],
serviceTypes: [{displayName: '', serviceTypeId: ''}]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {setValues: [], unsetValues: []},
urlValues: [{url: ''}],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {latitude: '', longitude: ''},
locationKey: {explicitNoPlaceId: false, placeId: '', plusPageId: '', requestId: ''},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {access: '', locationName: '', placeId: ''},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [{closeDay: '', closeTime: '', openDay: '', openTime: ''}]
}
],
name: '',
openInfo: {canReopen: false, openingDate: {day: 0, month: 0, year: 0}, status: ''},
priceLists: [
{
labels: [{description: '', displayName: '', languageCode: ''}],
priceListId: '',
sections: [
{
items: [{itemId: '', labels: [{}], price: {currencyCode: '', nanos: 0, units: ''}}],
labels: [{}],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {description: ''},
regularHours: {periods: [{}]},
relationshipData: {parentChain: ''},
serviceArea: {
businessType: '',
places: {placeInfos: [{name: '', placeId: ''}]},
radius: {latlng: {}, radiusKm: ''}
},
specialHours: {
specialHourPeriods: [{closeTime: '', endDate: {}, isClosed: false, openTime: '', startDate: {}}]
},
storeCode: '',
websiteUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/locations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"adWordsLocationExtensions":{"adPhone":""},"additionalCategories":[{"categoryId":"","displayName":"","moreHoursTypes":[{"displayName":"","hoursTypeId":"","localizedDisplayName":""}],"serviceTypes":[{"displayName":"","serviceTypeId":""}]}],"additionalPhones":[],"address":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"attributes":[{"attributeId":"","repeatedEnumValue":{"setValues":[],"unsetValues":[]},"urlValues":[{"url":""}],"valueType":"","values":[]}],"labels":[],"languageCode":"","latlng":{"latitude":"","longitude":""},"locationKey":{"explicitNoPlaceId":false,"placeId":"","plusPageId":"","requestId":""},"locationName":"","locationState":{"canDelete":false,"canHaveFoodMenus":false,"canModifyServiceList":false,"canOperateHealthData":false,"canOperateLodgingData":false,"canUpdate":false,"hasPendingEdits":false,"hasPendingVerification":false,"isDisabled":false,"isDisconnected":false,"isDuplicate":false,"isGoogleUpdated":false,"isLocalPostApiDisabled":false,"isPendingReview":false,"isPublished":false,"isSuspended":false,"isVerified":false,"needsReverification":false},"metadata":{"duplicate":{"access":"","locationName":"","placeId":""},"mapsUrl":"","newReviewUrl":""},"moreHours":[{"hoursTypeId":"","periods":[{"closeDay":"","closeTime":"","openDay":"","openTime":""}]}],"name":"","openInfo":{"canReopen":false,"openingDate":{"day":0,"month":0,"year":0},"status":""},"priceLists":[{"labels":[{"description":"","displayName":"","languageCode":""}],"priceListId":"","sections":[{"items":[{"itemId":"","labels":[{}],"price":{"currencyCode":"","nanos":0,"units":""}}],"labels":[{}],"sectionId":"","sectionType":""}],"sourceUrl":""}],"primaryCategory":{},"primaryPhone":"","profile":{"description":""},"regularHours":{"periods":[{}]},"relationshipData":{"parentChain":""},"serviceArea":{"businessType":"","places":{"placeInfos":[{"name":"","placeId":""}]},"radius":{"latlng":{},"radiusKm":""}},"specialHours":{"specialHourPeriods":[{"closeTime":"","endDate":{},"isClosed":false,"openTime":"","startDate":{}}]},"storeCode":"","websiteUrl":""}'
};
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}}/v4/:parent/locations',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "adWordsLocationExtensions": {\n "adPhone": ""\n },\n "additionalCategories": [\n {\n "categoryId": "",\n "displayName": "",\n "moreHoursTypes": [\n {\n "displayName": "",\n "hoursTypeId": "",\n "localizedDisplayName": ""\n }\n ],\n "serviceTypes": [\n {\n "displayName": "",\n "serviceTypeId": ""\n }\n ]\n }\n ],\n "additionalPhones": [],\n "address": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n },\n "attributes": [\n {\n "attributeId": "",\n "repeatedEnumValue": {\n "setValues": [],\n "unsetValues": []\n },\n "urlValues": [\n {\n "url": ""\n }\n ],\n "valueType": "",\n "values": []\n }\n ],\n "labels": [],\n "languageCode": "",\n "latlng": {\n "latitude": "",\n "longitude": ""\n },\n "locationKey": {\n "explicitNoPlaceId": false,\n "placeId": "",\n "plusPageId": "",\n "requestId": ""\n },\n "locationName": "",\n "locationState": {\n "canDelete": false,\n "canHaveFoodMenus": false,\n "canModifyServiceList": false,\n "canOperateHealthData": false,\n "canOperateLodgingData": false,\n "canUpdate": false,\n "hasPendingEdits": false,\n "hasPendingVerification": false,\n "isDisabled": false,\n "isDisconnected": false,\n "isDuplicate": false,\n "isGoogleUpdated": false,\n "isLocalPostApiDisabled": false,\n "isPendingReview": false,\n "isPublished": false,\n "isSuspended": false,\n "isVerified": false,\n "needsReverification": false\n },\n "metadata": {\n "duplicate": {\n "access": "",\n "locationName": "",\n "placeId": ""\n },\n "mapsUrl": "",\n "newReviewUrl": ""\n },\n "moreHours": [\n {\n "hoursTypeId": "",\n "periods": [\n {\n "closeDay": "",\n "closeTime": "",\n "openDay": "",\n "openTime": ""\n }\n ]\n }\n ],\n "name": "",\n "openInfo": {\n "canReopen": false,\n "openingDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "status": ""\n },\n "priceLists": [\n {\n "labels": [\n {\n "description": "",\n "displayName": "",\n "languageCode": ""\n }\n ],\n "priceListId": "",\n "sections": [\n {\n "items": [\n {\n "itemId": "",\n "labels": [\n {}\n ],\n "price": {\n "currencyCode": "",\n "nanos": 0,\n "units": ""\n }\n }\n ],\n "labels": [\n {}\n ],\n "sectionId": "",\n "sectionType": ""\n }\n ],\n "sourceUrl": ""\n }\n ],\n "primaryCategory": {},\n "primaryPhone": "",\n "profile": {\n "description": ""\n },\n "regularHours": {\n "periods": [\n {}\n ]\n },\n "relationshipData": {\n "parentChain": ""\n },\n "serviceArea": {\n "businessType": "",\n "places": {\n "placeInfos": [\n {\n "name": "",\n "placeId": ""\n }\n ]\n },\n "radius": {\n "latlng": {},\n "radiusKm": ""\n }\n },\n "specialHours": {\n "specialHourPeriods": [\n {\n "closeTime": "",\n "endDate": {},\n "isClosed": false,\n "openTime": "",\n "startDate": {}\n }\n ]\n },\n "storeCode": "",\n "websiteUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/locations")
.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/v4/:parent/locations',
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({
adWordsLocationExtensions: {adPhone: ''},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [{displayName: '', hoursTypeId: '', localizedDisplayName: ''}],
serviceTypes: [{displayName: '', serviceTypeId: ''}]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {setValues: [], unsetValues: []},
urlValues: [{url: ''}],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {latitude: '', longitude: ''},
locationKey: {explicitNoPlaceId: false, placeId: '', plusPageId: '', requestId: ''},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {access: '', locationName: '', placeId: ''},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [{closeDay: '', closeTime: '', openDay: '', openTime: ''}]
}
],
name: '',
openInfo: {canReopen: false, openingDate: {day: 0, month: 0, year: 0}, status: ''},
priceLists: [
{
labels: [{description: '', displayName: '', languageCode: ''}],
priceListId: '',
sections: [
{
items: [{itemId: '', labels: [{}], price: {currencyCode: '', nanos: 0, units: ''}}],
labels: [{}],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {description: ''},
regularHours: {periods: [{}]},
relationshipData: {parentChain: ''},
serviceArea: {
businessType: '',
places: {placeInfos: [{name: '', placeId: ''}]},
radius: {latlng: {}, radiusKm: ''}
},
specialHours: {
specialHourPeriods: [{closeTime: '', endDate: {}, isClosed: false, openTime: '', startDate: {}}]
},
storeCode: '',
websiteUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/locations',
headers: {'content-type': 'application/json'},
body: {
adWordsLocationExtensions: {adPhone: ''},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [{displayName: '', hoursTypeId: '', localizedDisplayName: ''}],
serviceTypes: [{displayName: '', serviceTypeId: ''}]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {setValues: [], unsetValues: []},
urlValues: [{url: ''}],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {latitude: '', longitude: ''},
locationKey: {explicitNoPlaceId: false, placeId: '', plusPageId: '', requestId: ''},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {access: '', locationName: '', placeId: ''},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [{closeDay: '', closeTime: '', openDay: '', openTime: ''}]
}
],
name: '',
openInfo: {canReopen: false, openingDate: {day: 0, month: 0, year: 0}, status: ''},
priceLists: [
{
labels: [{description: '', displayName: '', languageCode: ''}],
priceListId: '',
sections: [
{
items: [{itemId: '', labels: [{}], price: {currencyCode: '', nanos: 0, units: ''}}],
labels: [{}],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {description: ''},
regularHours: {periods: [{}]},
relationshipData: {parentChain: ''},
serviceArea: {
businessType: '',
places: {placeInfos: [{name: '', placeId: ''}]},
radius: {latlng: {}, radiusKm: ''}
},
specialHours: {
specialHourPeriods: [{closeTime: '', endDate: {}, isClosed: false, openTime: '', startDate: {}}]
},
storeCode: '',
websiteUrl: ''
},
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}}/v4/:parent/locations');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
adWordsLocationExtensions: {
adPhone: ''
},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [
{
displayName: '',
hoursTypeId: '',
localizedDisplayName: ''
}
],
serviceTypes: [
{
displayName: '',
serviceTypeId: ''
}
]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {
setValues: [],
unsetValues: []
},
urlValues: [
{
url: ''
}
],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {
latitude: '',
longitude: ''
},
locationKey: {
explicitNoPlaceId: false,
placeId: '',
plusPageId: '',
requestId: ''
},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {
access: '',
locationName: '',
placeId: ''
},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [
{
closeDay: '',
closeTime: '',
openDay: '',
openTime: ''
}
]
}
],
name: '',
openInfo: {
canReopen: false,
openingDate: {
day: 0,
month: 0,
year: 0
},
status: ''
},
priceLists: [
{
labels: [
{
description: '',
displayName: '',
languageCode: ''
}
],
priceListId: '',
sections: [
{
items: [
{
itemId: '',
labels: [
{}
],
price: {
currencyCode: '',
nanos: 0,
units: ''
}
}
],
labels: [
{}
],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {
description: ''
},
regularHours: {
periods: [
{}
]
},
relationshipData: {
parentChain: ''
},
serviceArea: {
businessType: '',
places: {
placeInfos: [
{
name: '',
placeId: ''
}
]
},
radius: {
latlng: {},
radiusKm: ''
}
},
specialHours: {
specialHourPeriods: [
{
closeTime: '',
endDate: {},
isClosed: false,
openTime: '',
startDate: {}
}
]
},
storeCode: '',
websiteUrl: ''
});
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}}/v4/:parent/locations',
headers: {'content-type': 'application/json'},
data: {
adWordsLocationExtensions: {adPhone: ''},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [{displayName: '', hoursTypeId: '', localizedDisplayName: ''}],
serviceTypes: [{displayName: '', serviceTypeId: ''}]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {setValues: [], unsetValues: []},
urlValues: [{url: ''}],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {latitude: '', longitude: ''},
locationKey: {explicitNoPlaceId: false, placeId: '', plusPageId: '', requestId: ''},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {access: '', locationName: '', placeId: ''},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [{closeDay: '', closeTime: '', openDay: '', openTime: ''}]
}
],
name: '',
openInfo: {canReopen: false, openingDate: {day: 0, month: 0, year: 0}, status: ''},
priceLists: [
{
labels: [{description: '', displayName: '', languageCode: ''}],
priceListId: '',
sections: [
{
items: [{itemId: '', labels: [{}], price: {currencyCode: '', nanos: 0, units: ''}}],
labels: [{}],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {description: ''},
regularHours: {periods: [{}]},
relationshipData: {parentChain: ''},
serviceArea: {
businessType: '',
places: {placeInfos: [{name: '', placeId: ''}]},
radius: {latlng: {}, radiusKm: ''}
},
specialHours: {
specialHourPeriods: [{closeTime: '', endDate: {}, isClosed: false, openTime: '', startDate: {}}]
},
storeCode: '',
websiteUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/locations';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"adWordsLocationExtensions":{"adPhone":""},"additionalCategories":[{"categoryId":"","displayName":"","moreHoursTypes":[{"displayName":"","hoursTypeId":"","localizedDisplayName":""}],"serviceTypes":[{"displayName":"","serviceTypeId":""}]}],"additionalPhones":[],"address":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"attributes":[{"attributeId":"","repeatedEnumValue":{"setValues":[],"unsetValues":[]},"urlValues":[{"url":""}],"valueType":"","values":[]}],"labels":[],"languageCode":"","latlng":{"latitude":"","longitude":""},"locationKey":{"explicitNoPlaceId":false,"placeId":"","plusPageId":"","requestId":""},"locationName":"","locationState":{"canDelete":false,"canHaveFoodMenus":false,"canModifyServiceList":false,"canOperateHealthData":false,"canOperateLodgingData":false,"canUpdate":false,"hasPendingEdits":false,"hasPendingVerification":false,"isDisabled":false,"isDisconnected":false,"isDuplicate":false,"isGoogleUpdated":false,"isLocalPostApiDisabled":false,"isPendingReview":false,"isPublished":false,"isSuspended":false,"isVerified":false,"needsReverification":false},"metadata":{"duplicate":{"access":"","locationName":"","placeId":""},"mapsUrl":"","newReviewUrl":""},"moreHours":[{"hoursTypeId":"","periods":[{"closeDay":"","closeTime":"","openDay":"","openTime":""}]}],"name":"","openInfo":{"canReopen":false,"openingDate":{"day":0,"month":0,"year":0},"status":""},"priceLists":[{"labels":[{"description":"","displayName":"","languageCode":""}],"priceListId":"","sections":[{"items":[{"itemId":"","labels":[{}],"price":{"currencyCode":"","nanos":0,"units":""}}],"labels":[{}],"sectionId":"","sectionType":""}],"sourceUrl":""}],"primaryCategory":{},"primaryPhone":"","profile":{"description":""},"regularHours":{"periods":[{}]},"relationshipData":{"parentChain":""},"serviceArea":{"businessType":"","places":{"placeInfos":[{"name":"","placeId":""}]},"radius":{"latlng":{},"radiusKm":""}},"specialHours":{"specialHourPeriods":[{"closeTime":"","endDate":{},"isClosed":false,"openTime":"","startDate":{}}]},"storeCode":"","websiteUrl":""}'
};
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 = @{ @"adWordsLocationExtensions": @{ @"adPhone": @"" },
@"additionalCategories": @[ @{ @"categoryId": @"", @"displayName": @"", @"moreHoursTypes": @[ @{ @"displayName": @"", @"hoursTypeId": @"", @"localizedDisplayName": @"" } ], @"serviceTypes": @[ @{ @"displayName": @"", @"serviceTypeId": @"" } ] } ],
@"additionalPhones": @[ ],
@"address": @{ @"addressLines": @[ ], @"administrativeArea": @"", @"languageCode": @"", @"locality": @"", @"organization": @"", @"postalCode": @"", @"recipients": @[ ], @"regionCode": @"", @"revision": @0, @"sortingCode": @"", @"sublocality": @"" },
@"attributes": @[ @{ @"attributeId": @"", @"repeatedEnumValue": @{ @"setValues": @[ ], @"unsetValues": @[ ] }, @"urlValues": @[ @{ @"url": @"" } ], @"valueType": @"", @"values": @[ ] } ],
@"labels": @[ ],
@"languageCode": @"",
@"latlng": @{ @"latitude": @"", @"longitude": @"" },
@"locationKey": @{ @"explicitNoPlaceId": @NO, @"placeId": @"", @"plusPageId": @"", @"requestId": @"" },
@"locationName": @"",
@"locationState": @{ @"canDelete": @NO, @"canHaveFoodMenus": @NO, @"canModifyServiceList": @NO, @"canOperateHealthData": @NO, @"canOperateLodgingData": @NO, @"canUpdate": @NO, @"hasPendingEdits": @NO, @"hasPendingVerification": @NO, @"isDisabled": @NO, @"isDisconnected": @NO, @"isDuplicate": @NO, @"isGoogleUpdated": @NO, @"isLocalPostApiDisabled": @NO, @"isPendingReview": @NO, @"isPublished": @NO, @"isSuspended": @NO, @"isVerified": @NO, @"needsReverification": @NO },
@"metadata": @{ @"duplicate": @{ @"access": @"", @"locationName": @"", @"placeId": @"" }, @"mapsUrl": @"", @"newReviewUrl": @"" },
@"moreHours": @[ @{ @"hoursTypeId": @"", @"periods": @[ @{ @"closeDay": @"", @"closeTime": @"", @"openDay": @"", @"openTime": @"" } ] } ],
@"name": @"",
@"openInfo": @{ @"canReopen": @NO, @"openingDate": @{ @"day": @0, @"month": @0, @"year": @0 }, @"status": @"" },
@"priceLists": @[ @{ @"labels": @[ @{ @"description": @"", @"displayName": @"", @"languageCode": @"" } ], @"priceListId": @"", @"sections": @[ @{ @"items": @[ @{ @"itemId": @"", @"labels": @[ @{ } ], @"price": @{ @"currencyCode": @"", @"nanos": @0, @"units": @"" } } ], @"labels": @[ @{ } ], @"sectionId": @"", @"sectionType": @"" } ], @"sourceUrl": @"" } ],
@"primaryCategory": @{ },
@"primaryPhone": @"",
@"profile": @{ @"description": @"" },
@"regularHours": @{ @"periods": @[ @{ } ] },
@"relationshipData": @{ @"parentChain": @"" },
@"serviceArea": @{ @"businessType": @"", @"places": @{ @"placeInfos": @[ @{ @"name": @"", @"placeId": @"" } ] }, @"radius": @{ @"latlng": @{ }, @"radiusKm": @"" } },
@"specialHours": @{ @"specialHourPeriods": @[ @{ @"closeTime": @"", @"endDate": @{ }, @"isClosed": @NO, @"openTime": @"", @"startDate": @{ } } ] },
@"storeCode": @"",
@"websiteUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:parent/locations"]
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}}/v4/:parent/locations" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/locations",
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([
'adWordsLocationExtensions' => [
'adPhone' => ''
],
'additionalCategories' => [
[
'categoryId' => '',
'displayName' => '',
'moreHoursTypes' => [
[
'displayName' => '',
'hoursTypeId' => '',
'localizedDisplayName' => ''
]
],
'serviceTypes' => [
[
'displayName' => '',
'serviceTypeId' => ''
]
]
]
],
'additionalPhones' => [
],
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'attributes' => [
[
'attributeId' => '',
'repeatedEnumValue' => [
'setValues' => [
],
'unsetValues' => [
]
],
'urlValues' => [
[
'url' => ''
]
],
'valueType' => '',
'values' => [
]
]
],
'labels' => [
],
'languageCode' => '',
'latlng' => [
'latitude' => '',
'longitude' => ''
],
'locationKey' => [
'explicitNoPlaceId' => null,
'placeId' => '',
'plusPageId' => '',
'requestId' => ''
],
'locationName' => '',
'locationState' => [
'canDelete' => null,
'canHaveFoodMenus' => null,
'canModifyServiceList' => null,
'canOperateHealthData' => null,
'canOperateLodgingData' => null,
'canUpdate' => null,
'hasPendingEdits' => null,
'hasPendingVerification' => null,
'isDisabled' => null,
'isDisconnected' => null,
'isDuplicate' => null,
'isGoogleUpdated' => null,
'isLocalPostApiDisabled' => null,
'isPendingReview' => null,
'isPublished' => null,
'isSuspended' => null,
'isVerified' => null,
'needsReverification' => null
],
'metadata' => [
'duplicate' => [
'access' => '',
'locationName' => '',
'placeId' => ''
],
'mapsUrl' => '',
'newReviewUrl' => ''
],
'moreHours' => [
[
'hoursTypeId' => '',
'periods' => [
[
'closeDay' => '',
'closeTime' => '',
'openDay' => '',
'openTime' => ''
]
]
]
],
'name' => '',
'openInfo' => [
'canReopen' => null,
'openingDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'status' => ''
],
'priceLists' => [
[
'labels' => [
[
'description' => '',
'displayName' => '',
'languageCode' => ''
]
],
'priceListId' => '',
'sections' => [
[
'items' => [
[
'itemId' => '',
'labels' => [
[
]
],
'price' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
]
]
],
'labels' => [
[
]
],
'sectionId' => '',
'sectionType' => ''
]
],
'sourceUrl' => ''
]
],
'primaryCategory' => [
],
'primaryPhone' => '',
'profile' => [
'description' => ''
],
'regularHours' => [
'periods' => [
[
]
]
],
'relationshipData' => [
'parentChain' => ''
],
'serviceArea' => [
'businessType' => '',
'places' => [
'placeInfos' => [
[
'name' => '',
'placeId' => ''
]
]
],
'radius' => [
'latlng' => [
],
'radiusKm' => ''
]
],
'specialHours' => [
'specialHourPeriods' => [
[
'closeTime' => '',
'endDate' => [
],
'isClosed' => null,
'openTime' => '',
'startDate' => [
]
]
]
],
'storeCode' => '',
'websiteUrl' => ''
]),
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}}/v4/:parent/locations', [
'body' => '{
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/locations');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'adWordsLocationExtensions' => [
'adPhone' => ''
],
'additionalCategories' => [
[
'categoryId' => '',
'displayName' => '',
'moreHoursTypes' => [
[
'displayName' => '',
'hoursTypeId' => '',
'localizedDisplayName' => ''
]
],
'serviceTypes' => [
[
'displayName' => '',
'serviceTypeId' => ''
]
]
]
],
'additionalPhones' => [
],
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'attributes' => [
[
'attributeId' => '',
'repeatedEnumValue' => [
'setValues' => [
],
'unsetValues' => [
]
],
'urlValues' => [
[
'url' => ''
]
],
'valueType' => '',
'values' => [
]
]
],
'labels' => [
],
'languageCode' => '',
'latlng' => [
'latitude' => '',
'longitude' => ''
],
'locationKey' => [
'explicitNoPlaceId' => null,
'placeId' => '',
'plusPageId' => '',
'requestId' => ''
],
'locationName' => '',
'locationState' => [
'canDelete' => null,
'canHaveFoodMenus' => null,
'canModifyServiceList' => null,
'canOperateHealthData' => null,
'canOperateLodgingData' => null,
'canUpdate' => null,
'hasPendingEdits' => null,
'hasPendingVerification' => null,
'isDisabled' => null,
'isDisconnected' => null,
'isDuplicate' => null,
'isGoogleUpdated' => null,
'isLocalPostApiDisabled' => null,
'isPendingReview' => null,
'isPublished' => null,
'isSuspended' => null,
'isVerified' => null,
'needsReverification' => null
],
'metadata' => [
'duplicate' => [
'access' => '',
'locationName' => '',
'placeId' => ''
],
'mapsUrl' => '',
'newReviewUrl' => ''
],
'moreHours' => [
[
'hoursTypeId' => '',
'periods' => [
[
'closeDay' => '',
'closeTime' => '',
'openDay' => '',
'openTime' => ''
]
]
]
],
'name' => '',
'openInfo' => [
'canReopen' => null,
'openingDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'status' => ''
],
'priceLists' => [
[
'labels' => [
[
'description' => '',
'displayName' => '',
'languageCode' => ''
]
],
'priceListId' => '',
'sections' => [
[
'items' => [
[
'itemId' => '',
'labels' => [
[
]
],
'price' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
]
]
],
'labels' => [
[
]
],
'sectionId' => '',
'sectionType' => ''
]
],
'sourceUrl' => ''
]
],
'primaryCategory' => [
],
'primaryPhone' => '',
'profile' => [
'description' => ''
],
'regularHours' => [
'periods' => [
[
]
]
],
'relationshipData' => [
'parentChain' => ''
],
'serviceArea' => [
'businessType' => '',
'places' => [
'placeInfos' => [
[
'name' => '',
'placeId' => ''
]
]
],
'radius' => [
'latlng' => [
],
'radiusKm' => ''
]
],
'specialHours' => [
'specialHourPeriods' => [
[
'closeTime' => '',
'endDate' => [
],
'isClosed' => null,
'openTime' => '',
'startDate' => [
]
]
]
],
'storeCode' => '',
'websiteUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'adWordsLocationExtensions' => [
'adPhone' => ''
],
'additionalCategories' => [
[
'categoryId' => '',
'displayName' => '',
'moreHoursTypes' => [
[
'displayName' => '',
'hoursTypeId' => '',
'localizedDisplayName' => ''
]
],
'serviceTypes' => [
[
'displayName' => '',
'serviceTypeId' => ''
]
]
]
],
'additionalPhones' => [
],
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'attributes' => [
[
'attributeId' => '',
'repeatedEnumValue' => [
'setValues' => [
],
'unsetValues' => [
]
],
'urlValues' => [
[
'url' => ''
]
],
'valueType' => '',
'values' => [
]
]
],
'labels' => [
],
'languageCode' => '',
'latlng' => [
'latitude' => '',
'longitude' => ''
],
'locationKey' => [
'explicitNoPlaceId' => null,
'placeId' => '',
'plusPageId' => '',
'requestId' => ''
],
'locationName' => '',
'locationState' => [
'canDelete' => null,
'canHaveFoodMenus' => null,
'canModifyServiceList' => null,
'canOperateHealthData' => null,
'canOperateLodgingData' => null,
'canUpdate' => null,
'hasPendingEdits' => null,
'hasPendingVerification' => null,
'isDisabled' => null,
'isDisconnected' => null,
'isDuplicate' => null,
'isGoogleUpdated' => null,
'isLocalPostApiDisabled' => null,
'isPendingReview' => null,
'isPublished' => null,
'isSuspended' => null,
'isVerified' => null,
'needsReverification' => null
],
'metadata' => [
'duplicate' => [
'access' => '',
'locationName' => '',
'placeId' => ''
],
'mapsUrl' => '',
'newReviewUrl' => ''
],
'moreHours' => [
[
'hoursTypeId' => '',
'periods' => [
[
'closeDay' => '',
'closeTime' => '',
'openDay' => '',
'openTime' => ''
]
]
]
],
'name' => '',
'openInfo' => [
'canReopen' => null,
'openingDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'status' => ''
],
'priceLists' => [
[
'labels' => [
[
'description' => '',
'displayName' => '',
'languageCode' => ''
]
],
'priceListId' => '',
'sections' => [
[
'items' => [
[
'itemId' => '',
'labels' => [
[
]
],
'price' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
]
]
],
'labels' => [
[
]
],
'sectionId' => '',
'sectionType' => ''
]
],
'sourceUrl' => ''
]
],
'primaryCategory' => [
],
'primaryPhone' => '',
'profile' => [
'description' => ''
],
'regularHours' => [
'periods' => [
[
]
]
],
'relationshipData' => [
'parentChain' => ''
],
'serviceArea' => [
'businessType' => '',
'places' => [
'placeInfos' => [
[
'name' => '',
'placeId' => ''
]
]
],
'radius' => [
'latlng' => [
],
'radiusKm' => ''
]
],
'specialHours' => [
'specialHourPeriods' => [
[
'closeTime' => '',
'endDate' => [
],
'isClosed' => null,
'openTime' => '',
'startDate' => [
]
]
]
],
'storeCode' => '',
'websiteUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:parent/locations');
$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}}/v4/:parent/locations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/locations' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:parent/locations", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/locations"
payload = {
"adWordsLocationExtensions": { "adPhone": "" },
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [{ "url": "" }],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": False,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": False,
"canHaveFoodMenus": False,
"canModifyServiceList": False,
"canOperateHealthData": False,
"canOperateLodgingData": False,
"canUpdate": False,
"hasPendingEdits": False,
"hasPendingVerification": False,
"isDisabled": False,
"isDisconnected": False,
"isDuplicate": False,
"isGoogleUpdated": False,
"isLocalPostApiDisabled": False,
"isPendingReview": False,
"isPublished": False,
"isSuspended": False,
"isVerified": False,
"needsReverification": False
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": False,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [{}],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [{}],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": { "description": "" },
"regularHours": { "periods": [{}] },
"relationshipData": { "parentChain": "" },
"serviceArea": {
"businessType": "",
"places": { "placeInfos": [
{
"name": "",
"placeId": ""
}
] },
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": { "specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": False,
"openTime": "",
"startDate": {}
}
] },
"storeCode": "",
"websiteUrl": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/locations"
payload <- "{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\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}}/v4/:parent/locations")
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 \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\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/v4/:parent/locations') do |req|
req.body = "{\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/locations";
let payload = json!({
"adWordsLocationExtensions": json!({"adPhone": ""}),
"additionalCategories": (
json!({
"categoryId": "",
"displayName": "",
"moreHoursTypes": (
json!({
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
})
),
"serviceTypes": (
json!({
"displayName": "",
"serviceTypeId": ""
})
)
})
),
"additionalPhones": (),
"address": json!({
"addressLines": (),
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": (),
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}),
"attributes": (
json!({
"attributeId": "",
"repeatedEnumValue": json!({
"setValues": (),
"unsetValues": ()
}),
"urlValues": (json!({"url": ""})),
"valueType": "",
"values": ()
})
),
"labels": (),
"languageCode": "",
"latlng": json!({
"latitude": "",
"longitude": ""
}),
"locationKey": json!({
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
}),
"locationName": "",
"locationState": json!({
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
}),
"metadata": json!({
"duplicate": json!({
"access": "",
"locationName": "",
"placeId": ""
}),
"mapsUrl": "",
"newReviewUrl": ""
}),
"moreHours": (
json!({
"hoursTypeId": "",
"periods": (
json!({
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
})
)
})
),
"name": "",
"openInfo": json!({
"canReopen": false,
"openingDate": json!({
"day": 0,
"month": 0,
"year": 0
}),
"status": ""
}),
"priceLists": (
json!({
"labels": (
json!({
"description": "",
"displayName": "",
"languageCode": ""
})
),
"priceListId": "",
"sections": (
json!({
"items": (
json!({
"itemId": "",
"labels": (json!({})),
"price": json!({
"currencyCode": "",
"nanos": 0,
"units": ""
})
})
),
"labels": (json!({})),
"sectionId": "",
"sectionType": ""
})
),
"sourceUrl": ""
})
),
"primaryCategory": json!({}),
"primaryPhone": "",
"profile": json!({"description": ""}),
"regularHours": json!({"periods": (json!({}))}),
"relationshipData": json!({"parentChain": ""}),
"serviceArea": json!({
"businessType": "",
"places": json!({"placeInfos": (
json!({
"name": "",
"placeId": ""
})
)}),
"radius": json!({
"latlng": json!({}),
"radiusKm": ""
})
}),
"specialHours": json!({"specialHourPeriods": (
json!({
"closeTime": "",
"endDate": json!({}),
"isClosed": false,
"openTime": "",
"startDate": json!({})
})
)}),
"storeCode": "",
"websiteUrl": ""
});
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}}/v4/:parent/locations \
--header 'content-type: application/json' \
--data '{
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
}'
echo '{
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
}' | \
http POST {{baseUrl}}/v4/:parent/locations \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "adWordsLocationExtensions": {\n "adPhone": ""\n },\n "additionalCategories": [\n {\n "categoryId": "",\n "displayName": "",\n "moreHoursTypes": [\n {\n "displayName": "",\n "hoursTypeId": "",\n "localizedDisplayName": ""\n }\n ],\n "serviceTypes": [\n {\n "displayName": "",\n "serviceTypeId": ""\n }\n ]\n }\n ],\n "additionalPhones": [],\n "address": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n },\n "attributes": [\n {\n "attributeId": "",\n "repeatedEnumValue": {\n "setValues": [],\n "unsetValues": []\n },\n "urlValues": [\n {\n "url": ""\n }\n ],\n "valueType": "",\n "values": []\n }\n ],\n "labels": [],\n "languageCode": "",\n "latlng": {\n "latitude": "",\n "longitude": ""\n },\n "locationKey": {\n "explicitNoPlaceId": false,\n "placeId": "",\n "plusPageId": "",\n "requestId": ""\n },\n "locationName": "",\n "locationState": {\n "canDelete": false,\n "canHaveFoodMenus": false,\n "canModifyServiceList": false,\n "canOperateHealthData": false,\n "canOperateLodgingData": false,\n "canUpdate": false,\n "hasPendingEdits": false,\n "hasPendingVerification": false,\n "isDisabled": false,\n "isDisconnected": false,\n "isDuplicate": false,\n "isGoogleUpdated": false,\n "isLocalPostApiDisabled": false,\n "isPendingReview": false,\n "isPublished": false,\n "isSuspended": false,\n "isVerified": false,\n "needsReverification": false\n },\n "metadata": {\n "duplicate": {\n "access": "",\n "locationName": "",\n "placeId": ""\n },\n "mapsUrl": "",\n "newReviewUrl": ""\n },\n "moreHours": [\n {\n "hoursTypeId": "",\n "periods": [\n {\n "closeDay": "",\n "closeTime": "",\n "openDay": "",\n "openTime": ""\n }\n ]\n }\n ],\n "name": "",\n "openInfo": {\n "canReopen": false,\n "openingDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "status": ""\n },\n "priceLists": [\n {\n "labels": [\n {\n "description": "",\n "displayName": "",\n "languageCode": ""\n }\n ],\n "priceListId": "",\n "sections": [\n {\n "items": [\n {\n "itemId": "",\n "labels": [\n {}\n ],\n "price": {\n "currencyCode": "",\n "nanos": 0,\n "units": ""\n }\n }\n ],\n "labels": [\n {}\n ],\n "sectionId": "",\n "sectionType": ""\n }\n ],\n "sourceUrl": ""\n }\n ],\n "primaryCategory": {},\n "primaryPhone": "",\n "profile": {\n "description": ""\n },\n "regularHours": {\n "periods": [\n {}\n ]\n },\n "relationshipData": {\n "parentChain": ""\n },\n "serviceArea": {\n "businessType": "",\n "places": {\n "placeInfos": [\n {\n "name": "",\n "placeId": ""\n }\n ]\n },\n "radius": {\n "latlng": {},\n "radiusKm": ""\n }\n },\n "specialHours": {\n "specialHourPeriods": [\n {\n "closeTime": "",\n "endDate": {},\n "isClosed": false,\n "openTime": "",\n "startDate": {}\n }\n ]\n },\n "storeCode": "",\n "websiteUrl": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:parent/locations
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"adWordsLocationExtensions": ["adPhone": ""],
"additionalCategories": [
[
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
[
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
]
],
"serviceTypes": [
[
"displayName": "",
"serviceTypeId": ""
]
]
]
],
"additionalPhones": [],
"address": [
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
],
"attributes": [
[
"attributeId": "",
"repeatedEnumValue": [
"setValues": [],
"unsetValues": []
],
"urlValues": [["url": ""]],
"valueType": "",
"values": []
]
],
"labels": [],
"languageCode": "",
"latlng": [
"latitude": "",
"longitude": ""
],
"locationKey": [
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
],
"locationName": "",
"locationState": [
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
],
"metadata": [
"duplicate": [
"access": "",
"locationName": "",
"placeId": ""
],
"mapsUrl": "",
"newReviewUrl": ""
],
"moreHours": [
[
"hoursTypeId": "",
"periods": [
[
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
]
]
]
],
"name": "",
"openInfo": [
"canReopen": false,
"openingDate": [
"day": 0,
"month": 0,
"year": 0
],
"status": ""
],
"priceLists": [
[
"labels": [
[
"description": "",
"displayName": "",
"languageCode": ""
]
],
"priceListId": "",
"sections": [
[
"items": [
[
"itemId": "",
"labels": [[]],
"price": [
"currencyCode": "",
"nanos": 0,
"units": ""
]
]
],
"labels": [[]],
"sectionId": "",
"sectionType": ""
]
],
"sourceUrl": ""
]
],
"primaryCategory": [],
"primaryPhone": "",
"profile": ["description": ""],
"regularHours": ["periods": [[]]],
"relationshipData": ["parentChain": ""],
"serviceArea": [
"businessType": "",
"places": ["placeInfos": [
[
"name": "",
"placeId": ""
]
]],
"radius": [
"latlng": [],
"radiusKm": ""
]
],
"specialHours": ["specialHourPeriods": [
[
"closeTime": "",
"endDate": [],
"isClosed": false,
"openTime": "",
"startDate": []
]
]],
"storeCode": "",
"websiteUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/locations")! 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
mybusiness.accounts.locations.fetchVerificationOptions
{{baseUrl}}/v4/:name:fetchVerificationOptions
QUERY PARAMS
name
BODY json
{
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"languageCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:fetchVerificationOptions");
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 \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name:fetchVerificationOptions" {:content-type :json
:form-params {:context {:address {:addressLines []
:administrativeArea ""
:languageCode ""
:locality ""
:organization ""
:postalCode ""
:recipients []
:regionCode ""
:revision 0
:sortingCode ""
:sublocality ""}}
:languageCode ""}})
require "http/client"
url = "{{baseUrl}}/v4/:name:fetchVerificationOptions"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\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}}/v4/:name:fetchVerificationOptions"),
Content = new StringContent("{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\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}}/v4/:name:fetchVerificationOptions");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:fetchVerificationOptions"
payload := strings.NewReader("{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\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/v4/:name:fetchVerificationOptions HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 341
{
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"languageCode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:fetchVerificationOptions")
.setHeader("content-type", "application/json")
.setBody("{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:fetchVerificationOptions"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\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 \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name:fetchVerificationOptions")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:fetchVerificationOptions")
.header("content-type", "application/json")
.body("{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\n}")
.asString();
const data = JSON.stringify({
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
languageCode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name:fetchVerificationOptions');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:fetchVerificationOptions',
headers: {'content-type': 'application/json'},
data: {
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
languageCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:fetchVerificationOptions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"context":{"address":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""}},"languageCode":""}'
};
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}}/v4/:name:fetchVerificationOptions',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "context": {\n "address": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n }\n },\n "languageCode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:fetchVerificationOptions")
.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/v4/:name:fetchVerificationOptions',
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({
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
languageCode: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:fetchVerificationOptions',
headers: {'content-type': 'application/json'},
body: {
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
languageCode: ''
},
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}}/v4/:name:fetchVerificationOptions');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
languageCode: ''
});
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}}/v4/:name:fetchVerificationOptions',
headers: {'content-type': 'application/json'},
data: {
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
languageCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:fetchVerificationOptions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"context":{"address":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""}},"languageCode":""}'
};
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 = @{ @"context": @{ @"address": @{ @"addressLines": @[ ], @"administrativeArea": @"", @"languageCode": @"", @"locality": @"", @"organization": @"", @"postalCode": @"", @"recipients": @[ ], @"regionCode": @"", @"revision": @0, @"sortingCode": @"", @"sublocality": @"" } },
@"languageCode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name:fetchVerificationOptions"]
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}}/v4/:name:fetchVerificationOptions" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:fetchVerificationOptions",
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([
'context' => [
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
]
],
'languageCode' => ''
]),
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}}/v4/:name:fetchVerificationOptions', [
'body' => '{
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"languageCode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:fetchVerificationOptions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'context' => [
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
]
],
'languageCode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'context' => [
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
]
],
'languageCode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name:fetchVerificationOptions');
$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}}/v4/:name:fetchVerificationOptions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"languageCode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:fetchVerificationOptions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"languageCode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name:fetchVerificationOptions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:fetchVerificationOptions"
payload = {
"context": { "address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
} },
"languageCode": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:fetchVerificationOptions"
payload <- "{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\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}}/v4/:name:fetchVerificationOptions")
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 \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\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/v4/:name:fetchVerificationOptions') do |req|
req.body = "{\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"languageCode\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:fetchVerificationOptions";
let payload = json!({
"context": json!({"address": json!({
"addressLines": (),
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": (),
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
})}),
"languageCode": ""
});
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}}/v4/:name:fetchVerificationOptions \
--header 'content-type: application/json' \
--data '{
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"languageCode": ""
}'
echo '{
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"languageCode": ""
}' | \
http POST {{baseUrl}}/v4/:name:fetchVerificationOptions \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "context": {\n "address": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n }\n },\n "languageCode": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:name:fetchVerificationOptions
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"context": ["address": [
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
]],
"languageCode": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:fetchVerificationOptions")! 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
mybusiness.accounts.locations.findMatches
{{baseUrl}}/v4/:name:findMatches
QUERY PARAMS
name
BODY json
{
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:findMatches");
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 \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name:findMatches" {:content-type :json
:form-params {:languageCode ""
:maxCacheDuration ""
:numResults 0}})
require "http/client"
url = "{{baseUrl}}/v4/:name:findMatches"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\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}}/v4/:name:findMatches"),
Content = new StringContent("{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\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}}/v4/:name:findMatches");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:findMatches"
payload := strings.NewReader("{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\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/v4/:name:findMatches HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 69
{
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:findMatches")
.setHeader("content-type", "application/json")
.setBody("{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:findMatches"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\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 \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name:findMatches")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:findMatches")
.header("content-type", "application/json")
.body("{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\n}")
.asString();
const data = JSON.stringify({
languageCode: '',
maxCacheDuration: '',
numResults: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name:findMatches');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:findMatches',
headers: {'content-type': 'application/json'},
data: {languageCode: '', maxCacheDuration: '', numResults: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:findMatches';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"languageCode":"","maxCacheDuration":"","numResults":0}'
};
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}}/v4/:name:findMatches',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "languageCode": "",\n "maxCacheDuration": "",\n "numResults": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:findMatches")
.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/v4/:name:findMatches',
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({languageCode: '', maxCacheDuration: '', numResults: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:findMatches',
headers: {'content-type': 'application/json'},
body: {languageCode: '', maxCacheDuration: '', numResults: 0},
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}}/v4/:name:findMatches');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
languageCode: '',
maxCacheDuration: '',
numResults: 0
});
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}}/v4/:name:findMatches',
headers: {'content-type': 'application/json'},
data: {languageCode: '', maxCacheDuration: '', numResults: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:findMatches';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"languageCode":"","maxCacheDuration":"","numResults":0}'
};
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 = @{ @"languageCode": @"",
@"maxCacheDuration": @"",
@"numResults": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name:findMatches"]
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}}/v4/:name:findMatches" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:findMatches",
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([
'languageCode' => '',
'maxCacheDuration' => '',
'numResults' => 0
]),
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}}/v4/:name:findMatches', [
'body' => '{
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:findMatches');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'languageCode' => '',
'maxCacheDuration' => '',
'numResults' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'languageCode' => '',
'maxCacheDuration' => '',
'numResults' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name:findMatches');
$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}}/v4/:name:findMatches' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:findMatches' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name:findMatches", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:findMatches"
payload = {
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:findMatches"
payload <- "{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\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}}/v4/:name:findMatches")
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 \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\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/v4/:name:findMatches') do |req|
req.body = "{\n \"languageCode\": \"\",\n \"maxCacheDuration\": \"\",\n \"numResults\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:findMatches";
let payload = json!({
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
});
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}}/v4/:name:findMatches \
--header 'content-type: application/json' \
--data '{
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
}'
echo '{
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
}' | \
http POST {{baseUrl}}/v4/:name:findMatches \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "languageCode": "",\n "maxCacheDuration": "",\n "numResults": 0\n}' \
--output-document \
- {{baseUrl}}/v4/:name:findMatches
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"languageCode": "",
"maxCacheDuration": "",
"numResults": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:findMatches")! 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
mybusiness.accounts.locations.getGoogleUpdated
{{baseUrl}}/v4/:name:googleUpdated
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:googleUpdated");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:name:googleUpdated")
require "http/client"
url = "{{baseUrl}}/v4/:name:googleUpdated"
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}}/v4/:name:googleUpdated"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:name:googleUpdated");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:googleUpdated"
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/v4/:name:googleUpdated HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:name:googleUpdated")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:googleUpdated"))
.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}}/v4/:name:googleUpdated")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:name:googleUpdated")
.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}}/v4/:name:googleUpdated');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:name:googleUpdated'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:googleUpdated';
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}}/v4/:name:googleUpdated',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:googleUpdated")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:name:googleUpdated',
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}}/v4/:name:googleUpdated'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:name:googleUpdated');
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}}/v4/:name:googleUpdated'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:googleUpdated';
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}}/v4/:name:googleUpdated"]
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}}/v4/:name:googleUpdated" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:googleUpdated",
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}}/v4/:name:googleUpdated');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:googleUpdated');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:name:googleUpdated');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:name:googleUpdated' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:googleUpdated' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:name:googleUpdated")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:googleUpdated"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:googleUpdated"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:name:googleUpdated")
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/v4/:name:googleUpdated') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:googleUpdated";
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}}/v4/:name:googleUpdated
http GET {{baseUrl}}/v4/:name:googleUpdated
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:name:googleUpdated
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:googleUpdated")! 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
mybusiness.accounts.locations.insuranceNetworks.list
{{baseUrl}}/v4/:parent/insuranceNetworks
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/insuranceNetworks");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/insuranceNetworks")
require "http/client"
url = "{{baseUrl}}/v4/:parent/insuranceNetworks"
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}}/v4/:parent/insuranceNetworks"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/insuranceNetworks");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/insuranceNetworks"
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/v4/:parent/insuranceNetworks HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/insuranceNetworks")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/insuranceNetworks"))
.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}}/v4/:parent/insuranceNetworks")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/insuranceNetworks")
.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}}/v4/:parent/insuranceNetworks');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/insuranceNetworks'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/insuranceNetworks';
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}}/v4/:parent/insuranceNetworks',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/insuranceNetworks")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/insuranceNetworks',
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}}/v4/:parent/insuranceNetworks'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/insuranceNetworks');
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}}/v4/:parent/insuranceNetworks'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/insuranceNetworks';
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}}/v4/:parent/insuranceNetworks"]
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}}/v4/:parent/insuranceNetworks" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/insuranceNetworks",
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}}/v4/:parent/insuranceNetworks');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/insuranceNetworks');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/insuranceNetworks');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/insuranceNetworks' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/insuranceNetworks' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/insuranceNetworks")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/insuranceNetworks"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/insuranceNetworks"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/insuranceNetworks")
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/v4/:parent/insuranceNetworks') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/insuranceNetworks";
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}}/v4/:parent/insuranceNetworks
http GET {{baseUrl}}/v4/:parent/insuranceNetworks
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/insuranceNetworks
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/insuranceNetworks")! 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
mybusiness.accounts.locations.list
{{baseUrl}}/v4/:parent/locations
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/locations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/locations")
require "http/client"
url = "{{baseUrl}}/v4/:parent/locations"
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}}/v4/:parent/locations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/locations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/locations"
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/v4/:parent/locations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/locations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/locations"))
.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}}/v4/:parent/locations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/locations")
.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}}/v4/:parent/locations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/locations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/locations';
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}}/v4/:parent/locations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/locations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/locations',
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}}/v4/:parent/locations'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/locations');
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}}/v4/:parent/locations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/locations';
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}}/v4/:parent/locations"]
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}}/v4/:parent/locations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/locations",
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}}/v4/:parent/locations');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/locations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/locations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/locations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/locations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/locations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/locations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/locations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/locations")
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/v4/:parent/locations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/locations";
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}}/v4/:parent/locations
http GET {{baseUrl}}/v4/:parent/locations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/locations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/locations")! 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
mybusiness.accounts.locations.localPosts.create
{{baseUrl}}/v4/:parent/localPosts
QUERY PARAMS
parent
BODY json
{
"alertType": "",
"callToAction": {
"actionType": "",
"url": ""
},
"createTime": "",
"event": {
"schedule": {
"endDate": {
"day": 0,
"month": 0,
"year": 0
},
"endTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
},
"startDate": {},
"startTime": {}
},
"title": ""
},
"languageCode": "",
"media": [
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
],
"name": "",
"offer": {
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
},
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"updateTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/localPosts");
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 \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\n \"updateTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:parent/localPosts" {:content-type :json
:form-params {:alertType ""
:callToAction {:actionType ""
:url ""}
:createTime ""
:event {:schedule {:endDate {:day 0
:month 0
:year 0}
:endTime {:hours 0
:minutes 0
:nanos 0
:seconds 0}
:startDate {}
:startTime {}}
:title ""}
:languageCode ""
:media [{:attribution {:profileName ""
:profilePhotoUrl ""
:profileUrl ""
:takedownUrl ""}
:createTime ""
:dataRef {:resourceName ""}
:description ""
:dimensions {:heightPixels 0
:widthPixels 0}
:googleUrl ""
:insights {:viewCount ""}
:locationAssociation {:category ""
:priceListItemId ""}
:mediaFormat ""
:name ""
:sourceUrl ""
:thumbnailUrl ""}]
:name ""
:offer {:couponCode ""
:redeemOnlineUrl ""
:termsConditions ""}
:searchUrl ""
:state ""
:summary ""
:topicType ""
:updateTime ""}})
require "http/client"
url = "{{baseUrl}}/v4/:parent/localPosts"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\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}}/v4/:parent/localPosts"),
Content = new StringContent("{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\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}}/v4/:parent/localPosts");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\n \"updateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/localPosts"
payload := strings.NewReader("{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\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/v4/:parent/localPosts HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1240
{
"alertType": "",
"callToAction": {
"actionType": "",
"url": ""
},
"createTime": "",
"event": {
"schedule": {
"endDate": {
"day": 0,
"month": 0,
"year": 0
},
"endTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
},
"startDate": {},
"startTime": {}
},
"title": ""
},
"languageCode": "",
"media": [
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
],
"name": "",
"offer": {
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
},
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"updateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:parent/localPosts")
.setHeader("content-type", "application/json")
.setBody("{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\n \"updateTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/localPosts"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\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 \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\n \"updateTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:parent/localPosts")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:parent/localPosts")
.header("content-type", "application/json")
.body("{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\n \"updateTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
alertType: '',
callToAction: {
actionType: '',
url: ''
},
createTime: '',
event: {
schedule: {
endDate: {
day: 0,
month: 0,
year: 0
},
endTime: {
hours: 0,
minutes: 0,
nanos: 0,
seconds: 0
},
startDate: {},
startTime: {}
},
title: ''
},
languageCode: '',
media: [
{
attribution: {
profileName: '',
profilePhotoUrl: '',
profileUrl: '',
takedownUrl: ''
},
createTime: '',
dataRef: {
resourceName: ''
},
description: '',
dimensions: {
heightPixels: 0,
widthPixels: 0
},
googleUrl: '',
insights: {
viewCount: ''
},
locationAssociation: {
category: '',
priceListItemId: ''
},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
}
],
name: '',
offer: {
couponCode: '',
redeemOnlineUrl: '',
termsConditions: ''
},
searchUrl: '',
state: '',
summary: '',
topicType: '',
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}}/v4/:parent/localPosts');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/localPosts',
headers: {'content-type': 'application/json'},
data: {
alertType: '',
callToAction: {actionType: '', url: ''},
createTime: '',
event: {
schedule: {
endDate: {day: 0, month: 0, year: 0},
endTime: {hours: 0, minutes: 0, nanos: 0, seconds: 0},
startDate: {},
startTime: {}
},
title: ''
},
languageCode: '',
media: [
{
attribution: {profileName: '', profilePhotoUrl: '', profileUrl: '', takedownUrl: ''},
createTime: '',
dataRef: {resourceName: ''},
description: '',
dimensions: {heightPixels: 0, widthPixels: 0},
googleUrl: '',
insights: {viewCount: ''},
locationAssociation: {category: '', priceListItemId: ''},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
}
],
name: '',
offer: {couponCode: '', redeemOnlineUrl: '', termsConditions: ''},
searchUrl: '',
state: '',
summary: '',
topicType: '',
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/localPosts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"alertType":"","callToAction":{"actionType":"","url":""},"createTime":"","event":{"schedule":{"endDate":{"day":0,"month":0,"year":0},"endTime":{"hours":0,"minutes":0,"nanos":0,"seconds":0},"startDate":{},"startTime":{}},"title":""},"languageCode":"","media":[{"attribution":{"profileName":"","profilePhotoUrl":"","profileUrl":"","takedownUrl":""},"createTime":"","dataRef":{"resourceName":""},"description":"","dimensions":{"heightPixels":0,"widthPixels":0},"googleUrl":"","insights":{"viewCount":""},"locationAssociation":{"category":"","priceListItemId":""},"mediaFormat":"","name":"","sourceUrl":"","thumbnailUrl":""}],"name":"","offer":{"couponCode":"","redeemOnlineUrl":"","termsConditions":""},"searchUrl":"","state":"","summary":"","topicType":"","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}}/v4/:parent/localPosts',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "alertType": "",\n "callToAction": {\n "actionType": "",\n "url": ""\n },\n "createTime": "",\n "event": {\n "schedule": {\n "endDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "endTime": {\n "hours": 0,\n "minutes": 0,\n "nanos": 0,\n "seconds": 0\n },\n "startDate": {},\n "startTime": {}\n },\n "title": ""\n },\n "languageCode": "",\n "media": [\n {\n "attribution": {\n "profileName": "",\n "profilePhotoUrl": "",\n "profileUrl": "",\n "takedownUrl": ""\n },\n "createTime": "",\n "dataRef": {\n "resourceName": ""\n },\n "description": "",\n "dimensions": {\n "heightPixels": 0,\n "widthPixels": 0\n },\n "googleUrl": "",\n "insights": {\n "viewCount": ""\n },\n "locationAssociation": {\n "category": "",\n "priceListItemId": ""\n },\n "mediaFormat": "",\n "name": "",\n "sourceUrl": "",\n "thumbnailUrl": ""\n }\n ],\n "name": "",\n "offer": {\n "couponCode": "",\n "redeemOnlineUrl": "",\n "termsConditions": ""\n },\n "searchUrl": "",\n "state": "",\n "summary": "",\n "topicType": "",\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 \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\n \"updateTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/localPosts")
.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/v4/:parent/localPosts',
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({
alertType: '',
callToAction: {actionType: '', url: ''},
createTime: '',
event: {
schedule: {
endDate: {day: 0, month: 0, year: 0},
endTime: {hours: 0, minutes: 0, nanos: 0, seconds: 0},
startDate: {},
startTime: {}
},
title: ''
},
languageCode: '',
media: [
{
attribution: {profileName: '', profilePhotoUrl: '', profileUrl: '', takedownUrl: ''},
createTime: '',
dataRef: {resourceName: ''},
description: '',
dimensions: {heightPixels: 0, widthPixels: 0},
googleUrl: '',
insights: {viewCount: ''},
locationAssociation: {category: '', priceListItemId: ''},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
}
],
name: '',
offer: {couponCode: '', redeemOnlineUrl: '', termsConditions: ''},
searchUrl: '',
state: '',
summary: '',
topicType: '',
updateTime: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/localPosts',
headers: {'content-type': 'application/json'},
body: {
alertType: '',
callToAction: {actionType: '', url: ''},
createTime: '',
event: {
schedule: {
endDate: {day: 0, month: 0, year: 0},
endTime: {hours: 0, minutes: 0, nanos: 0, seconds: 0},
startDate: {},
startTime: {}
},
title: ''
},
languageCode: '',
media: [
{
attribution: {profileName: '', profilePhotoUrl: '', profileUrl: '', takedownUrl: ''},
createTime: '',
dataRef: {resourceName: ''},
description: '',
dimensions: {heightPixels: 0, widthPixels: 0},
googleUrl: '',
insights: {viewCount: ''},
locationAssociation: {category: '', priceListItemId: ''},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
}
],
name: '',
offer: {couponCode: '', redeemOnlineUrl: '', termsConditions: ''},
searchUrl: '',
state: '',
summary: '',
topicType: '',
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}}/v4/:parent/localPosts');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
alertType: '',
callToAction: {
actionType: '',
url: ''
},
createTime: '',
event: {
schedule: {
endDate: {
day: 0,
month: 0,
year: 0
},
endTime: {
hours: 0,
minutes: 0,
nanos: 0,
seconds: 0
},
startDate: {},
startTime: {}
},
title: ''
},
languageCode: '',
media: [
{
attribution: {
profileName: '',
profilePhotoUrl: '',
profileUrl: '',
takedownUrl: ''
},
createTime: '',
dataRef: {
resourceName: ''
},
description: '',
dimensions: {
heightPixels: 0,
widthPixels: 0
},
googleUrl: '',
insights: {
viewCount: ''
},
locationAssociation: {
category: '',
priceListItemId: ''
},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
}
],
name: '',
offer: {
couponCode: '',
redeemOnlineUrl: '',
termsConditions: ''
},
searchUrl: '',
state: '',
summary: '',
topicType: '',
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}}/v4/:parent/localPosts',
headers: {'content-type': 'application/json'},
data: {
alertType: '',
callToAction: {actionType: '', url: ''},
createTime: '',
event: {
schedule: {
endDate: {day: 0, month: 0, year: 0},
endTime: {hours: 0, minutes: 0, nanos: 0, seconds: 0},
startDate: {},
startTime: {}
},
title: ''
},
languageCode: '',
media: [
{
attribution: {profileName: '', profilePhotoUrl: '', profileUrl: '', takedownUrl: ''},
createTime: '',
dataRef: {resourceName: ''},
description: '',
dimensions: {heightPixels: 0, widthPixels: 0},
googleUrl: '',
insights: {viewCount: ''},
locationAssociation: {category: '', priceListItemId: ''},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
}
],
name: '',
offer: {couponCode: '', redeemOnlineUrl: '', termsConditions: ''},
searchUrl: '',
state: '',
summary: '',
topicType: '',
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/localPosts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"alertType":"","callToAction":{"actionType":"","url":""},"createTime":"","event":{"schedule":{"endDate":{"day":0,"month":0,"year":0},"endTime":{"hours":0,"minutes":0,"nanos":0,"seconds":0},"startDate":{},"startTime":{}},"title":""},"languageCode":"","media":[{"attribution":{"profileName":"","profilePhotoUrl":"","profileUrl":"","takedownUrl":""},"createTime":"","dataRef":{"resourceName":""},"description":"","dimensions":{"heightPixels":0,"widthPixels":0},"googleUrl":"","insights":{"viewCount":""},"locationAssociation":{"category":"","priceListItemId":""},"mediaFormat":"","name":"","sourceUrl":"","thumbnailUrl":""}],"name":"","offer":{"couponCode":"","redeemOnlineUrl":"","termsConditions":""},"searchUrl":"","state":"","summary":"","topicType":"","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 = @{ @"alertType": @"",
@"callToAction": @{ @"actionType": @"", @"url": @"" },
@"createTime": @"",
@"event": @{ @"schedule": @{ @"endDate": @{ @"day": @0, @"month": @0, @"year": @0 }, @"endTime": @{ @"hours": @0, @"minutes": @0, @"nanos": @0, @"seconds": @0 }, @"startDate": @{ }, @"startTime": @{ } }, @"title": @"" },
@"languageCode": @"",
@"media": @[ @{ @"attribution": @{ @"profileName": @"", @"profilePhotoUrl": @"", @"profileUrl": @"", @"takedownUrl": @"" }, @"createTime": @"", @"dataRef": @{ @"resourceName": @"" }, @"description": @"", @"dimensions": @{ @"heightPixels": @0, @"widthPixels": @0 }, @"googleUrl": @"", @"insights": @{ @"viewCount": @"" }, @"locationAssociation": @{ @"category": @"", @"priceListItemId": @"" }, @"mediaFormat": @"", @"name": @"", @"sourceUrl": @"", @"thumbnailUrl": @"" } ],
@"name": @"",
@"offer": @{ @"couponCode": @"", @"redeemOnlineUrl": @"", @"termsConditions": @"" },
@"searchUrl": @"",
@"state": @"",
@"summary": @"",
@"topicType": @"",
@"updateTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:parent/localPosts"]
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}}/v4/:parent/localPosts" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\n \"updateTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/localPosts",
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([
'alertType' => '',
'callToAction' => [
'actionType' => '',
'url' => ''
],
'createTime' => '',
'event' => [
'schedule' => [
'endDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'endTime' => [
'hours' => 0,
'minutes' => 0,
'nanos' => 0,
'seconds' => 0
],
'startDate' => [
],
'startTime' => [
]
],
'title' => ''
],
'languageCode' => '',
'media' => [
[
'attribution' => [
'profileName' => '',
'profilePhotoUrl' => '',
'profileUrl' => '',
'takedownUrl' => ''
],
'createTime' => '',
'dataRef' => [
'resourceName' => ''
],
'description' => '',
'dimensions' => [
'heightPixels' => 0,
'widthPixels' => 0
],
'googleUrl' => '',
'insights' => [
'viewCount' => ''
],
'locationAssociation' => [
'category' => '',
'priceListItemId' => ''
],
'mediaFormat' => '',
'name' => '',
'sourceUrl' => '',
'thumbnailUrl' => ''
]
],
'name' => '',
'offer' => [
'couponCode' => '',
'redeemOnlineUrl' => '',
'termsConditions' => ''
],
'searchUrl' => '',
'state' => '',
'summary' => '',
'topicType' => '',
'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}}/v4/:parent/localPosts', [
'body' => '{
"alertType": "",
"callToAction": {
"actionType": "",
"url": ""
},
"createTime": "",
"event": {
"schedule": {
"endDate": {
"day": 0,
"month": 0,
"year": 0
},
"endTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
},
"startDate": {},
"startTime": {}
},
"title": ""
},
"languageCode": "",
"media": [
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
],
"name": "",
"offer": {
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
},
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"updateTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/localPosts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'alertType' => '',
'callToAction' => [
'actionType' => '',
'url' => ''
],
'createTime' => '',
'event' => [
'schedule' => [
'endDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'endTime' => [
'hours' => 0,
'minutes' => 0,
'nanos' => 0,
'seconds' => 0
],
'startDate' => [
],
'startTime' => [
]
],
'title' => ''
],
'languageCode' => '',
'media' => [
[
'attribution' => [
'profileName' => '',
'profilePhotoUrl' => '',
'profileUrl' => '',
'takedownUrl' => ''
],
'createTime' => '',
'dataRef' => [
'resourceName' => ''
],
'description' => '',
'dimensions' => [
'heightPixels' => 0,
'widthPixels' => 0
],
'googleUrl' => '',
'insights' => [
'viewCount' => ''
],
'locationAssociation' => [
'category' => '',
'priceListItemId' => ''
],
'mediaFormat' => '',
'name' => '',
'sourceUrl' => '',
'thumbnailUrl' => ''
]
],
'name' => '',
'offer' => [
'couponCode' => '',
'redeemOnlineUrl' => '',
'termsConditions' => ''
],
'searchUrl' => '',
'state' => '',
'summary' => '',
'topicType' => '',
'updateTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'alertType' => '',
'callToAction' => [
'actionType' => '',
'url' => ''
],
'createTime' => '',
'event' => [
'schedule' => [
'endDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'endTime' => [
'hours' => 0,
'minutes' => 0,
'nanos' => 0,
'seconds' => 0
],
'startDate' => [
],
'startTime' => [
]
],
'title' => ''
],
'languageCode' => '',
'media' => [
[
'attribution' => [
'profileName' => '',
'profilePhotoUrl' => '',
'profileUrl' => '',
'takedownUrl' => ''
],
'createTime' => '',
'dataRef' => [
'resourceName' => ''
],
'description' => '',
'dimensions' => [
'heightPixels' => 0,
'widthPixels' => 0
],
'googleUrl' => '',
'insights' => [
'viewCount' => ''
],
'locationAssociation' => [
'category' => '',
'priceListItemId' => ''
],
'mediaFormat' => '',
'name' => '',
'sourceUrl' => '',
'thumbnailUrl' => ''
]
],
'name' => '',
'offer' => [
'couponCode' => '',
'redeemOnlineUrl' => '',
'termsConditions' => ''
],
'searchUrl' => '',
'state' => '',
'summary' => '',
'topicType' => '',
'updateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:parent/localPosts');
$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}}/v4/:parent/localPosts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"alertType": "",
"callToAction": {
"actionType": "",
"url": ""
},
"createTime": "",
"event": {
"schedule": {
"endDate": {
"day": 0,
"month": 0,
"year": 0
},
"endTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
},
"startDate": {},
"startTime": {}
},
"title": ""
},
"languageCode": "",
"media": [
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
],
"name": "",
"offer": {
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
},
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"updateTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/localPosts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"alertType": "",
"callToAction": {
"actionType": "",
"url": ""
},
"createTime": "",
"event": {
"schedule": {
"endDate": {
"day": 0,
"month": 0,
"year": 0
},
"endTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
},
"startDate": {},
"startTime": {}
},
"title": ""
},
"languageCode": "",
"media": [
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
],
"name": "",
"offer": {
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
},
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"updateTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\n \"updateTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:parent/localPosts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/localPosts"
payload = {
"alertType": "",
"callToAction": {
"actionType": "",
"url": ""
},
"createTime": "",
"event": {
"schedule": {
"endDate": {
"day": 0,
"month": 0,
"year": 0
},
"endTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
},
"startDate": {},
"startTime": {}
},
"title": ""
},
"languageCode": "",
"media": [
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": { "resourceName": "" },
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": { "viewCount": "" },
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
],
"name": "",
"offer": {
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
},
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"updateTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/localPosts"
payload <- "{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\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}}/v4/:parent/localPosts")
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 \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\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/v4/:parent/localPosts') do |req|
req.body = "{\n \"alertType\": \"\",\n \"callToAction\": {\n \"actionType\": \"\",\n \"url\": \"\"\n },\n \"createTime\": \"\",\n \"event\": {\n \"schedule\": {\n \"endDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"endTime\": {\n \"hours\": 0,\n \"minutes\": 0,\n \"nanos\": 0,\n \"seconds\": 0\n },\n \"startDate\": {},\n \"startTime\": {}\n },\n \"title\": \"\"\n },\n \"languageCode\": \"\",\n \"media\": [\n {\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n }\n ],\n \"name\": \"\",\n \"offer\": {\n \"couponCode\": \"\",\n \"redeemOnlineUrl\": \"\",\n \"termsConditions\": \"\"\n },\n \"searchUrl\": \"\",\n \"state\": \"\",\n \"summary\": \"\",\n \"topicType\": \"\",\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}}/v4/:parent/localPosts";
let payload = json!({
"alertType": "",
"callToAction": json!({
"actionType": "",
"url": ""
}),
"createTime": "",
"event": json!({
"schedule": json!({
"endDate": json!({
"day": 0,
"month": 0,
"year": 0
}),
"endTime": json!({
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
}),
"startDate": json!({}),
"startTime": json!({})
}),
"title": ""
}),
"languageCode": "",
"media": (
json!({
"attribution": json!({
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
}),
"createTime": "",
"dataRef": json!({"resourceName": ""}),
"description": "",
"dimensions": json!({
"heightPixels": 0,
"widthPixels": 0
}),
"googleUrl": "",
"insights": json!({"viewCount": ""}),
"locationAssociation": json!({
"category": "",
"priceListItemId": ""
}),
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
})
),
"name": "",
"offer": json!({
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
}),
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"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}}/v4/:parent/localPosts \
--header 'content-type: application/json' \
--data '{
"alertType": "",
"callToAction": {
"actionType": "",
"url": ""
},
"createTime": "",
"event": {
"schedule": {
"endDate": {
"day": 0,
"month": 0,
"year": 0
},
"endTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
},
"startDate": {},
"startTime": {}
},
"title": ""
},
"languageCode": "",
"media": [
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
],
"name": "",
"offer": {
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
},
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"updateTime": ""
}'
echo '{
"alertType": "",
"callToAction": {
"actionType": "",
"url": ""
},
"createTime": "",
"event": {
"schedule": {
"endDate": {
"day": 0,
"month": 0,
"year": 0
},
"endTime": {
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
},
"startDate": {},
"startTime": {}
},
"title": ""
},
"languageCode": "",
"media": [
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
],
"name": "",
"offer": {
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
},
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"updateTime": ""
}' | \
http POST {{baseUrl}}/v4/:parent/localPosts \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "alertType": "",\n "callToAction": {\n "actionType": "",\n "url": ""\n },\n "createTime": "",\n "event": {\n "schedule": {\n "endDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "endTime": {\n "hours": 0,\n "minutes": 0,\n "nanos": 0,\n "seconds": 0\n },\n "startDate": {},\n "startTime": {}\n },\n "title": ""\n },\n "languageCode": "",\n "media": [\n {\n "attribution": {\n "profileName": "",\n "profilePhotoUrl": "",\n "profileUrl": "",\n "takedownUrl": ""\n },\n "createTime": "",\n "dataRef": {\n "resourceName": ""\n },\n "description": "",\n "dimensions": {\n "heightPixels": 0,\n "widthPixels": 0\n },\n "googleUrl": "",\n "insights": {\n "viewCount": ""\n },\n "locationAssociation": {\n "category": "",\n "priceListItemId": ""\n },\n "mediaFormat": "",\n "name": "",\n "sourceUrl": "",\n "thumbnailUrl": ""\n }\n ],\n "name": "",\n "offer": {\n "couponCode": "",\n "redeemOnlineUrl": "",\n "termsConditions": ""\n },\n "searchUrl": "",\n "state": "",\n "summary": "",\n "topicType": "",\n "updateTime": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:parent/localPosts
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"alertType": "",
"callToAction": [
"actionType": "",
"url": ""
],
"createTime": "",
"event": [
"schedule": [
"endDate": [
"day": 0,
"month": 0,
"year": 0
],
"endTime": [
"hours": 0,
"minutes": 0,
"nanos": 0,
"seconds": 0
],
"startDate": [],
"startTime": []
],
"title": ""
],
"languageCode": "",
"media": [
[
"attribution": [
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
],
"createTime": "",
"dataRef": ["resourceName": ""],
"description": "",
"dimensions": [
"heightPixels": 0,
"widthPixels": 0
],
"googleUrl": "",
"insights": ["viewCount": ""],
"locationAssociation": [
"category": "",
"priceListItemId": ""
],
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
]
],
"name": "",
"offer": [
"couponCode": "",
"redeemOnlineUrl": "",
"termsConditions": ""
],
"searchUrl": "",
"state": "",
"summary": "",
"topicType": "",
"updateTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/localPosts")! 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
mybusiness.accounts.locations.localPosts.list
{{baseUrl}}/v4/:parent/localPosts
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/localPosts");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/localPosts")
require "http/client"
url = "{{baseUrl}}/v4/:parent/localPosts"
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}}/v4/:parent/localPosts"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/localPosts");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/localPosts"
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/v4/:parent/localPosts HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/localPosts")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/localPosts"))
.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}}/v4/:parent/localPosts")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/localPosts")
.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}}/v4/:parent/localPosts');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/localPosts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/localPosts';
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}}/v4/:parent/localPosts',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/localPosts")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/localPosts',
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}}/v4/:parent/localPosts'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/localPosts');
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}}/v4/:parent/localPosts'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/localPosts';
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}}/v4/:parent/localPosts"]
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}}/v4/:parent/localPosts" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/localPosts",
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}}/v4/:parent/localPosts');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/localPosts');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/localPosts');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/localPosts' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/localPosts' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/localPosts")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/localPosts"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/localPosts"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/localPosts")
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/v4/:parent/localPosts') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/localPosts";
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}}/v4/:parent/localPosts
http GET {{baseUrl}}/v4/:parent/localPosts
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/localPosts
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/localPosts")! 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
mybusiness.accounts.locations.localPosts.reportInsights
{{baseUrl}}/v4/:name/localPosts:reportInsights
QUERY PARAMS
name
BODY json
{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"localPostNames": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name/localPosts:reportInsights");
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 \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name/localPosts:reportInsights" {:content-type :json
:form-params {:basicRequest {:metricRequests [{:metric ""
:options []}]
:timeRange {:endTime ""
:startTime ""}}
:localPostNames []}})
require "http/client"
url = "{{baseUrl}}/v4/:name/localPosts:reportInsights"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\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}}/v4/:name/localPosts:reportInsights"),
Content = new StringContent("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\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}}/v4/:name/localPosts:reportInsights");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name/localPosts:reportInsights"
payload := strings.NewReader("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\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/v4/:name/localPosts:reportInsights HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 210
{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"localPostNames": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name/localPosts:reportInsights")
.setHeader("content-type", "application/json")
.setBody("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name/localPosts:reportInsights"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\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 \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name/localPosts:reportInsights")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name/localPosts:reportInsights")
.header("content-type", "application/json")
.body("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\n}")
.asString();
const data = JSON.stringify({
basicRequest: {
metricRequests: [
{
metric: '',
options: []
}
],
timeRange: {
endTime: '',
startTime: ''
}
},
localPostNames: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name/localPosts:reportInsights');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name/localPosts:reportInsights',
headers: {'content-type': 'application/json'},
data: {
basicRequest: {
metricRequests: [{metric: '', options: []}],
timeRange: {endTime: '', startTime: ''}
},
localPostNames: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name/localPosts:reportInsights';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"basicRequest":{"metricRequests":[{"metric":"","options":[]}],"timeRange":{"endTime":"","startTime":""}},"localPostNames":[]}'
};
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}}/v4/:name/localPosts:reportInsights',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "basicRequest": {\n "metricRequests": [\n {\n "metric": "",\n "options": []\n }\n ],\n "timeRange": {\n "endTime": "",\n "startTime": ""\n }\n },\n "localPostNames": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name/localPosts:reportInsights")
.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/v4/:name/localPosts:reportInsights',
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({
basicRequest: {
metricRequests: [{metric: '', options: []}],
timeRange: {endTime: '', startTime: ''}
},
localPostNames: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name/localPosts:reportInsights',
headers: {'content-type': 'application/json'},
body: {
basicRequest: {
metricRequests: [{metric: '', options: []}],
timeRange: {endTime: '', startTime: ''}
},
localPostNames: []
},
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}}/v4/:name/localPosts:reportInsights');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
basicRequest: {
metricRequests: [
{
metric: '',
options: []
}
],
timeRange: {
endTime: '',
startTime: ''
}
},
localPostNames: []
});
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}}/v4/:name/localPosts:reportInsights',
headers: {'content-type': 'application/json'},
data: {
basicRequest: {
metricRequests: [{metric: '', options: []}],
timeRange: {endTime: '', startTime: ''}
},
localPostNames: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name/localPosts:reportInsights';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"basicRequest":{"metricRequests":[{"metric":"","options":[]}],"timeRange":{"endTime":"","startTime":""}},"localPostNames":[]}'
};
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 = @{ @"basicRequest": @{ @"metricRequests": @[ @{ @"metric": @"", @"options": @[ ] } ], @"timeRange": @{ @"endTime": @"", @"startTime": @"" } },
@"localPostNames": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name/localPosts:reportInsights"]
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}}/v4/:name/localPosts:reportInsights" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name/localPosts:reportInsights",
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([
'basicRequest' => [
'metricRequests' => [
[
'metric' => '',
'options' => [
]
]
],
'timeRange' => [
'endTime' => '',
'startTime' => ''
]
],
'localPostNames' => [
]
]),
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}}/v4/:name/localPosts:reportInsights', [
'body' => '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"localPostNames": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name/localPosts:reportInsights');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'basicRequest' => [
'metricRequests' => [
[
'metric' => '',
'options' => [
]
]
],
'timeRange' => [
'endTime' => '',
'startTime' => ''
]
],
'localPostNames' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'basicRequest' => [
'metricRequests' => [
[
'metric' => '',
'options' => [
]
]
],
'timeRange' => [
'endTime' => '',
'startTime' => ''
]
],
'localPostNames' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name/localPosts:reportInsights');
$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}}/v4/:name/localPosts:reportInsights' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"localPostNames": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name/localPosts:reportInsights' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"localPostNames": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name/localPosts:reportInsights", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name/localPosts:reportInsights"
payload = {
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"localPostNames": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name/localPosts:reportInsights"
payload <- "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\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}}/v4/:name/localPosts:reportInsights")
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 \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\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/v4/:name/localPosts:reportInsights') do |req|
req.body = "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"localPostNames\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name/localPosts:reportInsights";
let payload = json!({
"basicRequest": json!({
"metricRequests": (
json!({
"metric": "",
"options": ()
})
),
"timeRange": json!({
"endTime": "",
"startTime": ""
})
}),
"localPostNames": ()
});
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}}/v4/:name/localPosts:reportInsights \
--header 'content-type: application/json' \
--data '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"localPostNames": []
}'
echo '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"localPostNames": []
}' | \
http POST {{baseUrl}}/v4/:name/localPosts:reportInsights \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "basicRequest": {\n "metricRequests": [\n {\n "metric": "",\n "options": []\n }\n ],\n "timeRange": {\n "endTime": "",\n "startTime": ""\n }\n },\n "localPostNames": []\n}' \
--output-document \
- {{baseUrl}}/v4/:name/localPosts:reportInsights
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"basicRequest": [
"metricRequests": [
[
"metric": "",
"options": []
]
],
"timeRange": [
"endTime": "",
"startTime": ""
]
],
"localPostNames": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name/localPosts:reportInsights")! 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
mybusiness.accounts.locations.lodging.getGoogleUpdated
{{baseUrl}}/v4/:name:getGoogleUpdated
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:getGoogleUpdated");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:name:getGoogleUpdated")
require "http/client"
url = "{{baseUrl}}/v4/:name:getGoogleUpdated"
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}}/v4/:name:getGoogleUpdated"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:name:getGoogleUpdated");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:getGoogleUpdated"
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/v4/:name:getGoogleUpdated HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:name:getGoogleUpdated")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:getGoogleUpdated"))
.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}}/v4/:name:getGoogleUpdated")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:name:getGoogleUpdated")
.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}}/v4/:name:getGoogleUpdated');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:name:getGoogleUpdated'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:getGoogleUpdated';
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}}/v4/:name:getGoogleUpdated',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:getGoogleUpdated")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:name:getGoogleUpdated',
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}}/v4/:name:getGoogleUpdated'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:name:getGoogleUpdated');
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}}/v4/:name:getGoogleUpdated'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:getGoogleUpdated';
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}}/v4/:name:getGoogleUpdated"]
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}}/v4/:name:getGoogleUpdated" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:getGoogleUpdated",
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}}/v4/:name:getGoogleUpdated');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:getGoogleUpdated');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:name:getGoogleUpdated');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:name:getGoogleUpdated' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:getGoogleUpdated' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:name:getGoogleUpdated")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:getGoogleUpdated"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:getGoogleUpdated"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:name:getGoogleUpdated")
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/v4/:name:getGoogleUpdated') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:getGoogleUpdated";
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}}/v4/:name:getGoogleUpdated
http GET {{baseUrl}}/v4/:name:getGoogleUpdated
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:name:getGoogleUpdated
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:getGoogleUpdated")! 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
mybusiness.accounts.locations.media.create
{{baseUrl}}/v4/:parent/media
QUERY PARAMS
parent
BODY json
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/media");
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 \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:parent/media" {:content-type :json
:form-params {:attribution {:profileName ""
:profilePhotoUrl ""
:profileUrl ""
:takedownUrl ""}
:createTime ""
:dataRef {:resourceName ""}
:description ""
:dimensions {:heightPixels 0
:widthPixels 0}
:googleUrl ""
:insights {:viewCount ""}
:locationAssociation {:category ""
:priceListItemId ""}
:mediaFormat ""
:name ""
:sourceUrl ""
:thumbnailUrl ""}})
require "http/client"
url = "{{baseUrl}}/v4/:parent/media"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\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}}/v4/:parent/media"),
Content = new StringContent("{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\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}}/v4/:parent/media");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/media"
payload := strings.NewReader("{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\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/v4/:parent/media HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 485
{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:parent/media")
.setHeader("content-type", "application/json")
.setBody("{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/media"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\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 \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:parent/media")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:parent/media")
.header("content-type", "application/json")
.body("{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n}")
.asString();
const data = JSON.stringify({
attribution: {
profileName: '',
profilePhotoUrl: '',
profileUrl: '',
takedownUrl: ''
},
createTime: '',
dataRef: {
resourceName: ''
},
description: '',
dimensions: {
heightPixels: 0,
widthPixels: 0
},
googleUrl: '',
insights: {
viewCount: ''
},
locationAssociation: {
category: '',
priceListItemId: ''
},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:parent/media');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/media',
headers: {'content-type': 'application/json'},
data: {
attribution: {profileName: '', profilePhotoUrl: '', profileUrl: '', takedownUrl: ''},
createTime: '',
dataRef: {resourceName: ''},
description: '',
dimensions: {heightPixels: 0, widthPixels: 0},
googleUrl: '',
insights: {viewCount: ''},
locationAssociation: {category: '', priceListItemId: ''},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/media';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attribution":{"profileName":"","profilePhotoUrl":"","profileUrl":"","takedownUrl":""},"createTime":"","dataRef":{"resourceName":""},"description":"","dimensions":{"heightPixels":0,"widthPixels":0},"googleUrl":"","insights":{"viewCount":""},"locationAssociation":{"category":"","priceListItemId":""},"mediaFormat":"","name":"","sourceUrl":"","thumbnailUrl":""}'
};
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}}/v4/:parent/media',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "attribution": {\n "profileName": "",\n "profilePhotoUrl": "",\n "profileUrl": "",\n "takedownUrl": ""\n },\n "createTime": "",\n "dataRef": {\n "resourceName": ""\n },\n "description": "",\n "dimensions": {\n "heightPixels": 0,\n "widthPixels": 0\n },\n "googleUrl": "",\n "insights": {\n "viewCount": ""\n },\n "locationAssociation": {\n "category": "",\n "priceListItemId": ""\n },\n "mediaFormat": "",\n "name": "",\n "sourceUrl": "",\n "thumbnailUrl": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/media")
.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/v4/:parent/media',
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({
attribution: {profileName: '', profilePhotoUrl: '', profileUrl: '', takedownUrl: ''},
createTime: '',
dataRef: {resourceName: ''},
description: '',
dimensions: {heightPixels: 0, widthPixels: 0},
googleUrl: '',
insights: {viewCount: ''},
locationAssociation: {category: '', priceListItemId: ''},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/media',
headers: {'content-type': 'application/json'},
body: {
attribution: {profileName: '', profilePhotoUrl: '', profileUrl: '', takedownUrl: ''},
createTime: '',
dataRef: {resourceName: ''},
description: '',
dimensions: {heightPixels: 0, widthPixels: 0},
googleUrl: '',
insights: {viewCount: ''},
locationAssociation: {category: '', priceListItemId: ''},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
},
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}}/v4/:parent/media');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
attribution: {
profileName: '',
profilePhotoUrl: '',
profileUrl: '',
takedownUrl: ''
},
createTime: '',
dataRef: {
resourceName: ''
},
description: '',
dimensions: {
heightPixels: 0,
widthPixels: 0
},
googleUrl: '',
insights: {
viewCount: ''
},
locationAssociation: {
category: '',
priceListItemId: ''
},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
});
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}}/v4/:parent/media',
headers: {'content-type': 'application/json'},
data: {
attribution: {profileName: '', profilePhotoUrl: '', profileUrl: '', takedownUrl: ''},
createTime: '',
dataRef: {resourceName: ''},
description: '',
dimensions: {heightPixels: 0, widthPixels: 0},
googleUrl: '',
insights: {viewCount: ''},
locationAssociation: {category: '', priceListItemId: ''},
mediaFormat: '',
name: '',
sourceUrl: '',
thumbnailUrl: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/media';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"attribution":{"profileName":"","profilePhotoUrl":"","profileUrl":"","takedownUrl":""},"createTime":"","dataRef":{"resourceName":""},"description":"","dimensions":{"heightPixels":0,"widthPixels":0},"googleUrl":"","insights":{"viewCount":""},"locationAssociation":{"category":"","priceListItemId":""},"mediaFormat":"","name":"","sourceUrl":"","thumbnailUrl":""}'
};
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 = @{ @"attribution": @{ @"profileName": @"", @"profilePhotoUrl": @"", @"profileUrl": @"", @"takedownUrl": @"" },
@"createTime": @"",
@"dataRef": @{ @"resourceName": @"" },
@"description": @"",
@"dimensions": @{ @"heightPixels": @0, @"widthPixels": @0 },
@"googleUrl": @"",
@"insights": @{ @"viewCount": @"" },
@"locationAssociation": @{ @"category": @"", @"priceListItemId": @"" },
@"mediaFormat": @"",
@"name": @"",
@"sourceUrl": @"",
@"thumbnailUrl": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:parent/media"]
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}}/v4/:parent/media" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/media",
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([
'attribution' => [
'profileName' => '',
'profilePhotoUrl' => '',
'profileUrl' => '',
'takedownUrl' => ''
],
'createTime' => '',
'dataRef' => [
'resourceName' => ''
],
'description' => '',
'dimensions' => [
'heightPixels' => 0,
'widthPixels' => 0
],
'googleUrl' => '',
'insights' => [
'viewCount' => ''
],
'locationAssociation' => [
'category' => '',
'priceListItemId' => ''
],
'mediaFormat' => '',
'name' => '',
'sourceUrl' => '',
'thumbnailUrl' => ''
]),
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}}/v4/:parent/media', [
'body' => '{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/media');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'attribution' => [
'profileName' => '',
'profilePhotoUrl' => '',
'profileUrl' => '',
'takedownUrl' => ''
],
'createTime' => '',
'dataRef' => [
'resourceName' => ''
],
'description' => '',
'dimensions' => [
'heightPixels' => 0,
'widthPixels' => 0
],
'googleUrl' => '',
'insights' => [
'viewCount' => ''
],
'locationAssociation' => [
'category' => '',
'priceListItemId' => ''
],
'mediaFormat' => '',
'name' => '',
'sourceUrl' => '',
'thumbnailUrl' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'attribution' => [
'profileName' => '',
'profilePhotoUrl' => '',
'profileUrl' => '',
'takedownUrl' => ''
],
'createTime' => '',
'dataRef' => [
'resourceName' => ''
],
'description' => '',
'dimensions' => [
'heightPixels' => 0,
'widthPixels' => 0
],
'googleUrl' => '',
'insights' => [
'viewCount' => ''
],
'locationAssociation' => [
'category' => '',
'priceListItemId' => ''
],
'mediaFormat' => '',
'name' => '',
'sourceUrl' => '',
'thumbnailUrl' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:parent/media');
$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}}/v4/:parent/media' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/media' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:parent/media", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/media"
payload = {
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": { "resourceName": "" },
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": { "viewCount": "" },
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/media"
payload <- "{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\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}}/v4/:parent/media")
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 \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\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/v4/:parent/media') do |req|
req.body = "{\n \"attribution\": {\n \"profileName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"profileUrl\": \"\",\n \"takedownUrl\": \"\"\n },\n \"createTime\": \"\",\n \"dataRef\": {\n \"resourceName\": \"\"\n },\n \"description\": \"\",\n \"dimensions\": {\n \"heightPixels\": 0,\n \"widthPixels\": 0\n },\n \"googleUrl\": \"\",\n \"insights\": {\n \"viewCount\": \"\"\n },\n \"locationAssociation\": {\n \"category\": \"\",\n \"priceListItemId\": \"\"\n },\n \"mediaFormat\": \"\",\n \"name\": \"\",\n \"sourceUrl\": \"\",\n \"thumbnailUrl\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/media";
let payload = json!({
"attribution": json!({
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
}),
"createTime": "",
"dataRef": json!({"resourceName": ""}),
"description": "",
"dimensions": json!({
"heightPixels": 0,
"widthPixels": 0
}),
"googleUrl": "",
"insights": json!({"viewCount": ""}),
"locationAssociation": json!({
"category": "",
"priceListItemId": ""
}),
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
});
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}}/v4/:parent/media \
--header 'content-type: application/json' \
--data '{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}'
echo '{
"attribution": {
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
},
"createTime": "",
"dataRef": {
"resourceName": ""
},
"description": "",
"dimensions": {
"heightPixels": 0,
"widthPixels": 0
},
"googleUrl": "",
"insights": {
"viewCount": ""
},
"locationAssociation": {
"category": "",
"priceListItemId": ""
},
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
}' | \
http POST {{baseUrl}}/v4/:parent/media \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "attribution": {\n "profileName": "",\n "profilePhotoUrl": "",\n "profileUrl": "",\n "takedownUrl": ""\n },\n "createTime": "",\n "dataRef": {\n "resourceName": ""\n },\n "description": "",\n "dimensions": {\n "heightPixels": 0,\n "widthPixels": 0\n },\n "googleUrl": "",\n "insights": {\n "viewCount": ""\n },\n "locationAssociation": {\n "category": "",\n "priceListItemId": ""\n },\n "mediaFormat": "",\n "name": "",\n "sourceUrl": "",\n "thumbnailUrl": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:parent/media
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"attribution": [
"profileName": "",
"profilePhotoUrl": "",
"profileUrl": "",
"takedownUrl": ""
],
"createTime": "",
"dataRef": ["resourceName": ""],
"description": "",
"dimensions": [
"heightPixels": 0,
"widthPixels": 0
],
"googleUrl": "",
"insights": ["viewCount": ""],
"locationAssociation": [
"category": "",
"priceListItemId": ""
],
"mediaFormat": "",
"name": "",
"sourceUrl": "",
"thumbnailUrl": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/media")! 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
mybusiness.accounts.locations.media.customers.list
{{baseUrl}}/v4/:parent/media/customers
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/media/customers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/media/customers")
require "http/client"
url = "{{baseUrl}}/v4/:parent/media/customers"
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}}/v4/:parent/media/customers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/media/customers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/media/customers"
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/v4/:parent/media/customers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/media/customers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/media/customers"))
.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}}/v4/:parent/media/customers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/media/customers")
.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}}/v4/:parent/media/customers');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/media/customers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/media/customers';
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}}/v4/:parent/media/customers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/media/customers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/media/customers',
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}}/v4/:parent/media/customers'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/media/customers');
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}}/v4/:parent/media/customers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/media/customers';
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}}/v4/:parent/media/customers"]
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}}/v4/:parent/media/customers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/media/customers",
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}}/v4/:parent/media/customers');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/media/customers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/media/customers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/media/customers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/media/customers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/media/customers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/media/customers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/media/customers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/media/customers")
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/v4/:parent/media/customers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/media/customers";
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}}/v4/:parent/media/customers
http GET {{baseUrl}}/v4/:parent/media/customers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/media/customers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/media/customers")! 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
mybusiness.accounts.locations.media.list
{{baseUrl}}/v4/:parent/media
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/media");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/media")
require "http/client"
url = "{{baseUrl}}/v4/:parent/media"
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}}/v4/:parent/media"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/media");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/media"
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/v4/:parent/media HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/media")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/media"))
.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}}/v4/:parent/media")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/media")
.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}}/v4/:parent/media');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/media'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/media';
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}}/v4/:parent/media',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/media")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/media',
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}}/v4/:parent/media'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/media');
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}}/v4/:parent/media'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/media';
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}}/v4/:parent/media"]
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}}/v4/:parent/media" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/media",
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}}/v4/:parent/media');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/media');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/media');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/media' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/media' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/media")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/media"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/media"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/media")
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/v4/:parent/media') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/media";
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}}/v4/:parent/media
http GET {{baseUrl}}/v4/:parent/media
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/media
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/media")! 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
mybusiness.accounts.locations.media.startUpload
{{baseUrl}}/v4/:parent/media:startUpload
QUERY PARAMS
parent
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/media:startUpload");
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}}/v4/:parent/media:startUpload" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v4/:parent/media:startUpload"
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}}/v4/:parent/media:startUpload"),
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}}/v4/:parent/media:startUpload");
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}}/v4/:parent/media:startUpload"
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/v4/:parent/media:startUpload HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:parent/media:startUpload")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/media:startUpload"))
.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}}/v4/:parent/media:startUpload")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:parent/media:startUpload")
.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}}/v4/:parent/media:startUpload');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/media:startUpload',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/media:startUpload';
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}}/v4/:parent/media:startUpload',
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}}/v4/:parent/media:startUpload")
.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/v4/:parent/media:startUpload',
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}}/v4/:parent/media:startUpload',
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}}/v4/:parent/media:startUpload');
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}}/v4/:parent/media:startUpload',
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}}/v4/:parent/media:startUpload';
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}}/v4/:parent/media:startUpload"]
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}}/v4/:parent/media:startUpload" 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}}/v4/:parent/media:startUpload",
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}}/v4/:parent/media:startUpload', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/media:startUpload');
$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}}/v4/:parent/media:startUpload');
$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}}/v4/:parent/media:startUpload' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/media:startUpload' -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/v4/:parent/media:startUpload", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/media:startUpload"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/media:startUpload"
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}}/v4/:parent/media:startUpload")
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/v4/:parent/media:startUpload') 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}}/v4/:parent/media:startUpload";
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}}/v4/:parent/media:startUpload \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v4/:parent/media:startUpload \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v4/:parent/media:startUpload
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}}/v4/:parent/media:startUpload")! 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
mybusiness.accounts.locations.questions.answers.delete
{{baseUrl}}/v4/:parent/answers:delete
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/answers:delete");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v4/:parent/answers:delete")
require "http/client"
url = "{{baseUrl}}/v4/:parent/answers:delete"
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}}/v4/:parent/answers:delete"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/answers:delete");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/answers:delete"
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/v4/:parent/answers:delete HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v4/:parent/answers:delete")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/answers:delete"))
.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}}/v4/:parent/answers:delete")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v4/:parent/answers:delete")
.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}}/v4/:parent/answers:delete');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v4/:parent/answers:delete'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/answers:delete';
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}}/v4/:parent/answers:delete',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/answers:delete")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/answers:delete',
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}}/v4/:parent/answers:delete'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v4/:parent/answers:delete');
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}}/v4/:parent/answers:delete'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/answers:delete';
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}}/v4/:parent/answers:delete"]
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}}/v4/:parent/answers:delete" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/answers:delete",
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}}/v4/:parent/answers:delete');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/answers:delete');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/answers:delete');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/answers:delete' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/answers:delete' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v4/:parent/answers:delete")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/answers:delete"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/answers:delete"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/answers:delete")
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/v4/:parent/answers:delete') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/answers:delete";
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}}/v4/:parent/answers:delete
http DELETE {{baseUrl}}/v4/:parent/answers:delete
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v4/:parent/answers:delete
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/answers:delete")! 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
mybusiness.accounts.locations.questions.answers.list
{{baseUrl}}/v4/:parent/answers
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/answers");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/answers")
require "http/client"
url = "{{baseUrl}}/v4/:parent/answers"
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}}/v4/:parent/answers"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/answers");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/answers"
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/v4/:parent/answers HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/answers")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/answers"))
.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}}/v4/:parent/answers")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/answers")
.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}}/v4/:parent/answers');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/answers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/answers';
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}}/v4/:parent/answers',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/answers")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/answers',
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}}/v4/:parent/answers'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/answers');
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}}/v4/:parent/answers'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/answers';
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}}/v4/:parent/answers"]
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}}/v4/:parent/answers" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/answers",
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}}/v4/:parent/answers');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/answers');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/answers');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/answers' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/answers' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/answers")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/answers"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/answers"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/answers")
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/v4/:parent/answers') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/answers";
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}}/v4/:parent/answers
http GET {{baseUrl}}/v4/:parent/answers
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/answers
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/answers")! 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
mybusiness.accounts.locations.questions.answers.upsert
{{baseUrl}}/v4/:parent/answers:upsert
QUERY PARAMS
parent
BODY json
{
"answer": {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/answers:upsert");
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 \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:parent/answers:upsert" {:content-type :json
:form-params {:answer {:author {:displayName ""
:profilePhotoUrl ""
:type ""}
:createTime ""
:name ""
:text ""
:updateTime ""
:upvoteCount 0}}})
require "http/client"
url = "{{baseUrl}}/v4/:parent/answers:upsert"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/:parent/answers:upsert"),
Content = new StringContent("{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/:parent/answers:upsert");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/answers:upsert"
payload := strings.NewReader("{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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/v4/:parent/answers:upsert HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 212
{
"answer": {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:parent/answers:upsert")
.setHeader("content-type", "application/json")
.setBody("{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/answers:upsert"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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 \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:parent/answers:upsert")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:parent/answers:upsert")
.header("content-type", "application/json")
.body("{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n}")
.asString();
const data = JSON.stringify({
answer: {
author: {
displayName: '',
profilePhotoUrl: '',
type: ''
},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:parent/answers:upsert');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/answers:upsert',
headers: {'content-type': 'application/json'},
data: {
answer: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/answers:upsert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"answer":{"author":{"displayName":"","profilePhotoUrl":"","type":""},"createTime":"","name":"","text":"","updateTime":"","upvoteCount":0}}'
};
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}}/v4/:parent/answers:upsert',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "answer": {\n "author": {\n "displayName": "",\n "profilePhotoUrl": "",\n "type": ""\n },\n "createTime": "",\n "name": "",\n "text": "",\n "updateTime": "",\n "upvoteCount": 0\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 \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/answers:upsert")
.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/v4/:parent/answers:upsert',
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({
answer: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/answers:upsert',
headers: {'content-type': 'application/json'},
body: {
answer: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
},
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}}/v4/:parent/answers:upsert');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
answer: {
author: {
displayName: '',
profilePhotoUrl: '',
type: ''
},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
});
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}}/v4/:parent/answers:upsert',
headers: {'content-type': 'application/json'},
data: {
answer: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/answers:upsert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"answer":{"author":{"displayName":"","profilePhotoUrl":"","type":""},"createTime":"","name":"","text":"","updateTime":"","upvoteCount":0}}'
};
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 = @{ @"answer": @{ @"author": @{ @"displayName": @"", @"profilePhotoUrl": @"", @"type": @"" }, @"createTime": @"", @"name": @"", @"text": @"", @"updateTime": @"", @"upvoteCount": @0 } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:parent/answers:upsert"]
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}}/v4/:parent/answers:upsert" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/answers:upsert",
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([
'answer' => [
'author' => [
'displayName' => '',
'profilePhotoUrl' => '',
'type' => ''
],
'createTime' => '',
'name' => '',
'text' => '',
'updateTime' => '',
'upvoteCount' => 0
]
]),
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}}/v4/:parent/answers:upsert', [
'body' => '{
"answer": {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/answers:upsert');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'answer' => [
'author' => [
'displayName' => '',
'profilePhotoUrl' => '',
'type' => ''
],
'createTime' => '',
'name' => '',
'text' => '',
'updateTime' => '',
'upvoteCount' => 0
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'answer' => [
'author' => [
'displayName' => '',
'profilePhotoUrl' => '',
'type' => ''
],
'createTime' => '',
'name' => '',
'text' => '',
'updateTime' => '',
'upvoteCount' => 0
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/:parent/answers:upsert');
$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}}/v4/:parent/answers:upsert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"answer": {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/answers:upsert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"answer": {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:parent/answers:upsert", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/answers:upsert"
payload = { "answer": {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/answers:upsert"
payload <- "{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/:parent/answers:upsert")
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 \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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/v4/:parent/answers:upsert') do |req|
req.body = "{\n \"answer\": {\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/answers:upsert";
let payload = json!({"answer": json!({
"author": json!({
"displayName": "",
"profilePhotoUrl": "",
"type": ""
}),
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
})});
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}}/v4/:parent/answers:upsert \
--header 'content-type: application/json' \
--data '{
"answer": {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
}'
echo '{
"answer": {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
}' | \
http POST {{baseUrl}}/v4/:parent/answers:upsert \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "answer": {\n "author": {\n "displayName": "",\n "profilePhotoUrl": "",\n "type": ""\n },\n "createTime": "",\n "name": "",\n "text": "",\n "updateTime": "",\n "upvoteCount": 0\n }\n}' \
--output-document \
- {{baseUrl}}/v4/:parent/answers:upsert
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["answer": [
"author": [
"displayName": "",
"profilePhotoUrl": "",
"type": ""
],
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/answers:upsert")! 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
mybusiness.accounts.locations.questions.create
{{baseUrl}}/v4/:parent/questions
QUERY PARAMS
parent
BODY json
{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/questions");
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 \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:parent/questions" {:content-type :json
:form-params {:author {:displayName ""
:profilePhotoUrl ""
:type ""}
:createTime ""
:name ""
:text ""
:topAnswers [{:author {}
:createTime ""
:name ""
:text ""
:updateTime ""
:upvoteCount 0}]
:totalAnswerCount 0
:updateTime ""
:upvoteCount 0}})
require "http/client"
url = "{{baseUrl}}/v4/:parent/questions"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/:parent/questions"),
Content = new StringContent("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/:parent/questions");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/questions"
payload := strings.NewReader("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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/v4/:parent/questions HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 361
{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:parent/questions")
.setHeader("content-type", "application/json")
.setBody("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/questions"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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 \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:parent/questions")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:parent/questions")
.header("content-type", "application/json")
.body("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}")
.asString();
const data = JSON.stringify({
author: {
displayName: '',
profilePhotoUrl: '',
type: ''
},
createTime: '',
name: '',
text: '',
topAnswers: [
{
author: {},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:parent/questions');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/questions',
headers: {'content-type': 'application/json'},
data: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
topAnswers: [
{author: {}, createTime: '', name: '', text: '', updateTime: '', upvoteCount: 0}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/questions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"author":{"displayName":"","profilePhotoUrl":"","type":""},"createTime":"","name":"","text":"","topAnswers":[{"author":{},"createTime":"","name":"","text":"","updateTime":"","upvoteCount":0}],"totalAnswerCount":0,"updateTime":"","upvoteCount":0}'
};
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}}/v4/:parent/questions',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "author": {\n "displayName": "",\n "profilePhotoUrl": "",\n "type": ""\n },\n "createTime": "",\n "name": "",\n "text": "",\n "topAnswers": [\n {\n "author": {},\n "createTime": "",\n "name": "",\n "text": "",\n "updateTime": "",\n "upvoteCount": 0\n }\n ],\n "totalAnswerCount": 0,\n "updateTime": "",\n "upvoteCount": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/questions")
.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/v4/:parent/questions',
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({
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
topAnswers: [
{author: {}, createTime: '', name: '', text: '', updateTime: '', upvoteCount: 0}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:parent/questions',
headers: {'content-type': 'application/json'},
body: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
topAnswers: [
{author: {}, createTime: '', name: '', text: '', updateTime: '', upvoteCount: 0}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
},
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}}/v4/:parent/questions');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
author: {
displayName: '',
profilePhotoUrl: '',
type: ''
},
createTime: '',
name: '',
text: '',
topAnswers: [
{
author: {},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
});
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}}/v4/:parent/questions',
headers: {'content-type': 'application/json'},
data: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
topAnswers: [
{author: {}, createTime: '', name: '', text: '', updateTime: '', upvoteCount: 0}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/questions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"author":{"displayName":"","profilePhotoUrl":"","type":""},"createTime":"","name":"","text":"","topAnswers":[{"author":{},"createTime":"","name":"","text":"","updateTime":"","upvoteCount":0}],"totalAnswerCount":0,"updateTime":"","upvoteCount":0}'
};
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 = @{ @"author": @{ @"displayName": @"", @"profilePhotoUrl": @"", @"type": @"" },
@"createTime": @"",
@"name": @"",
@"text": @"",
@"topAnswers": @[ @{ @"author": @{ }, @"createTime": @"", @"name": @"", @"text": @"", @"updateTime": @"", @"upvoteCount": @0 } ],
@"totalAnswerCount": @0,
@"updateTime": @"",
@"upvoteCount": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:parent/questions"]
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}}/v4/:parent/questions" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/questions",
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([
'author' => [
'displayName' => '',
'profilePhotoUrl' => '',
'type' => ''
],
'createTime' => '',
'name' => '',
'text' => '',
'topAnswers' => [
[
'author' => [
],
'createTime' => '',
'name' => '',
'text' => '',
'updateTime' => '',
'upvoteCount' => 0
]
],
'totalAnswerCount' => 0,
'updateTime' => '',
'upvoteCount' => 0
]),
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}}/v4/:parent/questions', [
'body' => '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/questions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'author' => [
'displayName' => '',
'profilePhotoUrl' => '',
'type' => ''
],
'createTime' => '',
'name' => '',
'text' => '',
'topAnswers' => [
[
'author' => [
],
'createTime' => '',
'name' => '',
'text' => '',
'updateTime' => '',
'upvoteCount' => 0
]
],
'totalAnswerCount' => 0,
'updateTime' => '',
'upvoteCount' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'author' => [
'displayName' => '',
'profilePhotoUrl' => '',
'type' => ''
],
'createTime' => '',
'name' => '',
'text' => '',
'topAnswers' => [
[
'author' => [
],
'createTime' => '',
'name' => '',
'text' => '',
'updateTime' => '',
'upvoteCount' => 0
]
],
'totalAnswerCount' => 0,
'updateTime' => '',
'upvoteCount' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v4/:parent/questions');
$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}}/v4/:parent/questions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/questions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:parent/questions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/questions"
payload = {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/questions"
payload <- "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/:parent/questions")
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 \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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/v4/:parent/questions') do |req|
req.body = "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/questions";
let payload = json!({
"author": json!({
"displayName": "",
"profilePhotoUrl": "",
"type": ""
}),
"createTime": "",
"name": "",
"text": "",
"topAnswers": (
json!({
"author": json!({}),
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
})
),
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
});
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}}/v4/:parent/questions \
--header 'content-type: application/json' \
--data '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}'
echo '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}' | \
http POST {{baseUrl}}/v4/:parent/questions \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "author": {\n "displayName": "",\n "profilePhotoUrl": "",\n "type": ""\n },\n "createTime": "",\n "name": "",\n "text": "",\n "topAnswers": [\n {\n "author": {},\n "createTime": "",\n "name": "",\n "text": "",\n "updateTime": "",\n "upvoteCount": 0\n }\n ],\n "totalAnswerCount": 0,\n "updateTime": "",\n "upvoteCount": 0\n}' \
--output-document \
- {{baseUrl}}/v4/:parent/questions
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"author": [
"displayName": "",
"profilePhotoUrl": "",
"type": ""
],
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
[
"author": [],
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
]
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/questions")! 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
mybusiness.accounts.locations.questions.delete
{{baseUrl}}/v4/: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}}/v4/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v4/:name")
require "http/client"
url = "{{baseUrl}}/v4/: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}}/v4/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:name");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/: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/v4/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v4/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/: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}}/v4/:name")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v4/: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}}/v4/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v4/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/: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}}/v4/:name',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/: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/v4/: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}}/v4/: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}}/v4/: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}}/v4/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/: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}}/v4/: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}}/v4/:name" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/: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}}/v4/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:name');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:name' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v4/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/: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/v4/: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}}/v4/: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}}/v4/:name
http DELETE {{baseUrl}}/v4/:name
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v4/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/: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
mybusiness.accounts.locations.questions.list
{{baseUrl}}/v4/:parent/questions
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/questions");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/questions")
require "http/client"
url = "{{baseUrl}}/v4/:parent/questions"
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}}/v4/:parent/questions"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/questions");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/questions"
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/v4/:parent/questions HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/questions")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/questions"))
.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}}/v4/:parent/questions")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/questions")
.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}}/v4/:parent/questions');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/questions'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/questions';
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}}/v4/:parent/questions',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/questions")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/questions',
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}}/v4/:parent/questions'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/questions');
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}}/v4/:parent/questions'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/questions';
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}}/v4/:parent/questions"]
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}}/v4/:parent/questions" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/questions",
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}}/v4/:parent/questions');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/questions');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/questions');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/questions' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/questions' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/questions")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/questions"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/questions"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/questions")
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/v4/:parent/questions') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/questions";
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}}/v4/:parent/questions
http GET {{baseUrl}}/v4/:parent/questions
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/questions
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/questions")! 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
mybusiness.accounts.locations.questions.patch
{{baseUrl}}/v4/:name
QUERY PARAMS
name
BODY json
{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/: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 \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/v4/:name" {:content-type :json
:form-params {:author {:displayName ""
:profilePhotoUrl ""
:type ""}
:createTime ""
:name ""
:text ""
:topAnswers [{:author {}
:createTime ""
:name ""
:text ""
:updateTime ""
:upvoteCount 0}]
:totalAnswerCount 0
:updateTime ""
:upvoteCount 0}})
require "http/client"
url = "{{baseUrl}}/v4/:name"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/:name"),
Content = new StringContent("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/:name");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name"
payload := strings.NewReader("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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/v4/:name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 361
{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/v4/:name")
.setHeader("content-type", "application/json")
.setBody("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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 \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/v4/:name")
.header("content-type", "application/json")
.body("{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}")
.asString();
const data = JSON.stringify({
author: {
displayName: '',
profilePhotoUrl: '',
type: ''
},
createTime: '',
name: '',
text: '',
topAnswers: [
{
author: {},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/v4/:name');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v4/:name',
headers: {'content-type': 'application/json'},
data: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
topAnswers: [
{author: {}, createTime: '', name: '', text: '', updateTime: '', upvoteCount: 0}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"author":{"displayName":"","profilePhotoUrl":"","type":""},"createTime":"","name":"","text":"","topAnswers":[{"author":{},"createTime":"","name":"","text":"","updateTime":"","upvoteCount":0}],"totalAnswerCount":0,"updateTime":"","upvoteCount":0}'
};
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}}/v4/:name',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "author": {\n "displayName": "",\n "profilePhotoUrl": "",\n "type": ""\n },\n "createTime": "",\n "name": "",\n "text": "",\n "topAnswers": [\n {\n "author": {},\n "createTime": "",\n "name": "",\n "text": "",\n "updateTime": "",\n "upvoteCount": 0\n }\n ],\n "totalAnswerCount": 0,\n "updateTime": "",\n "upvoteCount": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/: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/v4/: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({
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
topAnswers: [
{author: {}, createTime: '', name: '', text: '', updateTime: '', upvoteCount: 0}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v4/:name',
headers: {'content-type': 'application/json'},
body: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
topAnswers: [
{author: {}, createTime: '', name: '', text: '', updateTime: '', upvoteCount: 0}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
},
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}}/v4/:name');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
author: {
displayName: '',
profilePhotoUrl: '',
type: ''
},
createTime: '',
name: '',
text: '',
topAnswers: [
{
author: {},
createTime: '',
name: '',
text: '',
updateTime: '',
upvoteCount: 0
}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
});
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}}/v4/:name',
headers: {'content-type': 'application/json'},
data: {
author: {displayName: '', profilePhotoUrl: '', type: ''},
createTime: '',
name: '',
text: '',
topAnswers: [
{author: {}, createTime: '', name: '', text: '', updateTime: '', upvoteCount: 0}
],
totalAnswerCount: 0,
updateTime: '',
upvoteCount: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"author":{"displayName":"","profilePhotoUrl":"","type":""},"createTime":"","name":"","text":"","topAnswers":[{"author":{},"createTime":"","name":"","text":"","updateTime":"","upvoteCount":0}],"totalAnswerCount":0,"updateTime":"","upvoteCount":0}'
};
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 = @{ @"author": @{ @"displayName": @"", @"profilePhotoUrl": @"", @"type": @"" },
@"createTime": @"",
@"name": @"",
@"text": @"",
@"topAnswers": @[ @{ @"author": @{ }, @"createTime": @"", @"name": @"", @"text": @"", @"updateTime": @"", @"upvoteCount": @0 } ],
@"totalAnswerCount": @0,
@"updateTime": @"",
@"upvoteCount": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/: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}}/v4/:name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/: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([
'author' => [
'displayName' => '',
'profilePhotoUrl' => '',
'type' => ''
],
'createTime' => '',
'name' => '',
'text' => '',
'topAnswers' => [
[
'author' => [
],
'createTime' => '',
'name' => '',
'text' => '',
'updateTime' => '',
'upvoteCount' => 0
]
],
'totalAnswerCount' => 0,
'updateTime' => '',
'upvoteCount' => 0
]),
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}}/v4/:name', [
'body' => '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'author' => [
'displayName' => '',
'profilePhotoUrl' => '',
'type' => ''
],
'createTime' => '',
'name' => '',
'text' => '',
'topAnswers' => [
[
'author' => [
],
'createTime' => '',
'name' => '',
'text' => '',
'updateTime' => '',
'upvoteCount' => 0
]
],
'totalAnswerCount' => 0,
'updateTime' => '',
'upvoteCount' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'author' => [
'displayName' => '',
'profilePhotoUrl' => '',
'type' => ''
],
'createTime' => '',
'name' => '',
'text' => '',
'topAnswers' => [
[
'author' => [
],
'createTime' => '',
'name' => '',
'text' => '',
'updateTime' => '',
'upvoteCount' => 0
]
],
'totalAnswerCount' => 0,
'updateTime' => '',
'upvoteCount' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v4/: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}}/v4/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/v4/:name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name"
payload = {
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name"
payload <- "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/: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 \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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/v4/:name') do |req|
req.body = "{\n \"author\": {\n \"displayName\": \"\",\n \"profilePhotoUrl\": \"\",\n \"type\": \"\"\n },\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"topAnswers\": [\n {\n \"author\": {},\n \"createTime\": \"\",\n \"name\": \"\",\n \"text\": \"\",\n \"updateTime\": \"\",\n \"upvoteCount\": 0\n }\n ],\n \"totalAnswerCount\": 0,\n \"updateTime\": \"\",\n \"upvoteCount\": 0\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}}/v4/:name";
let payload = json!({
"author": json!({
"displayName": "",
"profilePhotoUrl": "",
"type": ""
}),
"createTime": "",
"name": "",
"text": "",
"topAnswers": (
json!({
"author": json!({}),
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
})
),
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
});
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}}/v4/:name \
--header 'content-type: application/json' \
--data '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}'
echo '{
"author": {
"displayName": "",
"profilePhotoUrl": "",
"type": ""
},
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
{
"author": {},
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
}
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
}' | \
http PATCH {{baseUrl}}/v4/:name \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "author": {\n "displayName": "",\n "profilePhotoUrl": "",\n "type": ""\n },\n "createTime": "",\n "name": "",\n "text": "",\n "topAnswers": [\n {\n "author": {},\n "createTime": "",\n "name": "",\n "text": "",\n "updateTime": "",\n "upvoteCount": 0\n }\n ],\n "totalAnswerCount": 0,\n "updateTime": "",\n "upvoteCount": 0\n}' \
--output-document \
- {{baseUrl}}/v4/:name
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"author": [
"displayName": "",
"profilePhotoUrl": "",
"type": ""
],
"createTime": "",
"name": "",
"text": "",
"topAnswers": [
[
"author": [],
"createTime": "",
"name": "",
"text": "",
"updateTime": "",
"upvoteCount": 0
]
],
"totalAnswerCount": 0,
"updateTime": "",
"upvoteCount": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/: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
mybusiness.accounts.locations.reportInsights
{{baseUrl}}/v4/:name/locations:reportInsights
QUERY PARAMS
name
BODY json
{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"drivingDirectionsRequest": {
"languageCode": "",
"numDays": ""
},
"locationNames": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name/locations:reportInsights");
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 \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name/locations:reportInsights" {:content-type :json
:form-params {:basicRequest {:metricRequests [{:metric ""
:options []}]
:timeRange {:endTime ""
:startTime ""}}
:drivingDirectionsRequest {:languageCode ""
:numDays ""}
:locationNames []}})
require "http/client"
url = "{{baseUrl}}/v4/:name/locations:reportInsights"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\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}}/v4/:name/locations:reportInsights"),
Content = new StringContent("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\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}}/v4/:name/locations:reportInsights");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name/locations:reportInsights"
payload := strings.NewReader("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\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/v4/:name/locations:reportInsights HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 288
{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"drivingDirectionsRequest": {
"languageCode": "",
"numDays": ""
},
"locationNames": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name/locations:reportInsights")
.setHeader("content-type", "application/json")
.setBody("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name/locations:reportInsights"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\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 \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name/locations:reportInsights")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name/locations:reportInsights")
.header("content-type", "application/json")
.body("{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\n}")
.asString();
const data = JSON.stringify({
basicRequest: {
metricRequests: [
{
metric: '',
options: []
}
],
timeRange: {
endTime: '',
startTime: ''
}
},
drivingDirectionsRequest: {
languageCode: '',
numDays: ''
},
locationNames: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name/locations:reportInsights');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name/locations:reportInsights',
headers: {'content-type': 'application/json'},
data: {
basicRequest: {
metricRequests: [{metric: '', options: []}],
timeRange: {endTime: '', startTime: ''}
},
drivingDirectionsRequest: {languageCode: '', numDays: ''},
locationNames: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name/locations:reportInsights';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"basicRequest":{"metricRequests":[{"metric":"","options":[]}],"timeRange":{"endTime":"","startTime":""}},"drivingDirectionsRequest":{"languageCode":"","numDays":""},"locationNames":[]}'
};
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}}/v4/:name/locations:reportInsights',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "basicRequest": {\n "metricRequests": [\n {\n "metric": "",\n "options": []\n }\n ],\n "timeRange": {\n "endTime": "",\n "startTime": ""\n }\n },\n "drivingDirectionsRequest": {\n "languageCode": "",\n "numDays": ""\n },\n "locationNames": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name/locations:reportInsights")
.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/v4/:name/locations:reportInsights',
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({
basicRequest: {
metricRequests: [{metric: '', options: []}],
timeRange: {endTime: '', startTime: ''}
},
drivingDirectionsRequest: {languageCode: '', numDays: ''},
locationNames: []
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name/locations:reportInsights',
headers: {'content-type': 'application/json'},
body: {
basicRequest: {
metricRequests: [{metric: '', options: []}],
timeRange: {endTime: '', startTime: ''}
},
drivingDirectionsRequest: {languageCode: '', numDays: ''},
locationNames: []
},
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}}/v4/:name/locations:reportInsights');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
basicRequest: {
metricRequests: [
{
metric: '',
options: []
}
],
timeRange: {
endTime: '',
startTime: ''
}
},
drivingDirectionsRequest: {
languageCode: '',
numDays: ''
},
locationNames: []
});
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}}/v4/:name/locations:reportInsights',
headers: {'content-type': 'application/json'},
data: {
basicRequest: {
metricRequests: [{metric: '', options: []}],
timeRange: {endTime: '', startTime: ''}
},
drivingDirectionsRequest: {languageCode: '', numDays: ''},
locationNames: []
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name/locations:reportInsights';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"basicRequest":{"metricRequests":[{"metric":"","options":[]}],"timeRange":{"endTime":"","startTime":""}},"drivingDirectionsRequest":{"languageCode":"","numDays":""},"locationNames":[]}'
};
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 = @{ @"basicRequest": @{ @"metricRequests": @[ @{ @"metric": @"", @"options": @[ ] } ], @"timeRange": @{ @"endTime": @"", @"startTime": @"" } },
@"drivingDirectionsRequest": @{ @"languageCode": @"", @"numDays": @"" },
@"locationNames": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name/locations:reportInsights"]
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}}/v4/:name/locations:reportInsights" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name/locations:reportInsights",
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([
'basicRequest' => [
'metricRequests' => [
[
'metric' => '',
'options' => [
]
]
],
'timeRange' => [
'endTime' => '',
'startTime' => ''
]
],
'drivingDirectionsRequest' => [
'languageCode' => '',
'numDays' => ''
],
'locationNames' => [
]
]),
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}}/v4/:name/locations:reportInsights', [
'body' => '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"drivingDirectionsRequest": {
"languageCode": "",
"numDays": ""
},
"locationNames": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name/locations:reportInsights');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'basicRequest' => [
'metricRequests' => [
[
'metric' => '',
'options' => [
]
]
],
'timeRange' => [
'endTime' => '',
'startTime' => ''
]
],
'drivingDirectionsRequest' => [
'languageCode' => '',
'numDays' => ''
],
'locationNames' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'basicRequest' => [
'metricRequests' => [
[
'metric' => '',
'options' => [
]
]
],
'timeRange' => [
'endTime' => '',
'startTime' => ''
]
],
'drivingDirectionsRequest' => [
'languageCode' => '',
'numDays' => ''
],
'locationNames' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name/locations:reportInsights');
$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}}/v4/:name/locations:reportInsights' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"drivingDirectionsRequest": {
"languageCode": "",
"numDays": ""
},
"locationNames": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name/locations:reportInsights' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"drivingDirectionsRequest": {
"languageCode": "",
"numDays": ""
},
"locationNames": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name/locations:reportInsights", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name/locations:reportInsights"
payload = {
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"drivingDirectionsRequest": {
"languageCode": "",
"numDays": ""
},
"locationNames": []
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name/locations:reportInsights"
payload <- "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\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}}/v4/:name/locations:reportInsights")
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 \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\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/v4/:name/locations:reportInsights') do |req|
req.body = "{\n \"basicRequest\": {\n \"metricRequests\": [\n {\n \"metric\": \"\",\n \"options\": []\n }\n ],\n \"timeRange\": {\n \"endTime\": \"\",\n \"startTime\": \"\"\n }\n },\n \"drivingDirectionsRequest\": {\n \"languageCode\": \"\",\n \"numDays\": \"\"\n },\n \"locationNames\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name/locations:reportInsights";
let payload = json!({
"basicRequest": json!({
"metricRequests": (
json!({
"metric": "",
"options": ()
})
),
"timeRange": json!({
"endTime": "",
"startTime": ""
})
}),
"drivingDirectionsRequest": json!({
"languageCode": "",
"numDays": ""
}),
"locationNames": ()
});
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}}/v4/:name/locations:reportInsights \
--header 'content-type: application/json' \
--data '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"drivingDirectionsRequest": {
"languageCode": "",
"numDays": ""
},
"locationNames": []
}'
echo '{
"basicRequest": {
"metricRequests": [
{
"metric": "",
"options": []
}
],
"timeRange": {
"endTime": "",
"startTime": ""
}
},
"drivingDirectionsRequest": {
"languageCode": "",
"numDays": ""
},
"locationNames": []
}' | \
http POST {{baseUrl}}/v4/:name/locations:reportInsights \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "basicRequest": {\n "metricRequests": [\n {\n "metric": "",\n "options": []\n }\n ],\n "timeRange": {\n "endTime": "",\n "startTime": ""\n }\n },\n "drivingDirectionsRequest": {\n "languageCode": "",\n "numDays": ""\n },\n "locationNames": []\n}' \
--output-document \
- {{baseUrl}}/v4/:name/locations:reportInsights
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"basicRequest": [
"metricRequests": [
[
"metric": "",
"options": []
]
],
"timeRange": [
"endTime": "",
"startTime": ""
]
],
"drivingDirectionsRequest": [
"languageCode": "",
"numDays": ""
],
"locationNames": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name/locations:reportInsights")! 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
mybusiness.accounts.locations.reviews.deleteReply
{{baseUrl}}/v4/:name/reply
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name/reply");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v4/:name/reply")
require "http/client"
url = "{{baseUrl}}/v4/:name/reply"
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}}/v4/:name/reply"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:name/reply");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name/reply"
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/v4/:name/reply HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v4/:name/reply")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name/reply"))
.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}}/v4/:name/reply")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v4/:name/reply")
.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}}/v4/:name/reply');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v4/:name/reply'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name/reply';
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}}/v4/:name/reply',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name/reply")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:name/reply',
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}}/v4/:name/reply'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v4/:name/reply');
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}}/v4/:name/reply'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name/reply';
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}}/v4/:name/reply"]
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}}/v4/:name/reply" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name/reply",
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}}/v4/:name/reply');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name/reply');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:name/reply');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:name/reply' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name/reply' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v4/:name/reply")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name/reply"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name/reply"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:name/reply")
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/v4/:name/reply') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name/reply";
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}}/v4/:name/reply
http DELETE {{baseUrl}}/v4/:name/reply
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v4/:name/reply
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name/reply")! 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
mybusiness.accounts.locations.reviews.list
{{baseUrl}}/v4/:parent/reviews
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/reviews");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/reviews")
require "http/client"
url = "{{baseUrl}}/v4/:parent/reviews"
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}}/v4/:parent/reviews"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/reviews");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/reviews"
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/v4/:parent/reviews HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/reviews")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/reviews"))
.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}}/v4/:parent/reviews")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/reviews")
.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}}/v4/:parent/reviews');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/reviews'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/reviews';
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}}/v4/:parent/reviews',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/reviews")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/reviews',
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}}/v4/:parent/reviews'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/reviews');
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}}/v4/:parent/reviews'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/reviews';
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}}/v4/:parent/reviews"]
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}}/v4/:parent/reviews" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/reviews",
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}}/v4/:parent/reviews');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/reviews');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/reviews');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/reviews' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/reviews' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/reviews")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/reviews"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/reviews"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/reviews")
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/v4/:parent/reviews') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/reviews";
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}}/v4/:parent/reviews
http GET {{baseUrl}}/v4/:parent/reviews
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/reviews
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/reviews")! 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()
PUT
mybusiness.accounts.locations.reviews.updateReply
{{baseUrl}}/v4/:name/reply
QUERY PARAMS
name
BODY json
{
"comment": "",
"updateTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name/reply");
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 \"comment\": \"\",\n \"updateTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/v4/:name/reply" {:content-type :json
:form-params {:comment ""
:updateTime ""}})
require "http/client"
url = "{{baseUrl}}/v4/:name/reply"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"comment\": \"\",\n \"updateTime\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/v4/:name/reply"),
Content = new StringContent("{\n \"comment\": \"\",\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}}/v4/:name/reply");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"comment\": \"\",\n \"updateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name/reply"
payload := strings.NewReader("{\n \"comment\": \"\",\n \"updateTime\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/v4/:name/reply HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 39
{
"comment": "",
"updateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/v4/:name/reply")
.setHeader("content-type", "application/json")
.setBody("{\n \"comment\": \"\",\n \"updateTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name/reply"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"comment\": \"\",\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 \"comment\": \"\",\n \"updateTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name/reply")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/v4/:name/reply")
.header("content-type", "application/json")
.body("{\n \"comment\": \"\",\n \"updateTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
comment: '',
updateTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/v4/:name/reply');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/v4/:name/reply',
headers: {'content-type': 'application/json'},
data: {comment: '', updateTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name/reply';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"comment":"","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}}/v4/:name/reply',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "comment": "",\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 \"comment\": \"\",\n \"updateTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name/reply")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:name/reply',
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({comment: '', updateTime: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/v4/:name/reply',
headers: {'content-type': 'application/json'},
body: {comment: '', 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('PUT', '{{baseUrl}}/v4/:name/reply');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
comment: '',
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: 'PUT',
url: '{{baseUrl}}/v4/:name/reply',
headers: {'content-type': 'application/json'},
data: {comment: '', updateTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name/reply';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"comment":"","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 = @{ @"comment": @"",
@"updateTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name/reply"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/v4/:name/reply" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"comment\": \"\",\n \"updateTime\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name/reply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'comment' => '',
'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('PUT', '{{baseUrl}}/v4/:name/reply', [
'body' => '{
"comment": "",
"updateTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name/reply');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'comment' => '',
'updateTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'comment' => '',
'updateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name/reply');
$request->setRequestMethod('PUT');
$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}}/v4/:name/reply' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"comment": "",
"updateTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name/reply' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"comment": "",
"updateTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"comment\": \"\",\n \"updateTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/v4/:name/reply", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name/reply"
payload = {
"comment": "",
"updateTime": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name/reply"
payload <- "{\n \"comment\": \"\",\n \"updateTime\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:name/reply")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"comment\": \"\",\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.put('/baseUrl/v4/:name/reply') do |req|
req.body = "{\n \"comment\": \"\",\n \"updateTime\": \"\"\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}}/v4/:name/reply";
let payload = json!({
"comment": "",
"updateTime": ""
});
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("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/v4/:name/reply \
--header 'content-type: application/json' \
--data '{
"comment": "",
"updateTime": ""
}'
echo '{
"comment": "",
"updateTime": ""
}' | \
http PUT {{baseUrl}}/v4/:name/reply \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "comment": "",\n "updateTime": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:name/reply
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"comment": "",
"updateTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name/reply")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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
mybusiness.accounts.locations.transfer
{{baseUrl}}/v4/:name:transfer
QUERY PARAMS
name
BODY json
{
"toAccount": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:transfer");
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 \"toAccount\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name:transfer" {:content-type :json
:form-params {:toAccount ""}})
require "http/client"
url = "{{baseUrl}}/v4/:name:transfer"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"toAccount\": \"\"\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}}/v4/:name:transfer"),
Content = new StringContent("{\n \"toAccount\": \"\"\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}}/v4/:name:transfer");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"toAccount\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:transfer"
payload := strings.NewReader("{\n \"toAccount\": \"\"\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/v4/:name:transfer HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"toAccount": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:transfer")
.setHeader("content-type", "application/json")
.setBody("{\n \"toAccount\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:transfer"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"toAccount\": \"\"\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 \"toAccount\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name:transfer")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:transfer")
.header("content-type", "application/json")
.body("{\n \"toAccount\": \"\"\n}")
.asString();
const data = JSON.stringify({
toAccount: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name:transfer');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:transfer',
headers: {'content-type': 'application/json'},
data: {toAccount: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:transfer';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"toAccount":""}'
};
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}}/v4/:name:transfer',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "toAccount": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"toAccount\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:transfer")
.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/v4/:name:transfer',
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({toAccount: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:transfer',
headers: {'content-type': 'application/json'},
body: {toAccount: ''},
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}}/v4/:name:transfer');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
toAccount: ''
});
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}}/v4/:name:transfer',
headers: {'content-type': 'application/json'},
data: {toAccount: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:transfer';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"toAccount":""}'
};
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 = @{ @"toAccount": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name:transfer"]
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}}/v4/:name:transfer" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"toAccount\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:transfer",
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([
'toAccount' => ''
]),
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}}/v4/:name:transfer', [
'body' => '{
"toAccount": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:transfer');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'toAccount' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'toAccount' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name:transfer');
$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}}/v4/:name:transfer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"toAccount": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:transfer' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"toAccount": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"toAccount\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name:transfer", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:transfer"
payload = { "toAccount": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:transfer"
payload <- "{\n \"toAccount\": \"\"\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}}/v4/:name:transfer")
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 \"toAccount\": \"\"\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/v4/:name:transfer') do |req|
req.body = "{\n \"toAccount\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:transfer";
let payload = json!({"toAccount": ""});
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}}/v4/:name:transfer \
--header 'content-type: application/json' \
--data '{
"toAccount": ""
}'
echo '{
"toAccount": ""
}' | \
http POST {{baseUrl}}/v4/:name:transfer \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "toAccount": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:name:transfer
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["toAccount": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:transfer")! 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
mybusiness.accounts.locations.verifications.complete
{{baseUrl}}/v4/:name:complete
QUERY PARAMS
name
BODY json
{
"pin": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:complete");
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 \"pin\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name:complete" {:content-type :json
:form-params {:pin ""}})
require "http/client"
url = "{{baseUrl}}/v4/:name:complete"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"pin\": \"\"\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}}/v4/:name:complete"),
Content = new StringContent("{\n \"pin\": \"\"\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}}/v4/:name:complete");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"pin\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:complete"
payload := strings.NewReader("{\n \"pin\": \"\"\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/v4/:name:complete HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 15
{
"pin": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:complete")
.setHeader("content-type", "application/json")
.setBody("{\n \"pin\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:complete"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"pin\": \"\"\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 \"pin\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name:complete")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:complete")
.header("content-type", "application/json")
.body("{\n \"pin\": \"\"\n}")
.asString();
const data = JSON.stringify({
pin: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name:complete');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:complete',
headers: {'content-type': 'application/json'},
data: {pin: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:complete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"pin":""}'
};
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}}/v4/:name:complete',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "pin": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"pin\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:complete")
.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/v4/:name:complete',
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({pin: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:complete',
headers: {'content-type': 'application/json'},
body: {pin: ''},
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}}/v4/:name:complete');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
pin: ''
});
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}}/v4/:name:complete',
headers: {'content-type': 'application/json'},
data: {pin: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:complete';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"pin":""}'
};
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 = @{ @"pin": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name:complete"]
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}}/v4/:name:complete" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"pin\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:complete",
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([
'pin' => ''
]),
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}}/v4/:name:complete', [
'body' => '{
"pin": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:complete');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'pin' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'pin' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name:complete');
$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}}/v4/:name:complete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"pin": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:complete' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"pin": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"pin\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name:complete", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:complete"
payload = { "pin": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:complete"
payload <- "{\n \"pin\": \"\"\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}}/v4/:name:complete")
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 \"pin\": \"\"\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/v4/:name:complete') do |req|
req.body = "{\n \"pin\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:complete";
let payload = json!({"pin": ""});
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}}/v4/:name:complete \
--header 'content-type: application/json' \
--data '{
"pin": ""
}'
echo '{
"pin": ""
}' | \
http POST {{baseUrl}}/v4/:name:complete \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "pin": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:name:complete
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["pin": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:complete")! 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
mybusiness.accounts.locations.verifications.list
{{baseUrl}}/v4/:parent/verifications
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:parent/verifications");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:parent/verifications")
require "http/client"
url = "{{baseUrl}}/v4/:parent/verifications"
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}}/v4/:parent/verifications"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:parent/verifications");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:parent/verifications"
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/v4/:parent/verifications HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:parent/verifications")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:parent/verifications"))
.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}}/v4/:parent/verifications")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/:parent/verifications")
.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}}/v4/:parent/verifications');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:parent/verifications'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:parent/verifications';
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}}/v4/:parent/verifications',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:parent/verifications")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/:parent/verifications',
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}}/v4/:parent/verifications'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/:parent/verifications');
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}}/v4/:parent/verifications'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:parent/verifications';
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}}/v4/:parent/verifications"]
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}}/v4/:parent/verifications" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:parent/verifications",
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}}/v4/:parent/verifications');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:parent/verifications');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:parent/verifications');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:parent/verifications' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:parent/verifications' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:parent/verifications")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:parent/verifications"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:parent/verifications"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:parent/verifications")
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/v4/:parent/verifications') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:parent/verifications";
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}}/v4/:parent/verifications
http GET {{baseUrl}}/v4/:parent/verifications
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:parent/verifications
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:parent/verifications")! 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
mybusiness.accounts.locations.verify
{{baseUrl}}/v4/:name:verify
QUERY PARAMS
name
BODY json
{
"addressInput": {
"mailerContactName": ""
},
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"emailInput": {
"emailAddress": ""
},
"languageCode": "",
"method": "",
"phoneInput": {
"phoneNumber": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:verify");
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 \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name:verify" {:content-type :json
:form-params {:addressInput {:mailerContactName ""}
:context {:address {:addressLines []
:administrativeArea ""
:languageCode ""
:locality ""
:organization ""
:postalCode ""
:recipients []
:regionCode ""
:revision 0
:sortingCode ""
:sublocality ""}}
:emailInput {:emailAddress ""}
:languageCode ""
:method ""
:phoneInput {:phoneNumber ""}}})
require "http/client"
url = "{{baseUrl}}/v4/:name:verify"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\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}}/v4/:name:verify"),
Content = new StringContent("{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\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}}/v4/:name:verify");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:verify"
payload := strings.NewReader("{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\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/v4/:name:verify HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 501
{
"addressInput": {
"mailerContactName": ""
},
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"emailInput": {
"emailAddress": ""
},
"languageCode": "",
"method": "",
"phoneInput": {
"phoneNumber": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:verify")
.setHeader("content-type", "application/json")
.setBody("{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:verify"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\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 \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name:verify")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:verify")
.header("content-type", "application/json")
.body("{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
addressInput: {
mailerContactName: ''
},
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
emailInput: {
emailAddress: ''
},
languageCode: '',
method: '',
phoneInput: {
phoneNumber: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name:verify');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:verify',
headers: {'content-type': 'application/json'},
data: {
addressInput: {mailerContactName: ''},
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
emailInput: {emailAddress: ''},
languageCode: '',
method: '',
phoneInput: {phoneNumber: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:verify';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"addressInput":{"mailerContactName":""},"context":{"address":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""}},"emailInput":{"emailAddress":""},"languageCode":"","method":"","phoneInput":{"phoneNumber":""}}'
};
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}}/v4/:name:verify',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "addressInput": {\n "mailerContactName": ""\n },\n "context": {\n "address": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n }\n },\n "emailInput": {\n "emailAddress": ""\n },\n "languageCode": "",\n "method": "",\n "phoneInput": {\n "phoneNumber": ""\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 \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:verify")
.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/v4/:name:verify',
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({
addressInput: {mailerContactName: ''},
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
emailInput: {emailAddress: ''},
languageCode: '',
method: '',
phoneInput: {phoneNumber: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:verify',
headers: {'content-type': 'application/json'},
body: {
addressInput: {mailerContactName: ''},
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
emailInput: {emailAddress: ''},
languageCode: '',
method: '',
phoneInput: {phoneNumber: ''}
},
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}}/v4/:name:verify');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
addressInput: {
mailerContactName: ''
},
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
emailInput: {
emailAddress: ''
},
languageCode: '',
method: '',
phoneInput: {
phoneNumber: ''
}
});
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}}/v4/:name:verify',
headers: {'content-type': 'application/json'},
data: {
addressInput: {mailerContactName: ''},
context: {
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
}
},
emailInput: {emailAddress: ''},
languageCode: '',
method: '',
phoneInput: {phoneNumber: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:verify';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"addressInput":{"mailerContactName":""},"context":{"address":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""}},"emailInput":{"emailAddress":""},"languageCode":"","method":"","phoneInput":{"phoneNumber":""}}'
};
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 = @{ @"addressInput": @{ @"mailerContactName": @"" },
@"context": @{ @"address": @{ @"addressLines": @[ ], @"administrativeArea": @"", @"languageCode": @"", @"locality": @"", @"organization": @"", @"postalCode": @"", @"recipients": @[ ], @"regionCode": @"", @"revision": @0, @"sortingCode": @"", @"sublocality": @"" } },
@"emailInput": @{ @"emailAddress": @"" },
@"languageCode": @"",
@"method": @"",
@"phoneInput": @{ @"phoneNumber": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name:verify"]
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}}/v4/:name:verify" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:verify",
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([
'addressInput' => [
'mailerContactName' => ''
],
'context' => [
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
]
],
'emailInput' => [
'emailAddress' => ''
],
'languageCode' => '',
'method' => '',
'phoneInput' => [
'phoneNumber' => ''
]
]),
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}}/v4/:name:verify', [
'body' => '{
"addressInput": {
"mailerContactName": ""
},
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"emailInput": {
"emailAddress": ""
},
"languageCode": "",
"method": "",
"phoneInput": {
"phoneNumber": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:verify');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'addressInput' => [
'mailerContactName' => ''
],
'context' => [
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
]
],
'emailInput' => [
'emailAddress' => ''
],
'languageCode' => '',
'method' => '',
'phoneInput' => [
'phoneNumber' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'addressInput' => [
'mailerContactName' => ''
],
'context' => [
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
]
],
'emailInput' => [
'emailAddress' => ''
],
'languageCode' => '',
'method' => '',
'phoneInput' => [
'phoneNumber' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name:verify');
$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}}/v4/:name:verify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"addressInput": {
"mailerContactName": ""
},
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"emailInput": {
"emailAddress": ""
},
"languageCode": "",
"method": "",
"phoneInput": {
"phoneNumber": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:verify' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"addressInput": {
"mailerContactName": ""
},
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"emailInput": {
"emailAddress": ""
},
"languageCode": "",
"method": "",
"phoneInput": {
"phoneNumber": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name:verify", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:verify"
payload = {
"addressInput": { "mailerContactName": "" },
"context": { "address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
} },
"emailInput": { "emailAddress": "" },
"languageCode": "",
"method": "",
"phoneInput": { "phoneNumber": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:verify"
payload <- "{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\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}}/v4/:name:verify")
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 \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\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/v4/:name:verify') do |req|
req.body = "{\n \"addressInput\": {\n \"mailerContactName\": \"\"\n },\n \"context\": {\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n }\n },\n \"emailInput\": {\n \"emailAddress\": \"\"\n },\n \"languageCode\": \"\",\n \"method\": \"\",\n \"phoneInput\": {\n \"phoneNumber\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:verify";
let payload = json!({
"addressInput": json!({"mailerContactName": ""}),
"context": json!({"address": json!({
"addressLines": (),
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": (),
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
})}),
"emailInput": json!({"emailAddress": ""}),
"languageCode": "",
"method": "",
"phoneInput": json!({"phoneNumber": ""})
});
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}}/v4/:name:verify \
--header 'content-type: application/json' \
--data '{
"addressInput": {
"mailerContactName": ""
},
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"emailInput": {
"emailAddress": ""
},
"languageCode": "",
"method": "",
"phoneInput": {
"phoneNumber": ""
}
}'
echo '{
"addressInput": {
"mailerContactName": ""
},
"context": {
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}
},
"emailInput": {
"emailAddress": ""
},
"languageCode": "",
"method": "",
"phoneInput": {
"phoneNumber": ""
}
}' | \
http POST {{baseUrl}}/v4/:name:verify \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "addressInput": {\n "mailerContactName": ""\n },\n "context": {\n "address": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n }\n },\n "emailInput": {\n "emailAddress": ""\n },\n "languageCode": "",\n "method": "",\n "phoneInput": {\n "phoneNumber": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v4/:name:verify
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"addressInput": ["mailerContactName": ""],
"context": ["address": [
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
]],
"emailInput": ["emailAddress": ""],
"languageCode": "",
"method": "",
"phoneInput": ["phoneNumber": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:verify")! 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()
PUT
mybusiness.accounts.updateNotifications
{{baseUrl}}/v4/:name
QUERY PARAMS
name
BODY json
{
"name": "",
"notificationTypes": [],
"topicName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/: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 \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/v4/:name" {:content-type :json
:form-params {:name ""
:notificationTypes []
:topicName ""}})
require "http/client"
url = "{{baseUrl}}/v4/:name"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/v4/:name"),
Content = new StringContent("{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\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}}/v4/:name");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name"
payload := strings.NewReader("{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/v4/:name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 62
{
"name": "",
"notificationTypes": [],
"topicName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/v4/:name")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/v4/:name")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: '',
notificationTypes: [],
topicName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/v4/:name');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/v4/:name',
headers: {'content-type': 'application/json'},
data: {name: '', notificationTypes: [], topicName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"name":"","notificationTypes":[],"topicName":""}'
};
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}}/v4/:name',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "notificationTypes": [],\n "topicName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/: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({name: '', notificationTypes: [], topicName: ''}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/v4/:name',
headers: {'content-type': 'application/json'},
body: {name: '', notificationTypes: [], topicName: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/v4/:name');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
notificationTypes: [],
topicName: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/v4/:name',
headers: {'content-type': 'application/json'},
data: {name: '', notificationTypes: [], topicName: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"name":"","notificationTypes":[],"topicName":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"name": @"",
@"notificationTypes": @[ ],
@"topicName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/v4/:name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '',
'notificationTypes' => [
],
'topicName' => ''
]),
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('PUT', '{{baseUrl}}/v4/:name', [
'body' => '{
"name": "",
"notificationTypes": [],
"topicName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'notificationTypes' => [
],
'topicName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'notificationTypes' => [
],
'topicName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name');
$request->setRequestMethod('PUT');
$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}}/v4/:name' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"notificationTypes": [],
"topicName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"notificationTypes": [],
"topicName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/v4/:name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name"
payload = {
"name": "",
"notificationTypes": [],
"topicName": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name"
payload <- "{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/:name")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\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.put('/baseUrl/v4/:name') do |req|
req.body = "{\n \"name\": \"\",\n \"notificationTypes\": [],\n \"topicName\": \"\"\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}}/v4/:name";
let payload = json!({
"name": "",
"notificationTypes": (),
"topicName": ""
});
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("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/v4/:name \
--header 'content-type: application/json' \
--data '{
"name": "",
"notificationTypes": [],
"topicName": ""
}'
echo '{
"name": "",
"notificationTypes": [],
"topicName": ""
}' | \
http PUT {{baseUrl}}/v4/:name \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "notificationTypes": [],\n "topicName": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:name
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"notificationTypes": [],
"topicName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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
mybusiness.attributes.list
{{baseUrl}}/v4/attributes
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/attributes");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/attributes")
require "http/client"
url = "{{baseUrl}}/v4/attributes"
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}}/v4/attributes"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/attributes");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/attributes"
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/v4/attributes HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/attributes")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/attributes"))
.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}}/v4/attributes")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/attributes")
.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}}/v4/attributes');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/attributes'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/attributes';
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}}/v4/attributes',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/attributes")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/attributes',
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}}/v4/attributes'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/attributes');
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}}/v4/attributes'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/attributes';
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}}/v4/attributes"]
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}}/v4/attributes" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/attributes",
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}}/v4/attributes');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/attributes');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/attributes');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/attributes' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/attributes' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/attributes")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/attributes"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/attributes"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/attributes")
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/v4/attributes') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/attributes";
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}}/v4/attributes
http GET {{baseUrl}}/v4/attributes
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/attributes
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/attributes")! 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
mybusiness.categories.batchGet
{{baseUrl}}/v4/categories:batchGet
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/categories:batchGet");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/categories:batchGet")
require "http/client"
url = "{{baseUrl}}/v4/categories:batchGet"
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}}/v4/categories:batchGet"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/categories:batchGet");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/categories:batchGet"
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/v4/categories:batchGet HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/categories:batchGet")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/categories:batchGet"))
.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}}/v4/categories:batchGet")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/categories:batchGet")
.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}}/v4/categories:batchGet');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/categories:batchGet'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/categories:batchGet';
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}}/v4/categories:batchGet',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/categories:batchGet")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/categories:batchGet',
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}}/v4/categories:batchGet'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/categories:batchGet');
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}}/v4/categories:batchGet'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/categories:batchGet';
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}}/v4/categories:batchGet"]
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}}/v4/categories:batchGet" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/categories:batchGet",
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}}/v4/categories:batchGet');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/categories:batchGet');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/categories:batchGet');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/categories:batchGet' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/categories:batchGet' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/categories:batchGet")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/categories:batchGet"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/categories:batchGet"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/categories:batchGet")
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/v4/categories:batchGet') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/categories:batchGet";
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}}/v4/categories:batchGet
http GET {{baseUrl}}/v4/categories:batchGet
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/categories:batchGet
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/categories:batchGet")! 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
mybusiness.categories.list
{{baseUrl}}/v4/categories
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/categories");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/categories")
require "http/client"
url = "{{baseUrl}}/v4/categories"
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}}/v4/categories"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/categories");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/categories"
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/v4/categories HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/categories")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/categories"))
.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}}/v4/categories")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/categories")
.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}}/v4/categories');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/categories'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/categories';
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}}/v4/categories',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/categories")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/categories',
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}}/v4/categories'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/categories');
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}}/v4/categories'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/categories';
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}}/v4/categories"]
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}}/v4/categories" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/categories",
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}}/v4/categories');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/categories');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/categories');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/categories' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/categories' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/categories")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/categories"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/categories"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/categories")
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/v4/categories') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/categories";
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}}/v4/categories
http GET {{baseUrl}}/v4/categories
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/categories
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/categories")! 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
mybusiness.chains.get
{{baseUrl}}/v4/: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}}/v4/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/:name")
require "http/client"
url = "{{baseUrl}}/v4/: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}}/v4/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/:name");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/: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/v4/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/: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}}/v4/:name")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/: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}}/v4/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/: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}}/v4/:name',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/: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}}/v4/: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}}/v4/: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}}/v4/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/: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}}/v4/: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}}/v4/:name" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/: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}}/v4/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/:name');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/:name' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/: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/v4/:name') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/: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}}/v4/:name
http GET {{baseUrl}}/v4/:name
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/: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
mybusiness.chains.search
{{baseUrl}}/v4/chains:search
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/chains:search");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v4/chains:search")
require "http/client"
url = "{{baseUrl}}/v4/chains:search"
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}}/v4/chains:search"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v4/chains:search");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/chains:search"
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/v4/chains:search HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v4/chains:search")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/chains:search"))
.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}}/v4/chains:search")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v4/chains:search")
.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}}/v4/chains:search');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v4/chains:search'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/chains:search';
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}}/v4/chains:search',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v4/chains:search")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v4/chains:search',
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}}/v4/chains:search'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v4/chains:search');
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}}/v4/chains:search'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/chains:search';
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}}/v4/chains:search"]
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}}/v4/chains:search" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/chains:search",
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}}/v4/chains:search');
echo $response->getBody();
setUrl('{{baseUrl}}/v4/chains:search');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v4/chains:search');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v4/chains:search' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/chains:search' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v4/chains:search")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/chains:search"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/chains:search"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v4/chains:search")
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/v4/chains:search') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/chains:search";
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}}/v4/chains:search
http GET {{baseUrl}}/v4/chains:search
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v4/chains:search
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/chains:search")! 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
mybusiness.googleLocations.report
{{baseUrl}}/v4/:name:report
QUERY PARAMS
name
BODY json
{
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/:name:report");
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 \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/:name:report" {:content-type :json
:form-params {:locationGroupName ""
:reportReasonBadLocation ""
:reportReasonBadRecommendation ""
:reportReasonElaboration ""
:reportReasonLanguageCode ""}})
require "http/client"
url = "{{baseUrl}}/v4/:name:report"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\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}}/v4/:name:report"),
Content = new StringContent("{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\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}}/v4/:name:report");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/:name:report"
payload := strings.NewReader("{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\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/v4/:name:report HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 168
{
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/:name:report")
.setHeader("content-type", "application/json")
.setBody("{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/:name:report"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\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 \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/:name:report")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/:name:report")
.header("content-type", "application/json")
.body("{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\n}")
.asString();
const data = JSON.stringify({
locationGroupName: '',
reportReasonBadLocation: '',
reportReasonBadRecommendation: '',
reportReasonElaboration: '',
reportReasonLanguageCode: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/:name:report');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:report',
headers: {'content-type': 'application/json'},
data: {
locationGroupName: '',
reportReasonBadLocation: '',
reportReasonBadRecommendation: '',
reportReasonElaboration: '',
reportReasonLanguageCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/:name:report';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"locationGroupName":"","reportReasonBadLocation":"","reportReasonBadRecommendation":"","reportReasonElaboration":"","reportReasonLanguageCode":""}'
};
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}}/v4/:name:report',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "locationGroupName": "",\n "reportReasonBadLocation": "",\n "reportReasonBadRecommendation": "",\n "reportReasonElaboration": "",\n "reportReasonLanguageCode": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/:name:report")
.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/v4/:name:report',
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({
locationGroupName: '',
reportReasonBadLocation: '',
reportReasonBadRecommendation: '',
reportReasonElaboration: '',
reportReasonLanguageCode: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/:name:report',
headers: {'content-type': 'application/json'},
body: {
locationGroupName: '',
reportReasonBadLocation: '',
reportReasonBadRecommendation: '',
reportReasonElaboration: '',
reportReasonLanguageCode: ''
},
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}}/v4/:name:report');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
locationGroupName: '',
reportReasonBadLocation: '',
reportReasonBadRecommendation: '',
reportReasonElaboration: '',
reportReasonLanguageCode: ''
});
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}}/v4/:name:report',
headers: {'content-type': 'application/json'},
data: {
locationGroupName: '',
reportReasonBadLocation: '',
reportReasonBadRecommendation: '',
reportReasonElaboration: '',
reportReasonLanguageCode: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/:name:report';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"locationGroupName":"","reportReasonBadLocation":"","reportReasonBadRecommendation":"","reportReasonElaboration":"","reportReasonLanguageCode":""}'
};
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 = @{ @"locationGroupName": @"",
@"reportReasonBadLocation": @"",
@"reportReasonBadRecommendation": @"",
@"reportReasonElaboration": @"",
@"reportReasonLanguageCode": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/:name:report"]
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}}/v4/:name:report" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/:name:report",
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([
'locationGroupName' => '',
'reportReasonBadLocation' => '',
'reportReasonBadRecommendation' => '',
'reportReasonElaboration' => '',
'reportReasonLanguageCode' => ''
]),
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}}/v4/:name:report', [
'body' => '{
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/:name:report');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'locationGroupName' => '',
'reportReasonBadLocation' => '',
'reportReasonBadRecommendation' => '',
'reportReasonElaboration' => '',
'reportReasonLanguageCode' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'locationGroupName' => '',
'reportReasonBadLocation' => '',
'reportReasonBadRecommendation' => '',
'reportReasonElaboration' => '',
'reportReasonLanguageCode' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v4/:name:report');
$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}}/v4/:name:report' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/:name:report' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/:name:report", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/:name:report"
payload = {
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/:name:report"
payload <- "{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\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}}/v4/:name:report")
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 \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\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/v4/:name:report') do |req|
req.body = "{\n \"locationGroupName\": \"\",\n \"reportReasonBadLocation\": \"\",\n \"reportReasonBadRecommendation\": \"\",\n \"reportReasonElaboration\": \"\",\n \"reportReasonLanguageCode\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/:name:report";
let payload = json!({
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
});
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}}/v4/:name:report \
--header 'content-type: application/json' \
--data '{
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
}'
echo '{
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
}' | \
http POST {{baseUrl}}/v4/:name:report \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "locationGroupName": "",\n "reportReasonBadLocation": "",\n "reportReasonBadRecommendation": "",\n "reportReasonElaboration": "",\n "reportReasonLanguageCode": ""\n}' \
--output-document \
- {{baseUrl}}/v4/:name:report
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"locationGroupName": "",
"reportReasonBadLocation": "",
"reportReasonBadRecommendation": "",
"reportReasonElaboration": "",
"reportReasonLanguageCode": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/:name:report")! 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
mybusiness.googleLocations.search
{{baseUrl}}/v4/googleLocations:search
BODY json
{
"location": {
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
},
"query": "",
"resultCount": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v4/googleLocations: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 \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v4/googleLocations:search" {:content-type :json
:form-params {:location {:adWordsLocationExtensions {:adPhone ""}
:additionalCategories [{:categoryId ""
:displayName ""
:moreHoursTypes [{:displayName ""
:hoursTypeId ""
:localizedDisplayName ""}]
:serviceTypes [{:displayName ""
:serviceTypeId ""}]}]
:additionalPhones []
:address {:addressLines []
:administrativeArea ""
:languageCode ""
:locality ""
:organization ""
:postalCode ""
:recipients []
:regionCode ""
:revision 0
:sortingCode ""
:sublocality ""}
:attributes [{:attributeId ""
:repeatedEnumValue {:setValues []
:unsetValues []}
:urlValues [{:url ""}]
:valueType ""
:values []}]
:labels []
:languageCode ""
:latlng {:latitude ""
:longitude ""}
:locationKey {:explicitNoPlaceId false
:placeId ""
:plusPageId ""
:requestId ""}
:locationName ""
:locationState {:canDelete false
:canHaveFoodMenus false
:canModifyServiceList false
:canOperateHealthData false
:canOperateLodgingData false
:canUpdate false
:hasPendingEdits false
:hasPendingVerification false
:isDisabled false
:isDisconnected false
:isDuplicate false
:isGoogleUpdated false
:isLocalPostApiDisabled false
:isPendingReview false
:isPublished false
:isSuspended false
:isVerified false
:needsReverification false}
:metadata {:duplicate {:access ""
:locationName ""
:placeId ""}
:mapsUrl ""
:newReviewUrl ""}
:moreHours [{:hoursTypeId ""
:periods [{:closeDay ""
:closeTime ""
:openDay ""
:openTime ""}]}]
:name ""
:openInfo {:canReopen false
:openingDate {:day 0
:month 0
:year 0}
:status ""}
:priceLists [{:labels [{:description ""
:displayName ""
:languageCode ""}]
:priceListId ""
:sections [{:items [{:itemId ""
:labels [{}]
:price {:currencyCode ""
:nanos 0
:units ""}}]
:labels [{}]
:sectionId ""
:sectionType ""}]
:sourceUrl ""}]
:primaryCategory {}
:primaryPhone ""
:profile {:description ""}
:regularHours {:periods [{}]}
:relationshipData {:parentChain ""}
:serviceArea {:businessType ""
:places {:placeInfos [{:name ""
:placeId ""}]}
:radius {:latlng {}
:radiusKm ""}}
:specialHours {:specialHourPeriods [{:closeTime ""
:endDate {}
:isClosed false
:openTime ""
:startDate {}}]}
:storeCode ""
:websiteUrl ""}
:query ""
:resultCount 0}})
require "http/client"
url = "{{baseUrl}}/v4/googleLocations:search"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\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}}/v4/googleLocations:search"),
Content = new StringContent("{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\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}}/v4/googleLocations:search");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v4/googleLocations:search"
payload := strings.NewReader("{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\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/v4/googleLocations:search HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 4051
{
"location": {
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
},
"query": "",
"resultCount": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v4/googleLocations:search")
.setHeader("content-type", "application/json")
.setBody("{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v4/googleLocations:search"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\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 \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v4/googleLocations:search")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v4/googleLocations:search")
.header("content-type", "application/json")
.body("{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\n}")
.asString();
const data = JSON.stringify({
location: {
adWordsLocationExtensions: {
adPhone: ''
},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [
{
displayName: '',
hoursTypeId: '',
localizedDisplayName: ''
}
],
serviceTypes: [
{
displayName: '',
serviceTypeId: ''
}
]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {
setValues: [],
unsetValues: []
},
urlValues: [
{
url: ''
}
],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {
latitude: '',
longitude: ''
},
locationKey: {
explicitNoPlaceId: false,
placeId: '',
plusPageId: '',
requestId: ''
},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {
access: '',
locationName: '',
placeId: ''
},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [
{
closeDay: '',
closeTime: '',
openDay: '',
openTime: ''
}
]
}
],
name: '',
openInfo: {
canReopen: false,
openingDate: {
day: 0,
month: 0,
year: 0
},
status: ''
},
priceLists: [
{
labels: [
{
description: '',
displayName: '',
languageCode: ''
}
],
priceListId: '',
sections: [
{
items: [
{
itemId: '',
labels: [
{}
],
price: {
currencyCode: '',
nanos: 0,
units: ''
}
}
],
labels: [
{}
],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {
description: ''
},
regularHours: {
periods: [
{}
]
},
relationshipData: {
parentChain: ''
},
serviceArea: {
businessType: '',
places: {
placeInfos: [
{
name: '',
placeId: ''
}
]
},
radius: {
latlng: {},
radiusKm: ''
}
},
specialHours: {
specialHourPeriods: [
{
closeTime: '',
endDate: {},
isClosed: false,
openTime: '',
startDate: {}
}
]
},
storeCode: '',
websiteUrl: ''
},
query: '',
resultCount: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v4/googleLocations:search');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/googleLocations:search',
headers: {'content-type': 'application/json'},
data: {
location: {
adWordsLocationExtensions: {adPhone: ''},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [{displayName: '', hoursTypeId: '', localizedDisplayName: ''}],
serviceTypes: [{displayName: '', serviceTypeId: ''}]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {setValues: [], unsetValues: []},
urlValues: [{url: ''}],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {latitude: '', longitude: ''},
locationKey: {explicitNoPlaceId: false, placeId: '', plusPageId: '', requestId: ''},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {access: '', locationName: '', placeId: ''},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [{closeDay: '', closeTime: '', openDay: '', openTime: ''}]
}
],
name: '',
openInfo: {canReopen: false, openingDate: {day: 0, month: 0, year: 0}, status: ''},
priceLists: [
{
labels: [{description: '', displayName: '', languageCode: ''}],
priceListId: '',
sections: [
{
items: [{itemId: '', labels: [{}], price: {currencyCode: '', nanos: 0, units: ''}}],
labels: [{}],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {description: ''},
regularHours: {periods: [{}]},
relationshipData: {parentChain: ''},
serviceArea: {
businessType: '',
places: {placeInfos: [{name: '', placeId: ''}]},
radius: {latlng: {}, radiusKm: ''}
},
specialHours: {
specialHourPeriods: [{closeTime: '', endDate: {}, isClosed: false, openTime: '', startDate: {}}]
},
storeCode: '',
websiteUrl: ''
},
query: '',
resultCount: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v4/googleLocations:search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"location":{"adWordsLocationExtensions":{"adPhone":""},"additionalCategories":[{"categoryId":"","displayName":"","moreHoursTypes":[{"displayName":"","hoursTypeId":"","localizedDisplayName":""}],"serviceTypes":[{"displayName":"","serviceTypeId":""}]}],"additionalPhones":[],"address":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"attributes":[{"attributeId":"","repeatedEnumValue":{"setValues":[],"unsetValues":[]},"urlValues":[{"url":""}],"valueType":"","values":[]}],"labels":[],"languageCode":"","latlng":{"latitude":"","longitude":""},"locationKey":{"explicitNoPlaceId":false,"placeId":"","plusPageId":"","requestId":""},"locationName":"","locationState":{"canDelete":false,"canHaveFoodMenus":false,"canModifyServiceList":false,"canOperateHealthData":false,"canOperateLodgingData":false,"canUpdate":false,"hasPendingEdits":false,"hasPendingVerification":false,"isDisabled":false,"isDisconnected":false,"isDuplicate":false,"isGoogleUpdated":false,"isLocalPostApiDisabled":false,"isPendingReview":false,"isPublished":false,"isSuspended":false,"isVerified":false,"needsReverification":false},"metadata":{"duplicate":{"access":"","locationName":"","placeId":""},"mapsUrl":"","newReviewUrl":""},"moreHours":[{"hoursTypeId":"","periods":[{"closeDay":"","closeTime":"","openDay":"","openTime":""}]}],"name":"","openInfo":{"canReopen":false,"openingDate":{"day":0,"month":0,"year":0},"status":""},"priceLists":[{"labels":[{"description":"","displayName":"","languageCode":""}],"priceListId":"","sections":[{"items":[{"itemId":"","labels":[{}],"price":{"currencyCode":"","nanos":0,"units":""}}],"labels":[{}],"sectionId":"","sectionType":""}],"sourceUrl":""}],"primaryCategory":{},"primaryPhone":"","profile":{"description":""},"regularHours":{"periods":[{}]},"relationshipData":{"parentChain":""},"serviceArea":{"businessType":"","places":{"placeInfos":[{"name":"","placeId":""}]},"radius":{"latlng":{},"radiusKm":""}},"specialHours":{"specialHourPeriods":[{"closeTime":"","endDate":{},"isClosed":false,"openTime":"","startDate":{}}]},"storeCode":"","websiteUrl":""},"query":"","resultCount":0}'
};
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}}/v4/googleLocations:search',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "location": {\n "adWordsLocationExtensions": {\n "adPhone": ""\n },\n "additionalCategories": [\n {\n "categoryId": "",\n "displayName": "",\n "moreHoursTypes": [\n {\n "displayName": "",\n "hoursTypeId": "",\n "localizedDisplayName": ""\n }\n ],\n "serviceTypes": [\n {\n "displayName": "",\n "serviceTypeId": ""\n }\n ]\n }\n ],\n "additionalPhones": [],\n "address": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n },\n "attributes": [\n {\n "attributeId": "",\n "repeatedEnumValue": {\n "setValues": [],\n "unsetValues": []\n },\n "urlValues": [\n {\n "url": ""\n }\n ],\n "valueType": "",\n "values": []\n }\n ],\n "labels": [],\n "languageCode": "",\n "latlng": {\n "latitude": "",\n "longitude": ""\n },\n "locationKey": {\n "explicitNoPlaceId": false,\n "placeId": "",\n "plusPageId": "",\n "requestId": ""\n },\n "locationName": "",\n "locationState": {\n "canDelete": false,\n "canHaveFoodMenus": false,\n "canModifyServiceList": false,\n "canOperateHealthData": false,\n "canOperateLodgingData": false,\n "canUpdate": false,\n "hasPendingEdits": false,\n "hasPendingVerification": false,\n "isDisabled": false,\n "isDisconnected": false,\n "isDuplicate": false,\n "isGoogleUpdated": false,\n "isLocalPostApiDisabled": false,\n "isPendingReview": false,\n "isPublished": false,\n "isSuspended": false,\n "isVerified": false,\n "needsReverification": false\n },\n "metadata": {\n "duplicate": {\n "access": "",\n "locationName": "",\n "placeId": ""\n },\n "mapsUrl": "",\n "newReviewUrl": ""\n },\n "moreHours": [\n {\n "hoursTypeId": "",\n "periods": [\n {\n "closeDay": "",\n "closeTime": "",\n "openDay": "",\n "openTime": ""\n }\n ]\n }\n ],\n "name": "",\n "openInfo": {\n "canReopen": false,\n "openingDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "status": ""\n },\n "priceLists": [\n {\n "labels": [\n {\n "description": "",\n "displayName": "",\n "languageCode": ""\n }\n ],\n "priceListId": "",\n "sections": [\n {\n "items": [\n {\n "itemId": "",\n "labels": [\n {}\n ],\n "price": {\n "currencyCode": "",\n "nanos": 0,\n "units": ""\n }\n }\n ],\n "labels": [\n {}\n ],\n "sectionId": "",\n "sectionType": ""\n }\n ],\n "sourceUrl": ""\n }\n ],\n "primaryCategory": {},\n "primaryPhone": "",\n "profile": {\n "description": ""\n },\n "regularHours": {\n "periods": [\n {}\n ]\n },\n "relationshipData": {\n "parentChain": ""\n },\n "serviceArea": {\n "businessType": "",\n "places": {\n "placeInfos": [\n {\n "name": "",\n "placeId": ""\n }\n ]\n },\n "radius": {\n "latlng": {},\n "radiusKm": ""\n }\n },\n "specialHours": {\n "specialHourPeriods": [\n {\n "closeTime": "",\n "endDate": {},\n "isClosed": false,\n "openTime": "",\n "startDate": {}\n }\n ]\n },\n "storeCode": "",\n "websiteUrl": ""\n },\n "query": "",\n "resultCount": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v4/googleLocations: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/v4/googleLocations: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({
location: {
adWordsLocationExtensions: {adPhone: ''},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [{displayName: '', hoursTypeId: '', localizedDisplayName: ''}],
serviceTypes: [{displayName: '', serviceTypeId: ''}]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {setValues: [], unsetValues: []},
urlValues: [{url: ''}],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {latitude: '', longitude: ''},
locationKey: {explicitNoPlaceId: false, placeId: '', plusPageId: '', requestId: ''},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {access: '', locationName: '', placeId: ''},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [{closeDay: '', closeTime: '', openDay: '', openTime: ''}]
}
],
name: '',
openInfo: {canReopen: false, openingDate: {day: 0, month: 0, year: 0}, status: ''},
priceLists: [
{
labels: [{description: '', displayName: '', languageCode: ''}],
priceListId: '',
sections: [
{
items: [{itemId: '', labels: [{}], price: {currencyCode: '', nanos: 0, units: ''}}],
labels: [{}],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {description: ''},
regularHours: {periods: [{}]},
relationshipData: {parentChain: ''},
serviceArea: {
businessType: '',
places: {placeInfos: [{name: '', placeId: ''}]},
radius: {latlng: {}, radiusKm: ''}
},
specialHours: {
specialHourPeriods: [{closeTime: '', endDate: {}, isClosed: false, openTime: '', startDate: {}}]
},
storeCode: '',
websiteUrl: ''
},
query: '',
resultCount: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v4/googleLocations:search',
headers: {'content-type': 'application/json'},
body: {
location: {
adWordsLocationExtensions: {adPhone: ''},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [{displayName: '', hoursTypeId: '', localizedDisplayName: ''}],
serviceTypes: [{displayName: '', serviceTypeId: ''}]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {setValues: [], unsetValues: []},
urlValues: [{url: ''}],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {latitude: '', longitude: ''},
locationKey: {explicitNoPlaceId: false, placeId: '', plusPageId: '', requestId: ''},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {access: '', locationName: '', placeId: ''},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [{closeDay: '', closeTime: '', openDay: '', openTime: ''}]
}
],
name: '',
openInfo: {canReopen: false, openingDate: {day: 0, month: 0, year: 0}, status: ''},
priceLists: [
{
labels: [{description: '', displayName: '', languageCode: ''}],
priceListId: '',
sections: [
{
items: [{itemId: '', labels: [{}], price: {currencyCode: '', nanos: 0, units: ''}}],
labels: [{}],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {description: ''},
regularHours: {periods: [{}]},
relationshipData: {parentChain: ''},
serviceArea: {
businessType: '',
places: {placeInfos: [{name: '', placeId: ''}]},
radius: {latlng: {}, radiusKm: ''}
},
specialHours: {
specialHourPeriods: [{closeTime: '', endDate: {}, isClosed: false, openTime: '', startDate: {}}]
},
storeCode: '',
websiteUrl: ''
},
query: '',
resultCount: 0
},
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}}/v4/googleLocations:search');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
location: {
adWordsLocationExtensions: {
adPhone: ''
},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [
{
displayName: '',
hoursTypeId: '',
localizedDisplayName: ''
}
],
serviceTypes: [
{
displayName: '',
serviceTypeId: ''
}
]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {
setValues: [],
unsetValues: []
},
urlValues: [
{
url: ''
}
],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {
latitude: '',
longitude: ''
},
locationKey: {
explicitNoPlaceId: false,
placeId: '',
plusPageId: '',
requestId: ''
},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {
access: '',
locationName: '',
placeId: ''
},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [
{
closeDay: '',
closeTime: '',
openDay: '',
openTime: ''
}
]
}
],
name: '',
openInfo: {
canReopen: false,
openingDate: {
day: 0,
month: 0,
year: 0
},
status: ''
},
priceLists: [
{
labels: [
{
description: '',
displayName: '',
languageCode: ''
}
],
priceListId: '',
sections: [
{
items: [
{
itemId: '',
labels: [
{}
],
price: {
currencyCode: '',
nanos: 0,
units: ''
}
}
],
labels: [
{}
],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {
description: ''
},
regularHours: {
periods: [
{}
]
},
relationshipData: {
parentChain: ''
},
serviceArea: {
businessType: '',
places: {
placeInfos: [
{
name: '',
placeId: ''
}
]
},
radius: {
latlng: {},
radiusKm: ''
}
},
specialHours: {
specialHourPeriods: [
{
closeTime: '',
endDate: {},
isClosed: false,
openTime: '',
startDate: {}
}
]
},
storeCode: '',
websiteUrl: ''
},
query: '',
resultCount: 0
});
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}}/v4/googleLocations:search',
headers: {'content-type': 'application/json'},
data: {
location: {
adWordsLocationExtensions: {adPhone: ''},
additionalCategories: [
{
categoryId: '',
displayName: '',
moreHoursTypes: [{displayName: '', hoursTypeId: '', localizedDisplayName: ''}],
serviceTypes: [{displayName: '', serviceTypeId: ''}]
}
],
additionalPhones: [],
address: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
attributes: [
{
attributeId: '',
repeatedEnumValue: {setValues: [], unsetValues: []},
urlValues: [{url: ''}],
valueType: '',
values: []
}
],
labels: [],
languageCode: '',
latlng: {latitude: '', longitude: ''},
locationKey: {explicitNoPlaceId: false, placeId: '', plusPageId: '', requestId: ''},
locationName: '',
locationState: {
canDelete: false,
canHaveFoodMenus: false,
canModifyServiceList: false,
canOperateHealthData: false,
canOperateLodgingData: false,
canUpdate: false,
hasPendingEdits: false,
hasPendingVerification: false,
isDisabled: false,
isDisconnected: false,
isDuplicate: false,
isGoogleUpdated: false,
isLocalPostApiDisabled: false,
isPendingReview: false,
isPublished: false,
isSuspended: false,
isVerified: false,
needsReverification: false
},
metadata: {
duplicate: {access: '', locationName: '', placeId: ''},
mapsUrl: '',
newReviewUrl: ''
},
moreHours: [
{
hoursTypeId: '',
periods: [{closeDay: '', closeTime: '', openDay: '', openTime: ''}]
}
],
name: '',
openInfo: {canReopen: false, openingDate: {day: 0, month: 0, year: 0}, status: ''},
priceLists: [
{
labels: [{description: '', displayName: '', languageCode: ''}],
priceListId: '',
sections: [
{
items: [{itemId: '', labels: [{}], price: {currencyCode: '', nanos: 0, units: ''}}],
labels: [{}],
sectionId: '',
sectionType: ''
}
],
sourceUrl: ''
}
],
primaryCategory: {},
primaryPhone: '',
profile: {description: ''},
regularHours: {periods: [{}]},
relationshipData: {parentChain: ''},
serviceArea: {
businessType: '',
places: {placeInfos: [{name: '', placeId: ''}]},
radius: {latlng: {}, radiusKm: ''}
},
specialHours: {
specialHourPeriods: [{closeTime: '', endDate: {}, isClosed: false, openTime: '', startDate: {}}]
},
storeCode: '',
websiteUrl: ''
},
query: '',
resultCount: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v4/googleLocations:search';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"location":{"adWordsLocationExtensions":{"adPhone":""},"additionalCategories":[{"categoryId":"","displayName":"","moreHoursTypes":[{"displayName":"","hoursTypeId":"","localizedDisplayName":""}],"serviceTypes":[{"displayName":"","serviceTypeId":""}]}],"additionalPhones":[],"address":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"attributes":[{"attributeId":"","repeatedEnumValue":{"setValues":[],"unsetValues":[]},"urlValues":[{"url":""}],"valueType":"","values":[]}],"labels":[],"languageCode":"","latlng":{"latitude":"","longitude":""},"locationKey":{"explicitNoPlaceId":false,"placeId":"","plusPageId":"","requestId":""},"locationName":"","locationState":{"canDelete":false,"canHaveFoodMenus":false,"canModifyServiceList":false,"canOperateHealthData":false,"canOperateLodgingData":false,"canUpdate":false,"hasPendingEdits":false,"hasPendingVerification":false,"isDisabled":false,"isDisconnected":false,"isDuplicate":false,"isGoogleUpdated":false,"isLocalPostApiDisabled":false,"isPendingReview":false,"isPublished":false,"isSuspended":false,"isVerified":false,"needsReverification":false},"metadata":{"duplicate":{"access":"","locationName":"","placeId":""},"mapsUrl":"","newReviewUrl":""},"moreHours":[{"hoursTypeId":"","periods":[{"closeDay":"","closeTime":"","openDay":"","openTime":""}]}],"name":"","openInfo":{"canReopen":false,"openingDate":{"day":0,"month":0,"year":0},"status":""},"priceLists":[{"labels":[{"description":"","displayName":"","languageCode":""}],"priceListId":"","sections":[{"items":[{"itemId":"","labels":[{}],"price":{"currencyCode":"","nanos":0,"units":""}}],"labels":[{}],"sectionId":"","sectionType":""}],"sourceUrl":""}],"primaryCategory":{},"primaryPhone":"","profile":{"description":""},"regularHours":{"periods":[{}]},"relationshipData":{"parentChain":""},"serviceArea":{"businessType":"","places":{"placeInfos":[{"name":"","placeId":""}]},"radius":{"latlng":{},"radiusKm":""}},"specialHours":{"specialHourPeriods":[{"closeTime":"","endDate":{},"isClosed":false,"openTime":"","startDate":{}}]},"storeCode":"","websiteUrl":""},"query":"","resultCount":0}'
};
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 = @{ @"location": @{ @"adWordsLocationExtensions": @{ @"adPhone": @"" }, @"additionalCategories": @[ @{ @"categoryId": @"", @"displayName": @"", @"moreHoursTypes": @[ @{ @"displayName": @"", @"hoursTypeId": @"", @"localizedDisplayName": @"" } ], @"serviceTypes": @[ @{ @"displayName": @"", @"serviceTypeId": @"" } ] } ], @"additionalPhones": @[ ], @"address": @{ @"addressLines": @[ ], @"administrativeArea": @"", @"languageCode": @"", @"locality": @"", @"organization": @"", @"postalCode": @"", @"recipients": @[ ], @"regionCode": @"", @"revision": @0, @"sortingCode": @"", @"sublocality": @"" }, @"attributes": @[ @{ @"attributeId": @"", @"repeatedEnumValue": @{ @"setValues": @[ ], @"unsetValues": @[ ] }, @"urlValues": @[ @{ @"url": @"" } ], @"valueType": @"", @"values": @[ ] } ], @"labels": @[ ], @"languageCode": @"", @"latlng": @{ @"latitude": @"", @"longitude": @"" }, @"locationKey": @{ @"explicitNoPlaceId": @NO, @"placeId": @"", @"plusPageId": @"", @"requestId": @"" }, @"locationName": @"", @"locationState": @{ @"canDelete": @NO, @"canHaveFoodMenus": @NO, @"canModifyServiceList": @NO, @"canOperateHealthData": @NO, @"canOperateLodgingData": @NO, @"canUpdate": @NO, @"hasPendingEdits": @NO, @"hasPendingVerification": @NO, @"isDisabled": @NO, @"isDisconnected": @NO, @"isDuplicate": @NO, @"isGoogleUpdated": @NO, @"isLocalPostApiDisabled": @NO, @"isPendingReview": @NO, @"isPublished": @NO, @"isSuspended": @NO, @"isVerified": @NO, @"needsReverification": @NO }, @"metadata": @{ @"duplicate": @{ @"access": @"", @"locationName": @"", @"placeId": @"" }, @"mapsUrl": @"", @"newReviewUrl": @"" }, @"moreHours": @[ @{ @"hoursTypeId": @"", @"periods": @[ @{ @"closeDay": @"", @"closeTime": @"", @"openDay": @"", @"openTime": @"" } ] } ], @"name": @"", @"openInfo": @{ @"canReopen": @NO, @"openingDate": @{ @"day": @0, @"month": @0, @"year": @0 }, @"status": @"" }, @"priceLists": @[ @{ @"labels": @[ @{ @"description": @"", @"displayName": @"", @"languageCode": @"" } ], @"priceListId": @"", @"sections": @[ @{ @"items": @[ @{ @"itemId": @"", @"labels": @[ @{ } ], @"price": @{ @"currencyCode": @"", @"nanos": @0, @"units": @"" } } ], @"labels": @[ @{ } ], @"sectionId": @"", @"sectionType": @"" } ], @"sourceUrl": @"" } ], @"primaryCategory": @{ }, @"primaryPhone": @"", @"profile": @{ @"description": @"" }, @"regularHours": @{ @"periods": @[ @{ } ] }, @"relationshipData": @{ @"parentChain": @"" }, @"serviceArea": @{ @"businessType": @"", @"places": @{ @"placeInfos": @[ @{ @"name": @"", @"placeId": @"" } ] }, @"radius": @{ @"latlng": @{ }, @"radiusKm": @"" } }, @"specialHours": @{ @"specialHourPeriods": @[ @{ @"closeTime": @"", @"endDate": @{ }, @"isClosed": @NO, @"openTime": @"", @"startDate": @{ } } ] }, @"storeCode": @"", @"websiteUrl": @"" },
@"query": @"",
@"resultCount": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v4/googleLocations: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}}/v4/googleLocations:search" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v4/googleLocations: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([
'location' => [
'adWordsLocationExtensions' => [
'adPhone' => ''
],
'additionalCategories' => [
[
'categoryId' => '',
'displayName' => '',
'moreHoursTypes' => [
[
'displayName' => '',
'hoursTypeId' => '',
'localizedDisplayName' => ''
]
],
'serviceTypes' => [
[
'displayName' => '',
'serviceTypeId' => ''
]
]
]
],
'additionalPhones' => [
],
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'attributes' => [
[
'attributeId' => '',
'repeatedEnumValue' => [
'setValues' => [
],
'unsetValues' => [
]
],
'urlValues' => [
[
'url' => ''
]
],
'valueType' => '',
'values' => [
]
]
],
'labels' => [
],
'languageCode' => '',
'latlng' => [
'latitude' => '',
'longitude' => ''
],
'locationKey' => [
'explicitNoPlaceId' => null,
'placeId' => '',
'plusPageId' => '',
'requestId' => ''
],
'locationName' => '',
'locationState' => [
'canDelete' => null,
'canHaveFoodMenus' => null,
'canModifyServiceList' => null,
'canOperateHealthData' => null,
'canOperateLodgingData' => null,
'canUpdate' => null,
'hasPendingEdits' => null,
'hasPendingVerification' => null,
'isDisabled' => null,
'isDisconnected' => null,
'isDuplicate' => null,
'isGoogleUpdated' => null,
'isLocalPostApiDisabled' => null,
'isPendingReview' => null,
'isPublished' => null,
'isSuspended' => null,
'isVerified' => null,
'needsReverification' => null
],
'metadata' => [
'duplicate' => [
'access' => '',
'locationName' => '',
'placeId' => ''
],
'mapsUrl' => '',
'newReviewUrl' => ''
],
'moreHours' => [
[
'hoursTypeId' => '',
'periods' => [
[
'closeDay' => '',
'closeTime' => '',
'openDay' => '',
'openTime' => ''
]
]
]
],
'name' => '',
'openInfo' => [
'canReopen' => null,
'openingDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'status' => ''
],
'priceLists' => [
[
'labels' => [
[
'description' => '',
'displayName' => '',
'languageCode' => ''
]
],
'priceListId' => '',
'sections' => [
[
'items' => [
[
'itemId' => '',
'labels' => [
[
]
],
'price' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
]
]
],
'labels' => [
[
]
],
'sectionId' => '',
'sectionType' => ''
]
],
'sourceUrl' => ''
]
],
'primaryCategory' => [
],
'primaryPhone' => '',
'profile' => [
'description' => ''
],
'regularHours' => [
'periods' => [
[
]
]
],
'relationshipData' => [
'parentChain' => ''
],
'serviceArea' => [
'businessType' => '',
'places' => [
'placeInfos' => [
[
'name' => '',
'placeId' => ''
]
]
],
'radius' => [
'latlng' => [
],
'radiusKm' => ''
]
],
'specialHours' => [
'specialHourPeriods' => [
[
'closeTime' => '',
'endDate' => [
],
'isClosed' => null,
'openTime' => '',
'startDate' => [
]
]
]
],
'storeCode' => '',
'websiteUrl' => ''
],
'query' => '',
'resultCount' => 0
]),
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}}/v4/googleLocations:search', [
'body' => '{
"location": {
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
},
"query": "",
"resultCount": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v4/googleLocations:search');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'location' => [
'adWordsLocationExtensions' => [
'adPhone' => ''
],
'additionalCategories' => [
[
'categoryId' => '',
'displayName' => '',
'moreHoursTypes' => [
[
'displayName' => '',
'hoursTypeId' => '',
'localizedDisplayName' => ''
]
],
'serviceTypes' => [
[
'displayName' => '',
'serviceTypeId' => ''
]
]
]
],
'additionalPhones' => [
],
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'attributes' => [
[
'attributeId' => '',
'repeatedEnumValue' => [
'setValues' => [
],
'unsetValues' => [
]
],
'urlValues' => [
[
'url' => ''
]
],
'valueType' => '',
'values' => [
]
]
],
'labels' => [
],
'languageCode' => '',
'latlng' => [
'latitude' => '',
'longitude' => ''
],
'locationKey' => [
'explicitNoPlaceId' => null,
'placeId' => '',
'plusPageId' => '',
'requestId' => ''
],
'locationName' => '',
'locationState' => [
'canDelete' => null,
'canHaveFoodMenus' => null,
'canModifyServiceList' => null,
'canOperateHealthData' => null,
'canOperateLodgingData' => null,
'canUpdate' => null,
'hasPendingEdits' => null,
'hasPendingVerification' => null,
'isDisabled' => null,
'isDisconnected' => null,
'isDuplicate' => null,
'isGoogleUpdated' => null,
'isLocalPostApiDisabled' => null,
'isPendingReview' => null,
'isPublished' => null,
'isSuspended' => null,
'isVerified' => null,
'needsReverification' => null
],
'metadata' => [
'duplicate' => [
'access' => '',
'locationName' => '',
'placeId' => ''
],
'mapsUrl' => '',
'newReviewUrl' => ''
],
'moreHours' => [
[
'hoursTypeId' => '',
'periods' => [
[
'closeDay' => '',
'closeTime' => '',
'openDay' => '',
'openTime' => ''
]
]
]
],
'name' => '',
'openInfo' => [
'canReopen' => null,
'openingDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'status' => ''
],
'priceLists' => [
[
'labels' => [
[
'description' => '',
'displayName' => '',
'languageCode' => ''
]
],
'priceListId' => '',
'sections' => [
[
'items' => [
[
'itemId' => '',
'labels' => [
[
]
],
'price' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
]
]
],
'labels' => [
[
]
],
'sectionId' => '',
'sectionType' => ''
]
],
'sourceUrl' => ''
]
],
'primaryCategory' => [
],
'primaryPhone' => '',
'profile' => [
'description' => ''
],
'regularHours' => [
'periods' => [
[
]
]
],
'relationshipData' => [
'parentChain' => ''
],
'serviceArea' => [
'businessType' => '',
'places' => [
'placeInfos' => [
[
'name' => '',
'placeId' => ''
]
]
],
'radius' => [
'latlng' => [
],
'radiusKm' => ''
]
],
'specialHours' => [
'specialHourPeriods' => [
[
'closeTime' => '',
'endDate' => [
],
'isClosed' => null,
'openTime' => '',
'startDate' => [
]
]
]
],
'storeCode' => '',
'websiteUrl' => ''
],
'query' => '',
'resultCount' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'location' => [
'adWordsLocationExtensions' => [
'adPhone' => ''
],
'additionalCategories' => [
[
'categoryId' => '',
'displayName' => '',
'moreHoursTypes' => [
[
'displayName' => '',
'hoursTypeId' => '',
'localizedDisplayName' => ''
]
],
'serviceTypes' => [
[
'displayName' => '',
'serviceTypeId' => ''
]
]
]
],
'additionalPhones' => [
],
'address' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'attributes' => [
[
'attributeId' => '',
'repeatedEnumValue' => [
'setValues' => [
],
'unsetValues' => [
]
],
'urlValues' => [
[
'url' => ''
]
],
'valueType' => '',
'values' => [
]
]
],
'labels' => [
],
'languageCode' => '',
'latlng' => [
'latitude' => '',
'longitude' => ''
],
'locationKey' => [
'explicitNoPlaceId' => null,
'placeId' => '',
'plusPageId' => '',
'requestId' => ''
],
'locationName' => '',
'locationState' => [
'canDelete' => null,
'canHaveFoodMenus' => null,
'canModifyServiceList' => null,
'canOperateHealthData' => null,
'canOperateLodgingData' => null,
'canUpdate' => null,
'hasPendingEdits' => null,
'hasPendingVerification' => null,
'isDisabled' => null,
'isDisconnected' => null,
'isDuplicate' => null,
'isGoogleUpdated' => null,
'isLocalPostApiDisabled' => null,
'isPendingReview' => null,
'isPublished' => null,
'isSuspended' => null,
'isVerified' => null,
'needsReverification' => null
],
'metadata' => [
'duplicate' => [
'access' => '',
'locationName' => '',
'placeId' => ''
],
'mapsUrl' => '',
'newReviewUrl' => ''
],
'moreHours' => [
[
'hoursTypeId' => '',
'periods' => [
[
'closeDay' => '',
'closeTime' => '',
'openDay' => '',
'openTime' => ''
]
]
]
],
'name' => '',
'openInfo' => [
'canReopen' => null,
'openingDate' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'status' => ''
],
'priceLists' => [
[
'labels' => [
[
'description' => '',
'displayName' => '',
'languageCode' => ''
]
],
'priceListId' => '',
'sections' => [
[
'items' => [
[
'itemId' => '',
'labels' => [
[
]
],
'price' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
]
]
],
'labels' => [
[
]
],
'sectionId' => '',
'sectionType' => ''
]
],
'sourceUrl' => ''
]
],
'primaryCategory' => [
],
'primaryPhone' => '',
'profile' => [
'description' => ''
],
'regularHours' => [
'periods' => [
[
]
]
],
'relationshipData' => [
'parentChain' => ''
],
'serviceArea' => [
'businessType' => '',
'places' => [
'placeInfos' => [
[
'name' => '',
'placeId' => ''
]
]
],
'radius' => [
'latlng' => [
],
'radiusKm' => ''
]
],
'specialHours' => [
'specialHourPeriods' => [
[
'closeTime' => '',
'endDate' => [
],
'isClosed' => null,
'openTime' => '',
'startDate' => [
]
]
]
],
'storeCode' => '',
'websiteUrl' => ''
],
'query' => '',
'resultCount' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v4/googleLocations: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}}/v4/googleLocations:search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"location": {
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
},
"query": "",
"resultCount": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v4/googleLocations:search' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"location": {
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
},
"query": "",
"resultCount": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v4/googleLocations:search", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v4/googleLocations:search"
payload = {
"location": {
"adWordsLocationExtensions": { "adPhone": "" },
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [{ "url": "" }],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": False,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": False,
"canHaveFoodMenus": False,
"canModifyServiceList": False,
"canOperateHealthData": False,
"canOperateLodgingData": False,
"canUpdate": False,
"hasPendingEdits": False,
"hasPendingVerification": False,
"isDisabled": False,
"isDisconnected": False,
"isDuplicate": False,
"isGoogleUpdated": False,
"isLocalPostApiDisabled": False,
"isPendingReview": False,
"isPublished": False,
"isSuspended": False,
"isVerified": False,
"needsReverification": False
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": False,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [{}],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [{}],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": { "description": "" },
"regularHours": { "periods": [{}] },
"relationshipData": { "parentChain": "" },
"serviceArea": {
"businessType": "",
"places": { "placeInfos": [
{
"name": "",
"placeId": ""
}
] },
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": { "specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": False,
"openTime": "",
"startDate": {}
}
] },
"storeCode": "",
"websiteUrl": ""
},
"query": "",
"resultCount": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v4/googleLocations:search"
payload <- "{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\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}}/v4/googleLocations: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 \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\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/v4/googleLocations:search') do |req|
req.body = "{\n \"location\": {\n \"adWordsLocationExtensions\": {\n \"adPhone\": \"\"\n },\n \"additionalCategories\": [\n {\n \"categoryId\": \"\",\n \"displayName\": \"\",\n \"moreHoursTypes\": [\n {\n \"displayName\": \"\",\n \"hoursTypeId\": \"\",\n \"localizedDisplayName\": \"\"\n }\n ],\n \"serviceTypes\": [\n {\n \"displayName\": \"\",\n \"serviceTypeId\": \"\"\n }\n ]\n }\n ],\n \"additionalPhones\": [],\n \"address\": {\n \"addressLines\": [],\n \"administrativeArea\": \"\",\n \"languageCode\": \"\",\n \"locality\": \"\",\n \"organization\": \"\",\n \"postalCode\": \"\",\n \"recipients\": [],\n \"regionCode\": \"\",\n \"revision\": 0,\n \"sortingCode\": \"\",\n \"sublocality\": \"\"\n },\n \"attributes\": [\n {\n \"attributeId\": \"\",\n \"repeatedEnumValue\": {\n \"setValues\": [],\n \"unsetValues\": []\n },\n \"urlValues\": [\n {\n \"url\": \"\"\n }\n ],\n \"valueType\": \"\",\n \"values\": []\n }\n ],\n \"labels\": [],\n \"languageCode\": \"\",\n \"latlng\": {\n \"latitude\": \"\",\n \"longitude\": \"\"\n },\n \"locationKey\": {\n \"explicitNoPlaceId\": false,\n \"placeId\": \"\",\n \"plusPageId\": \"\",\n \"requestId\": \"\"\n },\n \"locationName\": \"\",\n \"locationState\": {\n \"canDelete\": false,\n \"canHaveFoodMenus\": false,\n \"canModifyServiceList\": false,\n \"canOperateHealthData\": false,\n \"canOperateLodgingData\": false,\n \"canUpdate\": false,\n \"hasPendingEdits\": false,\n \"hasPendingVerification\": false,\n \"isDisabled\": false,\n \"isDisconnected\": false,\n \"isDuplicate\": false,\n \"isGoogleUpdated\": false,\n \"isLocalPostApiDisabled\": false,\n \"isPendingReview\": false,\n \"isPublished\": false,\n \"isSuspended\": false,\n \"isVerified\": false,\n \"needsReverification\": false\n },\n \"metadata\": {\n \"duplicate\": {\n \"access\": \"\",\n \"locationName\": \"\",\n \"placeId\": \"\"\n },\n \"mapsUrl\": \"\",\n \"newReviewUrl\": \"\"\n },\n \"moreHours\": [\n {\n \"hoursTypeId\": \"\",\n \"periods\": [\n {\n \"closeDay\": \"\",\n \"closeTime\": \"\",\n \"openDay\": \"\",\n \"openTime\": \"\"\n }\n ]\n }\n ],\n \"name\": \"\",\n \"openInfo\": {\n \"canReopen\": false,\n \"openingDate\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"status\": \"\"\n },\n \"priceLists\": [\n {\n \"labels\": [\n {\n \"description\": \"\",\n \"displayName\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"priceListId\": \"\",\n \"sections\": [\n {\n \"items\": [\n {\n \"itemId\": \"\",\n \"labels\": [\n {}\n ],\n \"price\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n }\n }\n ],\n \"labels\": [\n {}\n ],\n \"sectionId\": \"\",\n \"sectionType\": \"\"\n }\n ],\n \"sourceUrl\": \"\"\n }\n ],\n \"primaryCategory\": {},\n \"primaryPhone\": \"\",\n \"profile\": {\n \"description\": \"\"\n },\n \"regularHours\": {\n \"periods\": [\n {}\n ]\n },\n \"relationshipData\": {\n \"parentChain\": \"\"\n },\n \"serviceArea\": {\n \"businessType\": \"\",\n \"places\": {\n \"placeInfos\": [\n {\n \"name\": \"\",\n \"placeId\": \"\"\n }\n ]\n },\n \"radius\": {\n \"latlng\": {},\n \"radiusKm\": \"\"\n }\n },\n \"specialHours\": {\n \"specialHourPeriods\": [\n {\n \"closeTime\": \"\",\n \"endDate\": {},\n \"isClosed\": false,\n \"openTime\": \"\",\n \"startDate\": {}\n }\n ]\n },\n \"storeCode\": \"\",\n \"websiteUrl\": \"\"\n },\n \"query\": \"\",\n \"resultCount\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v4/googleLocations:search";
let payload = json!({
"location": json!({
"adWordsLocationExtensions": json!({"adPhone": ""}),
"additionalCategories": (
json!({
"categoryId": "",
"displayName": "",
"moreHoursTypes": (
json!({
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
})
),
"serviceTypes": (
json!({
"displayName": "",
"serviceTypeId": ""
})
)
})
),
"additionalPhones": (),
"address": json!({
"addressLines": (),
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": (),
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}),
"attributes": (
json!({
"attributeId": "",
"repeatedEnumValue": json!({
"setValues": (),
"unsetValues": ()
}),
"urlValues": (json!({"url": ""})),
"valueType": "",
"values": ()
})
),
"labels": (),
"languageCode": "",
"latlng": json!({
"latitude": "",
"longitude": ""
}),
"locationKey": json!({
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
}),
"locationName": "",
"locationState": json!({
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
}),
"metadata": json!({
"duplicate": json!({
"access": "",
"locationName": "",
"placeId": ""
}),
"mapsUrl": "",
"newReviewUrl": ""
}),
"moreHours": (
json!({
"hoursTypeId": "",
"periods": (
json!({
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
})
)
})
),
"name": "",
"openInfo": json!({
"canReopen": false,
"openingDate": json!({
"day": 0,
"month": 0,
"year": 0
}),
"status": ""
}),
"priceLists": (
json!({
"labels": (
json!({
"description": "",
"displayName": "",
"languageCode": ""
})
),
"priceListId": "",
"sections": (
json!({
"items": (
json!({
"itemId": "",
"labels": (json!({})),
"price": json!({
"currencyCode": "",
"nanos": 0,
"units": ""
})
})
),
"labels": (json!({})),
"sectionId": "",
"sectionType": ""
})
),
"sourceUrl": ""
})
),
"primaryCategory": json!({}),
"primaryPhone": "",
"profile": json!({"description": ""}),
"regularHours": json!({"periods": (json!({}))}),
"relationshipData": json!({"parentChain": ""}),
"serviceArea": json!({
"businessType": "",
"places": json!({"placeInfos": (
json!({
"name": "",
"placeId": ""
})
)}),
"radius": json!({
"latlng": json!({}),
"radiusKm": ""
})
}),
"specialHours": json!({"specialHourPeriods": (
json!({
"closeTime": "",
"endDate": json!({}),
"isClosed": false,
"openTime": "",
"startDate": json!({})
})
)}),
"storeCode": "",
"websiteUrl": ""
}),
"query": "",
"resultCount": 0
});
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}}/v4/googleLocations:search \
--header 'content-type: application/json' \
--data '{
"location": {
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
},
"query": "",
"resultCount": 0
}'
echo '{
"location": {
"adWordsLocationExtensions": {
"adPhone": ""
},
"additionalCategories": [
{
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
{
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
}
],
"serviceTypes": [
{
"displayName": "",
"serviceTypeId": ""
}
]
}
],
"additionalPhones": [],
"address": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"attributes": [
{
"attributeId": "",
"repeatedEnumValue": {
"setValues": [],
"unsetValues": []
},
"urlValues": [
{
"url": ""
}
],
"valueType": "",
"values": []
}
],
"labels": [],
"languageCode": "",
"latlng": {
"latitude": "",
"longitude": ""
},
"locationKey": {
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
},
"locationName": "",
"locationState": {
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
},
"metadata": {
"duplicate": {
"access": "",
"locationName": "",
"placeId": ""
},
"mapsUrl": "",
"newReviewUrl": ""
},
"moreHours": [
{
"hoursTypeId": "",
"periods": [
{
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
}
]
}
],
"name": "",
"openInfo": {
"canReopen": false,
"openingDate": {
"day": 0,
"month": 0,
"year": 0
},
"status": ""
},
"priceLists": [
{
"labels": [
{
"description": "",
"displayName": "",
"languageCode": ""
}
],
"priceListId": "",
"sections": [
{
"items": [
{
"itemId": "",
"labels": [
{}
],
"price": {
"currencyCode": "",
"nanos": 0,
"units": ""
}
}
],
"labels": [
{}
],
"sectionId": "",
"sectionType": ""
}
],
"sourceUrl": ""
}
],
"primaryCategory": {},
"primaryPhone": "",
"profile": {
"description": ""
},
"regularHours": {
"periods": [
{}
]
},
"relationshipData": {
"parentChain": ""
},
"serviceArea": {
"businessType": "",
"places": {
"placeInfos": [
{
"name": "",
"placeId": ""
}
]
},
"radius": {
"latlng": {},
"radiusKm": ""
}
},
"specialHours": {
"specialHourPeriods": [
{
"closeTime": "",
"endDate": {},
"isClosed": false,
"openTime": "",
"startDate": {}
}
]
},
"storeCode": "",
"websiteUrl": ""
},
"query": "",
"resultCount": 0
}' | \
http POST {{baseUrl}}/v4/googleLocations:search \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "location": {\n "adWordsLocationExtensions": {\n "adPhone": ""\n },\n "additionalCategories": [\n {\n "categoryId": "",\n "displayName": "",\n "moreHoursTypes": [\n {\n "displayName": "",\n "hoursTypeId": "",\n "localizedDisplayName": ""\n }\n ],\n "serviceTypes": [\n {\n "displayName": "",\n "serviceTypeId": ""\n }\n ]\n }\n ],\n "additionalPhones": [],\n "address": {\n "addressLines": [],\n "administrativeArea": "",\n "languageCode": "",\n "locality": "",\n "organization": "",\n "postalCode": "",\n "recipients": [],\n "regionCode": "",\n "revision": 0,\n "sortingCode": "",\n "sublocality": ""\n },\n "attributes": [\n {\n "attributeId": "",\n "repeatedEnumValue": {\n "setValues": [],\n "unsetValues": []\n },\n "urlValues": [\n {\n "url": ""\n }\n ],\n "valueType": "",\n "values": []\n }\n ],\n "labels": [],\n "languageCode": "",\n "latlng": {\n "latitude": "",\n "longitude": ""\n },\n "locationKey": {\n "explicitNoPlaceId": false,\n "placeId": "",\n "plusPageId": "",\n "requestId": ""\n },\n "locationName": "",\n "locationState": {\n "canDelete": false,\n "canHaveFoodMenus": false,\n "canModifyServiceList": false,\n "canOperateHealthData": false,\n "canOperateLodgingData": false,\n "canUpdate": false,\n "hasPendingEdits": false,\n "hasPendingVerification": false,\n "isDisabled": false,\n "isDisconnected": false,\n "isDuplicate": false,\n "isGoogleUpdated": false,\n "isLocalPostApiDisabled": false,\n "isPendingReview": false,\n "isPublished": false,\n "isSuspended": false,\n "isVerified": false,\n "needsReverification": false\n },\n "metadata": {\n "duplicate": {\n "access": "",\n "locationName": "",\n "placeId": ""\n },\n "mapsUrl": "",\n "newReviewUrl": ""\n },\n "moreHours": [\n {\n "hoursTypeId": "",\n "periods": [\n {\n "closeDay": "",\n "closeTime": "",\n "openDay": "",\n "openTime": ""\n }\n ]\n }\n ],\n "name": "",\n "openInfo": {\n "canReopen": false,\n "openingDate": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "status": ""\n },\n "priceLists": [\n {\n "labels": [\n {\n "description": "",\n "displayName": "",\n "languageCode": ""\n }\n ],\n "priceListId": "",\n "sections": [\n {\n "items": [\n {\n "itemId": "",\n "labels": [\n {}\n ],\n "price": {\n "currencyCode": "",\n "nanos": 0,\n "units": ""\n }\n }\n ],\n "labels": [\n {}\n ],\n "sectionId": "",\n "sectionType": ""\n }\n ],\n "sourceUrl": ""\n }\n ],\n "primaryCategory": {},\n "primaryPhone": "",\n "profile": {\n "description": ""\n },\n "regularHours": {\n "periods": [\n {}\n ]\n },\n "relationshipData": {\n "parentChain": ""\n },\n "serviceArea": {\n "businessType": "",\n "places": {\n "placeInfos": [\n {\n "name": "",\n "placeId": ""\n }\n ]\n },\n "radius": {\n "latlng": {},\n "radiusKm": ""\n }\n },\n "specialHours": {\n "specialHourPeriods": [\n {\n "closeTime": "",\n "endDate": {},\n "isClosed": false,\n "openTime": "",\n "startDate": {}\n }\n ]\n },\n "storeCode": "",\n "websiteUrl": ""\n },\n "query": "",\n "resultCount": 0\n}' \
--output-document \
- {{baseUrl}}/v4/googleLocations:search
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"location": [
"adWordsLocationExtensions": ["adPhone": ""],
"additionalCategories": [
[
"categoryId": "",
"displayName": "",
"moreHoursTypes": [
[
"displayName": "",
"hoursTypeId": "",
"localizedDisplayName": ""
]
],
"serviceTypes": [
[
"displayName": "",
"serviceTypeId": ""
]
]
]
],
"additionalPhones": [],
"address": [
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
],
"attributes": [
[
"attributeId": "",
"repeatedEnumValue": [
"setValues": [],
"unsetValues": []
],
"urlValues": [["url": ""]],
"valueType": "",
"values": []
]
],
"labels": [],
"languageCode": "",
"latlng": [
"latitude": "",
"longitude": ""
],
"locationKey": [
"explicitNoPlaceId": false,
"placeId": "",
"plusPageId": "",
"requestId": ""
],
"locationName": "",
"locationState": [
"canDelete": false,
"canHaveFoodMenus": false,
"canModifyServiceList": false,
"canOperateHealthData": false,
"canOperateLodgingData": false,
"canUpdate": false,
"hasPendingEdits": false,
"hasPendingVerification": false,
"isDisabled": false,
"isDisconnected": false,
"isDuplicate": false,
"isGoogleUpdated": false,
"isLocalPostApiDisabled": false,
"isPendingReview": false,
"isPublished": false,
"isSuspended": false,
"isVerified": false,
"needsReverification": false
],
"metadata": [
"duplicate": [
"access": "",
"locationName": "",
"placeId": ""
],
"mapsUrl": "",
"newReviewUrl": ""
],
"moreHours": [
[
"hoursTypeId": "",
"periods": [
[
"closeDay": "",
"closeTime": "",
"openDay": "",
"openTime": ""
]
]
]
],
"name": "",
"openInfo": [
"canReopen": false,
"openingDate": [
"day": 0,
"month": 0,
"year": 0
],
"status": ""
],
"priceLists": [
[
"labels": [
[
"description": "",
"displayName": "",
"languageCode": ""
]
],
"priceListId": "",
"sections": [
[
"items": [
[
"itemId": "",
"labels": [[]],
"price": [
"currencyCode": "",
"nanos": 0,
"units": ""
]
]
],
"labels": [[]],
"sectionId": "",
"sectionType": ""
]
],
"sourceUrl": ""
]
],
"primaryCategory": [],
"primaryPhone": "",
"profile": ["description": ""],
"regularHours": ["periods": [[]]],
"relationshipData": ["parentChain": ""],
"serviceArea": [
"businessType": "",
"places": ["placeInfos": [
[
"name": "",
"placeId": ""
]
]],
"radius": [
"latlng": [],
"radiusKm": ""
]
],
"specialHours": ["specialHourPeriods": [
[
"closeTime": "",
"endDate": [],
"isClosed": false,
"openTime": "",
"startDate": []
]
]],
"storeCode": "",
"websiteUrl": ""
],
"query": "",
"resultCount": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v4/googleLocations: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()