Cloud Document AI API
GET
documentai.projects.locations.fetchProcessorTypes
{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes")
require "http/client"
url = "{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes"
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}}/v1beta3/:parent:fetchProcessorTypes"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes"
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/v1beta3/:parent:fetchProcessorTypes HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes"))
.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}}/v1beta3/:parent:fetchProcessorTypes")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes")
.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}}/v1beta3/:parent:fetchProcessorTypes');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes';
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}}/v1beta3/:parent:fetchProcessorTypes',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/:parent:fetchProcessorTypes',
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}}/v1beta3/:parent:fetchProcessorTypes'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes');
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}}/v1beta3/:parent:fetchProcessorTypes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes';
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}}/v1beta3/:parent:fetchProcessorTypes"]
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}}/v1beta3/:parent:fetchProcessorTypes" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes",
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}}/v1beta3/:parent:fetchProcessorTypes');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta3/:parent:fetchProcessorTypes")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes")
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/v1beta3/:parent:fetchProcessorTypes') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes";
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}}/v1beta3/:parent:fetchProcessorTypes
http GET {{baseUrl}}/v1beta3/:parent:fetchProcessorTypes
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1beta3/:parent:fetchProcessorTypes
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:parent:fetchProcessorTypes")! 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
documentai.projects.locations.list
{{baseUrl}}/v1beta3/:name/locations
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:name/locations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta3/:name/locations")
require "http/client"
url = "{{baseUrl}}/v1beta3/:name/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}}/v1beta3/:name/locations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:name/locations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:name/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/v1beta3/:name/locations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta3/:name/locations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:name/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}}/v1beta3/:name/locations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta3/:name/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}}/v1beta3/:name/locations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1beta3/:name/locations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:name/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}}/v1beta3/:name/locations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:name/locations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/:name/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}}/v1beta3/:name/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}}/v1beta3/:name/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}}/v1beta3/:name/locations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:name/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}}/v1beta3/:name/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}}/v1beta3/:name/locations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:name/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}}/v1beta3/:name/locations');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name/locations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta3/:name/locations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:name/locations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name/locations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta3/:name/locations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name/locations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name/locations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:name/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/v1beta3/:name/locations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:name/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}}/v1beta3/:name/locations
http GET {{baseUrl}}/v1beta3/:name/locations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1beta3/:name/locations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:name/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
documentai.projects.locations.operations.cancel
{{baseUrl}}/v1beta3/:name:cancel
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:name:cancel");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:name:cancel")
require "http/client"
url = "{{baseUrl}}/v1beta3/:name:cancel"
response = HTTP::Client.post url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1beta3/:name:cancel"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:name:cancel");
var request = new RestRequest("", Method.Post);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:name:cancel"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1beta3/:name:cancel HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:name:cancel")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:name:cancel"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta3/:name:cancel")
.post(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:name:cancel")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta3/:name:cancel');
xhr.send(data);
import axios from 'axios';
const options = {method: 'POST', url: '{{baseUrl}}/v1beta3/:name:cancel'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:name:cancel';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1beta3/:name:cancel',
method: 'POST',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:name:cancel")
.post(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/:name:cancel',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'POST', url: '{{baseUrl}}/v1beta3/:name:cancel'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1beta3/:name:cancel');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'POST', url: '{{baseUrl}}/v1beta3/:name:cancel'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:name:cancel';
const options = {method: 'POST'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta3/:name:cancel"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1beta3/:name:cancel" in
Client.call `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:name:cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1beta3/:name:cancel');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name:cancel');
$request->setMethod(HTTP_METH_POST);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta3/:name:cancel');
$request->setRequestMethod('POST');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:name:cancel' -Method POST
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name:cancel' -Method POST
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("POST", "/baseUrl/v1beta3/:name:cancel")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name:cancel"
response = requests.post(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name:cancel"
response <- VERB("POST", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:name:cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/v1beta3/:name:cancel') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:name:cancel";
let client = reqwest::Client::new();
let response = client.post(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1beta3/:name:cancel
http POST {{baseUrl}}/v1beta3/:name:cancel
wget --quiet \
--method POST \
--output-document \
- {{baseUrl}}/v1beta3/:name:cancel
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:name:cancel")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
documentai.projects.locations.processorTypes.get
{{baseUrl}}/v1beta3/: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}}/v1beta3/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta3/:name")
require "http/client"
url = "{{baseUrl}}/v1beta3/: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}}/v1beta3/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:name");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/: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/v1beta3/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta3/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/: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}}/v1beta3/:name")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta3/: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}}/v1beta3/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1beta3/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/: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}}/v1beta3/:name',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:name")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/: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}}/v1beta3/: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}}/v1beta3/: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}}/v1beta3/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/: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}}/v1beta3/: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}}/v1beta3/:name" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/: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}}/v1beta3/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta3/:name');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:name' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta3/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/: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/v1beta3/:name') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/: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}}/v1beta3/:name
http GET {{baseUrl}}/v1beta3/:name
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1beta3/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/: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
documentai.projects.locations.processorTypes.list
{{baseUrl}}/v1beta3/:parent/processorTypes
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:parent/processorTypes");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta3/:parent/processorTypes")
require "http/client"
url = "{{baseUrl}}/v1beta3/:parent/processorTypes"
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}}/v1beta3/:parent/processorTypes"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:parent/processorTypes");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:parent/processorTypes"
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/v1beta3/:parent/processorTypes HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta3/:parent/processorTypes")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:parent/processorTypes"))
.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}}/v1beta3/:parent/processorTypes")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta3/:parent/processorTypes")
.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}}/v1beta3/:parent/processorTypes');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1beta3/:parent/processorTypes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:parent/processorTypes';
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}}/v1beta3/:parent/processorTypes',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/processorTypes")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/:parent/processorTypes',
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}}/v1beta3/:parent/processorTypes'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta3/:parent/processorTypes');
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}}/v1beta3/:parent/processorTypes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:parent/processorTypes';
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}}/v1beta3/:parent/processorTypes"]
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}}/v1beta3/:parent/processorTypes" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:parent/processorTypes",
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}}/v1beta3/:parent/processorTypes');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:parent/processorTypes');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta3/:parent/processorTypes');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:parent/processorTypes' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:parent/processorTypes' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta3/:parent/processorTypes")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:parent/processorTypes"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:parent/processorTypes"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:parent/processorTypes")
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/v1beta3/:parent/processorTypes') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:parent/processorTypes";
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}}/v1beta3/:parent/processorTypes
http GET {{baseUrl}}/v1beta3/:parent/processorTypes
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1beta3/:parent/processorTypes
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:parent/processorTypes")! 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
documentai.projects.locations.processors.create
{{baseUrl}}/v1beta3/:parent/processors
QUERY PARAMS
parent
BODY json
{
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:parent/processors");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:parent/processors" {:content-type :json
:form-params {:createTime ""
:defaultProcessorVersion ""
:displayName ""
:kmsKeyName ""
:name ""
:processEndpoint ""
:state ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/v1beta3/:parent/processors"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\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}}/v1beta3/:parent/processors"),
Content = new StringContent("{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\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}}/v1beta3/:parent/processors");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:parent/processors"
payload := strings.NewReader("{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\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/v1beta3/:parent/processors HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 164
{
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:parent/processors")
.setHeader("content-type", "application/json")
.setBody("{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:parent/processors"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\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 \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/processors")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:parent/processors")
.header("content-type", "application/json")
.body("{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
createTime: '',
defaultProcessorVersion: '',
displayName: '',
kmsKeyName: '',
name: '',
processEndpoint: '',
state: '',
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}}/v1beta3/:parent/processors');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:parent/processors',
headers: {'content-type': 'application/json'},
data: {
createTime: '',
defaultProcessorVersion: '',
displayName: '',
kmsKeyName: '',
name: '',
processEndpoint: '',
state: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:parent/processors';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","defaultProcessorVersion":"","displayName":"","kmsKeyName":"","name":"","processEndpoint":"","state":"","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}}/v1beta3/:parent/processors',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "createTime": "",\n "defaultProcessorVersion": "",\n "displayName": "",\n "kmsKeyName": "",\n "name": "",\n "processEndpoint": "",\n "state": "",\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 \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/processors")
.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/v1beta3/:parent/processors',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
createTime: '',
defaultProcessorVersion: '',
displayName: '',
kmsKeyName: '',
name: '',
processEndpoint: '',
state: '',
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:parent/processors',
headers: {'content-type': 'application/json'},
body: {
createTime: '',
defaultProcessorVersion: '',
displayName: '',
kmsKeyName: '',
name: '',
processEndpoint: '',
state: '',
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}}/v1beta3/:parent/processors');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
createTime: '',
defaultProcessorVersion: '',
displayName: '',
kmsKeyName: '',
name: '',
processEndpoint: '',
state: '',
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}}/v1beta3/:parent/processors',
headers: {'content-type': 'application/json'},
data: {
createTime: '',
defaultProcessorVersion: '',
displayName: '',
kmsKeyName: '',
name: '',
processEndpoint: '',
state: '',
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:parent/processors';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","defaultProcessorVersion":"","displayName":"","kmsKeyName":"","name":"","processEndpoint":"","state":"","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 = @{ @"createTime": @"",
@"defaultProcessorVersion": @"",
@"displayName": @"",
@"kmsKeyName": @"",
@"name": @"",
@"processEndpoint": @"",
@"state": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta3/:parent/processors"]
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}}/v1beta3/:parent/processors" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:parent/processors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'createTime' => '',
'defaultProcessorVersion' => '',
'displayName' => '',
'kmsKeyName' => '',
'name' => '',
'processEndpoint' => '',
'state' => '',
'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}}/v1beta3/:parent/processors', [
'body' => '{
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:parent/processors');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'createTime' => '',
'defaultProcessorVersion' => '',
'displayName' => '',
'kmsKeyName' => '',
'name' => '',
'processEndpoint' => '',
'state' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'createTime' => '',
'defaultProcessorVersion' => '',
'displayName' => '',
'kmsKeyName' => '',
'name' => '',
'processEndpoint' => '',
'state' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1beta3/:parent/processors');
$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}}/v1beta3/:parent/processors' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:parent/processors' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta3/:parent/processors", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:parent/processors"
payload = {
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:parent/processors"
payload <- "{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\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}}/v1beta3/:parent/processors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\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/v1beta3/:parent/processors') do |req|
req.body = "{\n \"createTime\": \"\",\n \"defaultProcessorVersion\": \"\",\n \"displayName\": \"\",\n \"kmsKeyName\": \"\",\n \"name\": \"\",\n \"processEndpoint\": \"\",\n \"state\": \"\",\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}}/v1beta3/:parent/processors";
let payload = json!({
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"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}}/v1beta3/:parent/processors \
--header 'content-type: application/json' \
--data '{
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"type": ""
}'
echo '{
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"type": ""
}' | \
http POST {{baseUrl}}/v1beta3/:parent/processors \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "createTime": "",\n "defaultProcessorVersion": "",\n "displayName": "",\n "kmsKeyName": "",\n "name": "",\n "processEndpoint": "",\n "state": "",\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/v1beta3/:parent/processors
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"createTime": "",
"defaultProcessorVersion": "",
"displayName": "",
"kmsKeyName": "",
"name": "",
"processEndpoint": "",
"state": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:parent/processors")! 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
documentai.projects.locations.processors.disable
{{baseUrl}}/v1beta3/:name:disable
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}}/v1beta3/:name:disable");
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}}/v1beta3/:name:disable" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v1beta3/:name:disable"
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}}/v1beta3/:name:disable"),
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}}/v1beta3/:name:disable");
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}}/v1beta3/:name:disable"
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/v1beta3/:name:disable HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:name:disable")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:name:disable"))
.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}}/v1beta3/:name:disable")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:name:disable")
.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}}/v1beta3/:name:disable');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:disable',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:name:disable';
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}}/v1beta3/:name:disable',
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}}/v1beta3/:name:disable")
.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/v1beta3/:name:disable',
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}}/v1beta3/:name:disable',
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}}/v1beta3/:name:disable');
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}}/v1beta3/:name:disable',
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}}/v1beta3/:name:disable';
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}}/v1beta3/:name:disable"]
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}}/v1beta3/:name:disable" 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}}/v1beta3/:name:disable",
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}}/v1beta3/:name:disable', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name:disable');
$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}}/v1beta3/:name:disable');
$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}}/v1beta3/:name:disable' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name:disable' -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/v1beta3/:name:disable", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name:disable"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name:disable"
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}}/v1beta3/:name:disable")
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/v1beta3/:name:disable') 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}}/v1beta3/:name:disable";
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}}/v1beta3/:name:disable \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v1beta3/:name:disable \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v1beta3/:name:disable
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}}/v1beta3/:name:disable")! 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
documentai.projects.locations.processors.enable
{{baseUrl}}/v1beta3/:name:enable
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}}/v1beta3/:name:enable");
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}}/v1beta3/:name:enable" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v1beta3/:name:enable"
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}}/v1beta3/:name:enable"),
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}}/v1beta3/:name:enable");
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}}/v1beta3/:name:enable"
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/v1beta3/:name:enable HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:name:enable")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:name:enable"))
.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}}/v1beta3/:name:enable")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:name:enable")
.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}}/v1beta3/:name:enable');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:enable',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:name:enable';
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}}/v1beta3/:name:enable',
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}}/v1beta3/:name:enable")
.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/v1beta3/:name:enable',
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}}/v1beta3/:name:enable',
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}}/v1beta3/:name:enable');
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}}/v1beta3/:name:enable',
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}}/v1beta3/:name:enable';
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}}/v1beta3/:name:enable"]
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}}/v1beta3/:name:enable" 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}}/v1beta3/:name:enable",
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}}/v1beta3/:name:enable', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name:enable');
$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}}/v1beta3/:name:enable');
$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}}/v1beta3/:name:enable' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name:enable' -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/v1beta3/:name:enable", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name:enable"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name:enable"
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}}/v1beta3/:name:enable")
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/v1beta3/:name:enable') 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}}/v1beta3/:name:enable";
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}}/v1beta3/:name:enable \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v1beta3/:name:enable \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v1beta3/:name:enable
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}}/v1beta3/:name:enable")! 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
documentai.projects.locations.processors.humanReviewConfig.reviewDocument
{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument
QUERY PARAMS
humanReviewConfig
BODY json
{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"enableSchemaValidation": false,
"inlineDocument": {},
"priority": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument");
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 \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument" {:content-type :json
:form-params {:document {:content ""
:entities [{:confidence ""
:id ""
:mentionId ""
:mentionText ""
:normalizedValue {:addressValue {:addressLines []
:administrativeArea ""
:languageCode ""
:locality ""
:organization ""
:postalCode ""
:recipients []
:regionCode ""
:revision 0
:sortingCode ""
:sublocality ""}
:booleanValue false
:dateValue {:day 0
:month 0
:year 0}
:datetimeValue {:day 0
:hours 0
:minutes 0
:month 0
:nanos 0
:seconds 0
:timeZone {:id ""
:version ""}
:utcOffset ""
:year 0}
:floatValue ""
:integerValue 0
:moneyValue {:currencyCode ""
:nanos 0
:units ""}
:text ""}
:pageAnchor {:pageRefs [{:boundingPoly {:normalizedVertices [{:x ""
:y ""}]
:vertices [{:x 0
:y 0}]}
:confidence ""
:layoutId ""
:layoutType ""
:page ""}]}
:properties []
:provenance {:id 0
:parents [{:id 0
:index 0
:revision 0}]
:revision 0
:type ""}
:redacted false
:textAnchor {:content ""
:textSegments [{:endIndex ""
:startIndex ""}]}
:type ""}]
:entityRelations [{:objectId ""
:relation ""
:subjectId ""}]
:error {:code 0
:details [{}]
:message ""}
:mimeType ""
:pages [{:blocks [{:detectedLanguages [{:confidence ""
:languageCode ""}]
:layout {:boundingPoly {}
:confidence ""
:orientation ""
:textAnchor {}}
:provenance {}}]
:detectedBarcodes [{:barcode {:format ""
:rawValue ""
:valueFormat ""}
:layout {}}]
:detectedLanguages [{}]
:dimension {:height ""
:unit ""
:width ""}
:formFields [{:correctedKeyText ""
:correctedValueText ""
:fieldName {}
:fieldValue {}
:nameDetectedLanguages [{}]
:provenance {}
:valueDetectedLanguages [{}]
:valueType ""}]
:image {:content ""
:height 0
:mimeType ""
:width 0}
:imageQualityScores {:detectedDefects [{:confidence ""
:type ""}]
:qualityScore ""}
:layout {}
:lines [{:detectedLanguages [{}]
:layout {}
:provenance {}}]
:pageNumber 0
:paragraphs [{:detectedLanguages [{}]
:layout {}
:provenance {}}]
:provenance {}
:symbols [{:detectedLanguages [{}]
:layout {}}]
:tables [{:bodyRows [{:cells [{:colSpan 0
:detectedLanguages [{}]
:layout {}
:rowSpan 0}]}]
:detectedLanguages [{}]
:headerRows [{}]
:layout {}
:provenance {}}]
:tokens [{:detectedBreak {:type ""}
:detectedLanguages [{}]
:layout {}
:provenance {}}]
:transforms [{:cols 0
:data ""
:rows 0
:type 0}]
:visualElements [{:detectedLanguages [{}]
:layout {}
:type ""}]}]
:revisions [{:agent ""
:createTime ""
:humanReview {:state ""
:stateMessage ""}
:id ""
:parent []
:parentIds []
:processor ""}]
:shardInfo {:shardCount ""
:shardIndex ""
:textOffset ""}
:text ""
:textChanges [{:changedText ""
:provenance [{}]
:textAnchor {}}]
:textStyles [{:backgroundColor {:alpha ""
:blue ""
:green ""
:red ""}
:color {}
:fontFamily ""
:fontSize {:size ""
:unit ""}
:fontWeight ""
:textAnchor {}
:textDecoration ""
:textStyle ""}]
:uri ""}
:documentSchema {:description ""
:displayName ""
:entityTypes [{:baseTypes []
:displayName ""
:enumValues {:values []}
:name ""
:properties [{:name ""
:occurrenceType ""
:valueType ""}]}]
:metadata {:documentAllowMultipleLabels false
:documentSplitter false
:prefixedNamingOnProperties false
:skipNamingValidation false}}
:enableSchemaValidation false
:inlineDocument {}
:priority ""}})
require "http/client"
url = "{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\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}}/v1beta3/:humanReviewConfig:reviewDocument"),
Content = new StringContent("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\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}}/v1beta3/:humanReviewConfig:reviewDocument");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument"
payload := strings.NewReader("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\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/v1beta3/:humanReviewConfig:reviewDocument HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 7439
{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"enableSchemaValidation": false,
"inlineDocument": {},
"priority": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument")
.setHeader("content-type", "application/json")
.setBody("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\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 \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument")
.header("content-type", "application/json")
.body("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\n}")
.asString();
const data = JSON.stringify({
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {
day: 0,
month: 0,
year: 0
},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {
id: '',
version: ''
},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {
currencyCode: '',
nanos: 0,
units: ''
},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {
normalizedVertices: [
{
x: '',
y: ''
}
],
vertices: [
{
x: 0,
y: 0
}
]
},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {
id: 0,
parents: [
{
id: 0,
index: 0,
revision: 0
}
],
revision: 0,
type: ''
},
redacted: false,
textAnchor: {
content: '',
textSegments: [
{
endIndex: '',
startIndex: ''
}
]
},
type: ''
}
],
entityRelations: [
{
objectId: '',
relation: '',
subjectId: ''
}
],
error: {
code: 0,
details: [
{}
],
message: ''
},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [
{
confidence: '',
languageCode: ''
}
],
layout: {
boundingPoly: {},
confidence: '',
orientation: '',
textAnchor: {}
},
provenance: {}
}
],
detectedBarcodes: [
{
barcode: {
format: '',
rawValue: '',
valueFormat: ''
},
layout: {}
}
],
detectedLanguages: [
{}
],
dimension: {
height: '',
unit: '',
width: ''
},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [
{}
],
provenance: {},
valueDetectedLanguages: [
{}
],
valueType: ''
}
],
image: {
content: '',
height: 0,
mimeType: '',
width: 0
},
imageQualityScores: {
detectedDefects: [
{
confidence: '',
type: ''
}
],
qualityScore: ''
},
layout: {},
lines: [
{
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
pageNumber: 0,
paragraphs: [
{
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
provenance: {},
symbols: [
{
detectedLanguages: [
{}
],
layout: {}
}
],
tables: [
{
bodyRows: [
{
cells: [
{
colSpan: 0,
detectedLanguages: [
{}
],
layout: {},
rowSpan: 0
}
]
}
],
detectedLanguages: [
{}
],
headerRows: [
{}
],
layout: {},
provenance: {}
}
],
tokens: [
{
detectedBreak: {
type: ''
},
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
transforms: [
{
cols: 0,
data: '',
rows: 0,
type: 0
}
],
visualElements: [
{
detectedLanguages: [
{}
],
layout: {},
type: ''
}
]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {
state: '',
stateMessage: ''
},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {
shardCount: '',
shardIndex: '',
textOffset: ''
},
text: '',
textChanges: [
{
changedText: '',
provenance: [
{}
],
textAnchor: {}
}
],
textStyles: [
{
backgroundColor: {
alpha: '',
blue: '',
green: '',
red: ''
},
color: {},
fontFamily: '',
fontSize: {
size: '',
unit: ''
},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {
values: []
},
name: '',
properties: [
{
name: '',
occurrenceType: '',
valueType: ''
}
]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
enableSchemaValidation: false,
inlineDocument: {},
priority: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument',
headers: {'content-type': 'application/json'},
data: {
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {day: 0, month: 0, year: 0},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {currencyCode: '', nanos: 0, units: ''},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {normalizedVertices: [{x: '', y: ''}], vertices: [{x: 0, y: 0}]},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {id: 0, parents: [{id: 0, index: 0, revision: 0}], revision: 0, type: ''},
redacted: false,
textAnchor: {content: '', textSegments: [{endIndex: '', startIndex: ''}]},
type: ''
}
],
entityRelations: [{objectId: '', relation: '', subjectId: ''}],
error: {code: 0, details: [{}], message: ''},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [{confidence: '', languageCode: ''}],
layout: {boundingPoly: {}, confidence: '', orientation: '', textAnchor: {}},
provenance: {}
}
],
detectedBarcodes: [{barcode: {format: '', rawValue: '', valueFormat: ''}, layout: {}}],
detectedLanguages: [{}],
dimension: {height: '', unit: '', width: ''},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [{}],
provenance: {},
valueDetectedLanguages: [{}],
valueType: ''
}
],
image: {content: '', height: 0, mimeType: '', width: 0},
imageQualityScores: {detectedDefects: [{confidence: '', type: ''}], qualityScore: ''},
layout: {},
lines: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
pageNumber: 0,
paragraphs: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
provenance: {},
symbols: [{detectedLanguages: [{}], layout: {}}],
tables: [
{
bodyRows: [{cells: [{colSpan: 0, detectedLanguages: [{}], layout: {}, rowSpan: 0}]}],
detectedLanguages: [{}],
headerRows: [{}],
layout: {},
provenance: {}
}
],
tokens: [
{detectedBreak: {type: ''}, detectedLanguages: [{}], layout: {}, provenance: {}}
],
transforms: [{cols: 0, data: '', rows: 0, type: 0}],
visualElements: [{detectedLanguages: [{}], layout: {}, type: ''}]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {state: '', stateMessage: ''},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {shardCount: '', shardIndex: '', textOffset: ''},
text: '',
textChanges: [{changedText: '', provenance: [{}], textAnchor: {}}],
textStyles: [
{
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
color: {},
fontFamily: '',
fontSize: {size: '', unit: ''},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {values: []},
name: '',
properties: [{name: '', occurrenceType: '', valueType: ''}]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
enableSchemaValidation: false,
inlineDocument: {},
priority: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"document":{"content":"","entities":[{"confidence":"","id":"","mentionId":"","mentionText":"","normalizedValue":{"addressValue":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"booleanValue":false,"dateValue":{"day":0,"month":0,"year":0},"datetimeValue":{"day":0,"hours":0,"minutes":0,"month":0,"nanos":0,"seconds":0,"timeZone":{"id":"","version":""},"utcOffset":"","year":0},"floatValue":"","integerValue":0,"moneyValue":{"currencyCode":"","nanos":0,"units":""},"text":""},"pageAnchor":{"pageRefs":[{"boundingPoly":{"normalizedVertices":[{"x":"","y":""}],"vertices":[{"x":0,"y":0}]},"confidence":"","layoutId":"","layoutType":"","page":""}]},"properties":[],"provenance":{"id":0,"parents":[{"id":0,"index":0,"revision":0}],"revision":0,"type":""},"redacted":false,"textAnchor":{"content":"","textSegments":[{"endIndex":"","startIndex":""}]},"type":""}],"entityRelations":[{"objectId":"","relation":"","subjectId":""}],"error":{"code":0,"details":[{}],"message":""},"mimeType":"","pages":[{"blocks":[{"detectedLanguages":[{"confidence":"","languageCode":""}],"layout":{"boundingPoly":{},"confidence":"","orientation":"","textAnchor":{}},"provenance":{}}],"detectedBarcodes":[{"barcode":{"format":"","rawValue":"","valueFormat":""},"layout":{}}],"detectedLanguages":[{}],"dimension":{"height":"","unit":"","width":""},"formFields":[{"correctedKeyText":"","correctedValueText":"","fieldName":{},"fieldValue":{},"nameDetectedLanguages":[{}],"provenance":{},"valueDetectedLanguages":[{}],"valueType":""}],"image":{"content":"","height":0,"mimeType":"","width":0},"imageQualityScores":{"detectedDefects":[{"confidence":"","type":""}],"qualityScore":""},"layout":{},"lines":[{"detectedLanguages":[{}],"layout":{},"provenance":{}}],"pageNumber":0,"paragraphs":[{"detectedLanguages":[{}],"layout":{},"provenance":{}}],"provenance":{},"symbols":[{"detectedLanguages":[{}],"layout":{}}],"tables":[{"bodyRows":[{"cells":[{"colSpan":0,"detectedLanguages":[{}],"layout":{},"rowSpan":0}]}],"detectedLanguages":[{}],"headerRows":[{}],"layout":{},"provenance":{}}],"tokens":[{"detectedBreak":{"type":""},"detectedLanguages":[{}],"layout":{},"provenance":{}}],"transforms":[{"cols":0,"data":"","rows":0,"type":0}],"visualElements":[{"detectedLanguages":[{}],"layout":{},"type":""}]}],"revisions":[{"agent":"","createTime":"","humanReview":{"state":"","stateMessage":""},"id":"","parent":[],"parentIds":[],"processor":""}],"shardInfo":{"shardCount":"","shardIndex":"","textOffset":""},"text":"","textChanges":[{"changedText":"","provenance":[{}],"textAnchor":{}}],"textStyles":[{"backgroundColor":{"alpha":"","blue":"","green":"","red":""},"color":{},"fontFamily":"","fontSize":{"size":"","unit":""},"fontWeight":"","textAnchor":{},"textDecoration":"","textStyle":""}],"uri":""},"documentSchema":{"description":"","displayName":"","entityTypes":[{"baseTypes":[],"displayName":"","enumValues":{"values":[]},"name":"","properties":[{"name":"","occurrenceType":"","valueType":""}]}],"metadata":{"documentAllowMultipleLabels":false,"documentSplitter":false,"prefixedNamingOnProperties":false,"skipNamingValidation":false}},"enableSchemaValidation":false,"inlineDocument":{},"priority":""}'
};
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}}/v1beta3/:humanReviewConfig:reviewDocument',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "document": {\n "content": "",\n "entities": [\n {\n "confidence": "",\n "id": "",\n "mentionId": "",\n "mentionText": "",\n "normalizedValue": {\n "addressValue": {\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 "booleanValue": false,\n "dateValue": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "datetimeValue": {\n "day": 0,\n "hours": 0,\n "minutes": 0,\n "month": 0,\n "nanos": 0,\n "seconds": 0,\n "timeZone": {\n "id": "",\n "version": ""\n },\n "utcOffset": "",\n "year": 0\n },\n "floatValue": "",\n "integerValue": 0,\n "moneyValue": {\n "currencyCode": "",\n "nanos": 0,\n "units": ""\n },\n "text": ""\n },\n "pageAnchor": {\n "pageRefs": [\n {\n "boundingPoly": {\n "normalizedVertices": [\n {\n "x": "",\n "y": ""\n }\n ],\n "vertices": [\n {\n "x": 0,\n "y": 0\n }\n ]\n },\n "confidence": "",\n "layoutId": "",\n "layoutType": "",\n "page": ""\n }\n ]\n },\n "properties": [],\n "provenance": {\n "id": 0,\n "parents": [\n {\n "id": 0,\n "index": 0,\n "revision": 0\n }\n ],\n "revision": 0,\n "type": ""\n },\n "redacted": false,\n "textAnchor": {\n "content": "",\n "textSegments": [\n {\n "endIndex": "",\n "startIndex": ""\n }\n ]\n },\n "type": ""\n }\n ],\n "entityRelations": [\n {\n "objectId": "",\n "relation": "",\n "subjectId": ""\n }\n ],\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "mimeType": "",\n "pages": [\n {\n "blocks": [\n {\n "detectedLanguages": [\n {\n "confidence": "",\n "languageCode": ""\n }\n ],\n "layout": {\n "boundingPoly": {},\n "confidence": "",\n "orientation": "",\n "textAnchor": {}\n },\n "provenance": {}\n }\n ],\n "detectedBarcodes": [\n {\n "barcode": {\n "format": "",\n "rawValue": "",\n "valueFormat": ""\n },\n "layout": {}\n }\n ],\n "detectedLanguages": [\n {}\n ],\n "dimension": {\n "height": "",\n "unit": "",\n "width": ""\n },\n "formFields": [\n {\n "correctedKeyText": "",\n "correctedValueText": "",\n "fieldName": {},\n "fieldValue": {},\n "nameDetectedLanguages": [\n {}\n ],\n "provenance": {},\n "valueDetectedLanguages": [\n {}\n ],\n "valueType": ""\n }\n ],\n "image": {\n "content": "",\n "height": 0,\n "mimeType": "",\n "width": 0\n },\n "imageQualityScores": {\n "detectedDefects": [\n {\n "confidence": "",\n "type": ""\n }\n ],\n "qualityScore": ""\n },\n "layout": {},\n "lines": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "pageNumber": 0,\n "paragraphs": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "provenance": {},\n "symbols": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {}\n }\n ],\n "tables": [\n {\n "bodyRows": [\n {\n "cells": [\n {\n "colSpan": 0,\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "rowSpan": 0\n }\n ]\n }\n ],\n "detectedLanguages": [\n {}\n ],\n "headerRows": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "tokens": [\n {\n "detectedBreak": {\n "type": ""\n },\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "transforms": [\n {\n "cols": 0,\n "data": "",\n "rows": 0,\n "type": 0\n }\n ],\n "visualElements": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "type": ""\n }\n ]\n }\n ],\n "revisions": [\n {\n "agent": "",\n "createTime": "",\n "humanReview": {\n "state": "",\n "stateMessage": ""\n },\n "id": "",\n "parent": [],\n "parentIds": [],\n "processor": ""\n }\n ],\n "shardInfo": {\n "shardCount": "",\n "shardIndex": "",\n "textOffset": ""\n },\n "text": "",\n "textChanges": [\n {\n "changedText": "",\n "provenance": [\n {}\n ],\n "textAnchor": {}\n }\n ],\n "textStyles": [\n {\n "backgroundColor": {\n "alpha": "",\n "blue": "",\n "green": "",\n "red": ""\n },\n "color": {},\n "fontFamily": "",\n "fontSize": {\n "size": "",\n "unit": ""\n },\n "fontWeight": "",\n "textAnchor": {},\n "textDecoration": "",\n "textStyle": ""\n }\n ],\n "uri": ""\n },\n "documentSchema": {\n "description": "",\n "displayName": "",\n "entityTypes": [\n {\n "baseTypes": [],\n "displayName": "",\n "enumValues": {\n "values": []\n },\n "name": "",\n "properties": [\n {\n "name": "",\n "occurrenceType": "",\n "valueType": ""\n }\n ]\n }\n ],\n "metadata": {\n "documentAllowMultipleLabels": false,\n "documentSplitter": false,\n "prefixedNamingOnProperties": false,\n "skipNamingValidation": false\n }\n },\n "enableSchemaValidation": false,\n "inlineDocument": {},\n "priority": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument")
.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/v1beta3/:humanReviewConfig:reviewDocument',
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({
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {day: 0, month: 0, year: 0},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {currencyCode: '', nanos: 0, units: ''},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {normalizedVertices: [{x: '', y: ''}], vertices: [{x: 0, y: 0}]},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {id: 0, parents: [{id: 0, index: 0, revision: 0}], revision: 0, type: ''},
redacted: false,
textAnchor: {content: '', textSegments: [{endIndex: '', startIndex: ''}]},
type: ''
}
],
entityRelations: [{objectId: '', relation: '', subjectId: ''}],
error: {code: 0, details: [{}], message: ''},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [{confidence: '', languageCode: ''}],
layout: {boundingPoly: {}, confidence: '', orientation: '', textAnchor: {}},
provenance: {}
}
],
detectedBarcodes: [{barcode: {format: '', rawValue: '', valueFormat: ''}, layout: {}}],
detectedLanguages: [{}],
dimension: {height: '', unit: '', width: ''},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [{}],
provenance: {},
valueDetectedLanguages: [{}],
valueType: ''
}
],
image: {content: '', height: 0, mimeType: '', width: 0},
imageQualityScores: {detectedDefects: [{confidence: '', type: ''}], qualityScore: ''},
layout: {},
lines: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
pageNumber: 0,
paragraphs: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
provenance: {},
symbols: [{detectedLanguages: [{}], layout: {}}],
tables: [
{
bodyRows: [{cells: [{colSpan: 0, detectedLanguages: [{}], layout: {}, rowSpan: 0}]}],
detectedLanguages: [{}],
headerRows: [{}],
layout: {},
provenance: {}
}
],
tokens: [
{detectedBreak: {type: ''}, detectedLanguages: [{}], layout: {}, provenance: {}}
],
transforms: [{cols: 0, data: '', rows: 0, type: 0}],
visualElements: [{detectedLanguages: [{}], layout: {}, type: ''}]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {state: '', stateMessage: ''},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {shardCount: '', shardIndex: '', textOffset: ''},
text: '',
textChanges: [{changedText: '', provenance: [{}], textAnchor: {}}],
textStyles: [
{
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
color: {},
fontFamily: '',
fontSize: {size: '', unit: ''},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {values: []},
name: '',
properties: [{name: '', occurrenceType: '', valueType: ''}]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
enableSchemaValidation: false,
inlineDocument: {},
priority: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument',
headers: {'content-type': 'application/json'},
body: {
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {day: 0, month: 0, year: 0},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {currencyCode: '', nanos: 0, units: ''},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {normalizedVertices: [{x: '', y: ''}], vertices: [{x: 0, y: 0}]},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {id: 0, parents: [{id: 0, index: 0, revision: 0}], revision: 0, type: ''},
redacted: false,
textAnchor: {content: '', textSegments: [{endIndex: '', startIndex: ''}]},
type: ''
}
],
entityRelations: [{objectId: '', relation: '', subjectId: ''}],
error: {code: 0, details: [{}], message: ''},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [{confidence: '', languageCode: ''}],
layout: {boundingPoly: {}, confidence: '', orientation: '', textAnchor: {}},
provenance: {}
}
],
detectedBarcodes: [{barcode: {format: '', rawValue: '', valueFormat: ''}, layout: {}}],
detectedLanguages: [{}],
dimension: {height: '', unit: '', width: ''},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [{}],
provenance: {},
valueDetectedLanguages: [{}],
valueType: ''
}
],
image: {content: '', height: 0, mimeType: '', width: 0},
imageQualityScores: {detectedDefects: [{confidence: '', type: ''}], qualityScore: ''},
layout: {},
lines: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
pageNumber: 0,
paragraphs: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
provenance: {},
symbols: [{detectedLanguages: [{}], layout: {}}],
tables: [
{
bodyRows: [{cells: [{colSpan: 0, detectedLanguages: [{}], layout: {}, rowSpan: 0}]}],
detectedLanguages: [{}],
headerRows: [{}],
layout: {},
provenance: {}
}
],
tokens: [
{detectedBreak: {type: ''}, detectedLanguages: [{}], layout: {}, provenance: {}}
],
transforms: [{cols: 0, data: '', rows: 0, type: 0}],
visualElements: [{detectedLanguages: [{}], layout: {}, type: ''}]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {state: '', stateMessage: ''},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {shardCount: '', shardIndex: '', textOffset: ''},
text: '',
textChanges: [{changedText: '', provenance: [{}], textAnchor: {}}],
textStyles: [
{
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
color: {},
fontFamily: '',
fontSize: {size: '', unit: ''},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {values: []},
name: '',
properties: [{name: '', occurrenceType: '', valueType: ''}]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
enableSchemaValidation: false,
inlineDocument: {},
priority: ''
},
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}}/v1beta3/:humanReviewConfig:reviewDocument');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {
day: 0,
month: 0,
year: 0
},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {
id: '',
version: ''
},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {
currencyCode: '',
nanos: 0,
units: ''
},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {
normalizedVertices: [
{
x: '',
y: ''
}
],
vertices: [
{
x: 0,
y: 0
}
]
},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {
id: 0,
parents: [
{
id: 0,
index: 0,
revision: 0
}
],
revision: 0,
type: ''
},
redacted: false,
textAnchor: {
content: '',
textSegments: [
{
endIndex: '',
startIndex: ''
}
]
},
type: ''
}
],
entityRelations: [
{
objectId: '',
relation: '',
subjectId: ''
}
],
error: {
code: 0,
details: [
{}
],
message: ''
},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [
{
confidence: '',
languageCode: ''
}
],
layout: {
boundingPoly: {},
confidence: '',
orientation: '',
textAnchor: {}
},
provenance: {}
}
],
detectedBarcodes: [
{
barcode: {
format: '',
rawValue: '',
valueFormat: ''
},
layout: {}
}
],
detectedLanguages: [
{}
],
dimension: {
height: '',
unit: '',
width: ''
},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [
{}
],
provenance: {},
valueDetectedLanguages: [
{}
],
valueType: ''
}
],
image: {
content: '',
height: 0,
mimeType: '',
width: 0
},
imageQualityScores: {
detectedDefects: [
{
confidence: '',
type: ''
}
],
qualityScore: ''
},
layout: {},
lines: [
{
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
pageNumber: 0,
paragraphs: [
{
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
provenance: {},
symbols: [
{
detectedLanguages: [
{}
],
layout: {}
}
],
tables: [
{
bodyRows: [
{
cells: [
{
colSpan: 0,
detectedLanguages: [
{}
],
layout: {},
rowSpan: 0
}
]
}
],
detectedLanguages: [
{}
],
headerRows: [
{}
],
layout: {},
provenance: {}
}
],
tokens: [
{
detectedBreak: {
type: ''
},
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
transforms: [
{
cols: 0,
data: '',
rows: 0,
type: 0
}
],
visualElements: [
{
detectedLanguages: [
{}
],
layout: {},
type: ''
}
]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {
state: '',
stateMessage: ''
},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {
shardCount: '',
shardIndex: '',
textOffset: ''
},
text: '',
textChanges: [
{
changedText: '',
provenance: [
{}
],
textAnchor: {}
}
],
textStyles: [
{
backgroundColor: {
alpha: '',
blue: '',
green: '',
red: ''
},
color: {},
fontFamily: '',
fontSize: {
size: '',
unit: ''
},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {
values: []
},
name: '',
properties: [
{
name: '',
occurrenceType: '',
valueType: ''
}
]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
enableSchemaValidation: false,
inlineDocument: {},
priority: ''
});
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}}/v1beta3/:humanReviewConfig:reviewDocument',
headers: {'content-type': 'application/json'},
data: {
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {day: 0, month: 0, year: 0},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {currencyCode: '', nanos: 0, units: ''},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {normalizedVertices: [{x: '', y: ''}], vertices: [{x: 0, y: 0}]},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {id: 0, parents: [{id: 0, index: 0, revision: 0}], revision: 0, type: ''},
redacted: false,
textAnchor: {content: '', textSegments: [{endIndex: '', startIndex: ''}]},
type: ''
}
],
entityRelations: [{objectId: '', relation: '', subjectId: ''}],
error: {code: 0, details: [{}], message: ''},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [{confidence: '', languageCode: ''}],
layout: {boundingPoly: {}, confidence: '', orientation: '', textAnchor: {}},
provenance: {}
}
],
detectedBarcodes: [{barcode: {format: '', rawValue: '', valueFormat: ''}, layout: {}}],
detectedLanguages: [{}],
dimension: {height: '', unit: '', width: ''},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [{}],
provenance: {},
valueDetectedLanguages: [{}],
valueType: ''
}
],
image: {content: '', height: 0, mimeType: '', width: 0},
imageQualityScores: {detectedDefects: [{confidence: '', type: ''}], qualityScore: ''},
layout: {},
lines: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
pageNumber: 0,
paragraphs: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
provenance: {},
symbols: [{detectedLanguages: [{}], layout: {}}],
tables: [
{
bodyRows: [{cells: [{colSpan: 0, detectedLanguages: [{}], layout: {}, rowSpan: 0}]}],
detectedLanguages: [{}],
headerRows: [{}],
layout: {},
provenance: {}
}
],
tokens: [
{detectedBreak: {type: ''}, detectedLanguages: [{}], layout: {}, provenance: {}}
],
transforms: [{cols: 0, data: '', rows: 0, type: 0}],
visualElements: [{detectedLanguages: [{}], layout: {}, type: ''}]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {state: '', stateMessage: ''},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {shardCount: '', shardIndex: '', textOffset: ''},
text: '',
textChanges: [{changedText: '', provenance: [{}], textAnchor: {}}],
textStyles: [
{
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
color: {},
fontFamily: '',
fontSize: {size: '', unit: ''},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {values: []},
name: '',
properties: [{name: '', occurrenceType: '', valueType: ''}]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
enableSchemaValidation: false,
inlineDocument: {},
priority: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"document":{"content":"","entities":[{"confidence":"","id":"","mentionId":"","mentionText":"","normalizedValue":{"addressValue":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"booleanValue":false,"dateValue":{"day":0,"month":0,"year":0},"datetimeValue":{"day":0,"hours":0,"minutes":0,"month":0,"nanos":0,"seconds":0,"timeZone":{"id":"","version":""},"utcOffset":"","year":0},"floatValue":"","integerValue":0,"moneyValue":{"currencyCode":"","nanos":0,"units":""},"text":""},"pageAnchor":{"pageRefs":[{"boundingPoly":{"normalizedVertices":[{"x":"","y":""}],"vertices":[{"x":0,"y":0}]},"confidence":"","layoutId":"","layoutType":"","page":""}]},"properties":[],"provenance":{"id":0,"parents":[{"id":0,"index":0,"revision":0}],"revision":0,"type":""},"redacted":false,"textAnchor":{"content":"","textSegments":[{"endIndex":"","startIndex":""}]},"type":""}],"entityRelations":[{"objectId":"","relation":"","subjectId":""}],"error":{"code":0,"details":[{}],"message":""},"mimeType":"","pages":[{"blocks":[{"detectedLanguages":[{"confidence":"","languageCode":""}],"layout":{"boundingPoly":{},"confidence":"","orientation":"","textAnchor":{}},"provenance":{}}],"detectedBarcodes":[{"barcode":{"format":"","rawValue":"","valueFormat":""},"layout":{}}],"detectedLanguages":[{}],"dimension":{"height":"","unit":"","width":""},"formFields":[{"correctedKeyText":"","correctedValueText":"","fieldName":{},"fieldValue":{},"nameDetectedLanguages":[{}],"provenance":{},"valueDetectedLanguages":[{}],"valueType":""}],"image":{"content":"","height":0,"mimeType":"","width":0},"imageQualityScores":{"detectedDefects":[{"confidence":"","type":""}],"qualityScore":""},"layout":{},"lines":[{"detectedLanguages":[{}],"layout":{},"provenance":{}}],"pageNumber":0,"paragraphs":[{"detectedLanguages":[{}],"layout":{},"provenance":{}}],"provenance":{},"symbols":[{"detectedLanguages":[{}],"layout":{}}],"tables":[{"bodyRows":[{"cells":[{"colSpan":0,"detectedLanguages":[{}],"layout":{},"rowSpan":0}]}],"detectedLanguages":[{}],"headerRows":[{}],"layout":{},"provenance":{}}],"tokens":[{"detectedBreak":{"type":""},"detectedLanguages":[{}],"layout":{},"provenance":{}}],"transforms":[{"cols":0,"data":"","rows":0,"type":0}],"visualElements":[{"detectedLanguages":[{}],"layout":{},"type":""}]}],"revisions":[{"agent":"","createTime":"","humanReview":{"state":"","stateMessage":""},"id":"","parent":[],"parentIds":[],"processor":""}],"shardInfo":{"shardCount":"","shardIndex":"","textOffset":""},"text":"","textChanges":[{"changedText":"","provenance":[{}],"textAnchor":{}}],"textStyles":[{"backgroundColor":{"alpha":"","blue":"","green":"","red":""},"color":{},"fontFamily":"","fontSize":{"size":"","unit":""},"fontWeight":"","textAnchor":{},"textDecoration":"","textStyle":""}],"uri":""},"documentSchema":{"description":"","displayName":"","entityTypes":[{"baseTypes":[],"displayName":"","enumValues":{"values":[]},"name":"","properties":[{"name":"","occurrenceType":"","valueType":""}]}],"metadata":{"documentAllowMultipleLabels":false,"documentSplitter":false,"prefixedNamingOnProperties":false,"skipNamingValidation":false}},"enableSchemaValidation":false,"inlineDocument":{},"priority":""}'
};
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 = @{ @"document": @{ @"content": @"", @"entities": @[ @{ @"confidence": @"", @"id": @"", @"mentionId": @"", @"mentionText": @"", @"normalizedValue": @{ @"addressValue": @{ @"addressLines": @[ ], @"administrativeArea": @"", @"languageCode": @"", @"locality": @"", @"organization": @"", @"postalCode": @"", @"recipients": @[ ], @"regionCode": @"", @"revision": @0, @"sortingCode": @"", @"sublocality": @"" }, @"booleanValue": @NO, @"dateValue": @{ @"day": @0, @"month": @0, @"year": @0 }, @"datetimeValue": @{ @"day": @0, @"hours": @0, @"minutes": @0, @"month": @0, @"nanos": @0, @"seconds": @0, @"timeZone": @{ @"id": @"", @"version": @"" }, @"utcOffset": @"", @"year": @0 }, @"floatValue": @"", @"integerValue": @0, @"moneyValue": @{ @"currencyCode": @"", @"nanos": @0, @"units": @"" }, @"text": @"" }, @"pageAnchor": @{ @"pageRefs": @[ @{ @"boundingPoly": @{ @"normalizedVertices": @[ @{ @"x": @"", @"y": @"" } ], @"vertices": @[ @{ @"x": @0, @"y": @0 } ] }, @"confidence": @"", @"layoutId": @"", @"layoutType": @"", @"page": @"" } ] }, @"properties": @[ ], @"provenance": @{ @"id": @0, @"parents": @[ @{ @"id": @0, @"index": @0, @"revision": @0 } ], @"revision": @0, @"type": @"" }, @"redacted": @NO, @"textAnchor": @{ @"content": @"", @"textSegments": @[ @{ @"endIndex": @"", @"startIndex": @"" } ] }, @"type": @"" } ], @"entityRelations": @[ @{ @"objectId": @"", @"relation": @"", @"subjectId": @"" } ], @"error": @{ @"code": @0, @"details": @[ @{ } ], @"message": @"" }, @"mimeType": @"", @"pages": @[ @{ @"blocks": @[ @{ @"detectedLanguages": @[ @{ @"confidence": @"", @"languageCode": @"" } ], @"layout": @{ @"boundingPoly": @{ }, @"confidence": @"", @"orientation": @"", @"textAnchor": @{ } }, @"provenance": @{ } } ], @"detectedBarcodes": @[ @{ @"barcode": @{ @"format": @"", @"rawValue": @"", @"valueFormat": @"" }, @"layout": @{ } } ], @"detectedLanguages": @[ @{ } ], @"dimension": @{ @"height": @"", @"unit": @"", @"width": @"" }, @"formFields": @[ @{ @"correctedKeyText": @"", @"correctedValueText": @"", @"fieldName": @{ }, @"fieldValue": @{ }, @"nameDetectedLanguages": @[ @{ } ], @"provenance": @{ }, @"valueDetectedLanguages": @[ @{ } ], @"valueType": @"" } ], @"image": @{ @"content": @"", @"height": @0, @"mimeType": @"", @"width": @0 }, @"imageQualityScores": @{ @"detectedDefects": @[ @{ @"confidence": @"", @"type": @"" } ], @"qualityScore": @"" }, @"layout": @{ }, @"lines": @[ @{ @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"provenance": @{ } } ], @"pageNumber": @0, @"paragraphs": @[ @{ @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"provenance": @{ } } ], @"provenance": @{ }, @"symbols": @[ @{ @"detectedLanguages": @[ @{ } ], @"layout": @{ } } ], @"tables": @[ @{ @"bodyRows": @[ @{ @"cells": @[ @{ @"colSpan": @0, @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"rowSpan": @0 } ] } ], @"detectedLanguages": @[ @{ } ], @"headerRows": @[ @{ } ], @"layout": @{ }, @"provenance": @{ } } ], @"tokens": @[ @{ @"detectedBreak": @{ @"type": @"" }, @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"provenance": @{ } } ], @"transforms": @[ @{ @"cols": @0, @"data": @"", @"rows": @0, @"type": @0 } ], @"visualElements": @[ @{ @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"type": @"" } ] } ], @"revisions": @[ @{ @"agent": @"", @"createTime": @"", @"humanReview": @{ @"state": @"", @"stateMessage": @"" }, @"id": @"", @"parent": @[ ], @"parentIds": @[ ], @"processor": @"" } ], @"shardInfo": @{ @"shardCount": @"", @"shardIndex": @"", @"textOffset": @"" }, @"text": @"", @"textChanges": @[ @{ @"changedText": @"", @"provenance": @[ @{ } ], @"textAnchor": @{ } } ], @"textStyles": @[ @{ @"backgroundColor": @{ @"alpha": @"", @"blue": @"", @"green": @"", @"red": @"" }, @"color": @{ }, @"fontFamily": @"", @"fontSize": @{ @"size": @"", @"unit": @"" }, @"fontWeight": @"", @"textAnchor": @{ }, @"textDecoration": @"", @"textStyle": @"" } ], @"uri": @"" },
@"documentSchema": @{ @"description": @"", @"displayName": @"", @"entityTypes": @[ @{ @"baseTypes": @[ ], @"displayName": @"", @"enumValues": @{ @"values": @[ ] }, @"name": @"", @"properties": @[ @{ @"name": @"", @"occurrenceType": @"", @"valueType": @"" } ] } ], @"metadata": @{ @"documentAllowMultipleLabels": @NO, @"documentSplitter": @NO, @"prefixedNamingOnProperties": @NO, @"skipNamingValidation": @NO } },
@"enableSchemaValidation": @NO,
@"inlineDocument": @{ },
@"priority": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument"]
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}}/v1beta3/:humanReviewConfig:reviewDocument" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument",
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([
'document' => [
'content' => '',
'entities' => [
[
'confidence' => '',
'id' => '',
'mentionId' => '',
'mentionText' => '',
'normalizedValue' => [
'addressValue' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'booleanValue' => null,
'dateValue' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'datetimeValue' => [
'day' => 0,
'hours' => 0,
'minutes' => 0,
'month' => 0,
'nanos' => 0,
'seconds' => 0,
'timeZone' => [
'id' => '',
'version' => ''
],
'utcOffset' => '',
'year' => 0
],
'floatValue' => '',
'integerValue' => 0,
'moneyValue' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
],
'text' => ''
],
'pageAnchor' => [
'pageRefs' => [
[
'boundingPoly' => [
'normalizedVertices' => [
[
'x' => '',
'y' => ''
]
],
'vertices' => [
[
'x' => 0,
'y' => 0
]
]
],
'confidence' => '',
'layoutId' => '',
'layoutType' => '',
'page' => ''
]
]
],
'properties' => [
],
'provenance' => [
'id' => 0,
'parents' => [
[
'id' => 0,
'index' => 0,
'revision' => 0
]
],
'revision' => 0,
'type' => ''
],
'redacted' => null,
'textAnchor' => [
'content' => '',
'textSegments' => [
[
'endIndex' => '',
'startIndex' => ''
]
]
],
'type' => ''
]
],
'entityRelations' => [
[
'objectId' => '',
'relation' => '',
'subjectId' => ''
]
],
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'mimeType' => '',
'pages' => [
[
'blocks' => [
[
'detectedLanguages' => [
[
'confidence' => '',
'languageCode' => ''
]
],
'layout' => [
'boundingPoly' => [
],
'confidence' => '',
'orientation' => '',
'textAnchor' => [
]
],
'provenance' => [
]
]
],
'detectedBarcodes' => [
[
'barcode' => [
'format' => '',
'rawValue' => '',
'valueFormat' => ''
],
'layout' => [
]
]
],
'detectedLanguages' => [
[
]
],
'dimension' => [
'height' => '',
'unit' => '',
'width' => ''
],
'formFields' => [
[
'correctedKeyText' => '',
'correctedValueText' => '',
'fieldName' => [
],
'fieldValue' => [
],
'nameDetectedLanguages' => [
[
]
],
'provenance' => [
],
'valueDetectedLanguages' => [
[
]
],
'valueType' => ''
]
],
'image' => [
'content' => '',
'height' => 0,
'mimeType' => '',
'width' => 0
],
'imageQualityScores' => [
'detectedDefects' => [
[
'confidence' => '',
'type' => ''
]
],
'qualityScore' => ''
],
'layout' => [
],
'lines' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'pageNumber' => 0,
'paragraphs' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'provenance' => [
],
'symbols' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
]
]
],
'tables' => [
[
'bodyRows' => [
[
'cells' => [
[
'colSpan' => 0,
'detectedLanguages' => [
[
]
],
'layout' => [
],
'rowSpan' => 0
]
]
]
],
'detectedLanguages' => [
[
]
],
'headerRows' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'tokens' => [
[
'detectedBreak' => [
'type' => ''
],
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'transforms' => [
[
'cols' => 0,
'data' => '',
'rows' => 0,
'type' => 0
]
],
'visualElements' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'type' => ''
]
]
]
],
'revisions' => [
[
'agent' => '',
'createTime' => '',
'humanReview' => [
'state' => '',
'stateMessage' => ''
],
'id' => '',
'parent' => [
],
'parentIds' => [
],
'processor' => ''
]
],
'shardInfo' => [
'shardCount' => '',
'shardIndex' => '',
'textOffset' => ''
],
'text' => '',
'textChanges' => [
[
'changedText' => '',
'provenance' => [
[
]
],
'textAnchor' => [
]
]
],
'textStyles' => [
[
'backgroundColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'color' => [
],
'fontFamily' => '',
'fontSize' => [
'size' => '',
'unit' => ''
],
'fontWeight' => '',
'textAnchor' => [
],
'textDecoration' => '',
'textStyle' => ''
]
],
'uri' => ''
],
'documentSchema' => [
'description' => '',
'displayName' => '',
'entityTypes' => [
[
'baseTypes' => [
],
'displayName' => '',
'enumValues' => [
'values' => [
]
],
'name' => '',
'properties' => [
[
'name' => '',
'occurrenceType' => '',
'valueType' => ''
]
]
]
],
'metadata' => [
'documentAllowMultipleLabels' => null,
'documentSplitter' => null,
'prefixedNamingOnProperties' => null,
'skipNamingValidation' => null
]
],
'enableSchemaValidation' => null,
'inlineDocument' => [
],
'priority' => ''
]),
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}}/v1beta3/:humanReviewConfig:reviewDocument', [
'body' => '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"enableSchemaValidation": false,
"inlineDocument": {},
"priority": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'document' => [
'content' => '',
'entities' => [
[
'confidence' => '',
'id' => '',
'mentionId' => '',
'mentionText' => '',
'normalizedValue' => [
'addressValue' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'booleanValue' => null,
'dateValue' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'datetimeValue' => [
'day' => 0,
'hours' => 0,
'minutes' => 0,
'month' => 0,
'nanos' => 0,
'seconds' => 0,
'timeZone' => [
'id' => '',
'version' => ''
],
'utcOffset' => '',
'year' => 0
],
'floatValue' => '',
'integerValue' => 0,
'moneyValue' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
],
'text' => ''
],
'pageAnchor' => [
'pageRefs' => [
[
'boundingPoly' => [
'normalizedVertices' => [
[
'x' => '',
'y' => ''
]
],
'vertices' => [
[
'x' => 0,
'y' => 0
]
]
],
'confidence' => '',
'layoutId' => '',
'layoutType' => '',
'page' => ''
]
]
],
'properties' => [
],
'provenance' => [
'id' => 0,
'parents' => [
[
'id' => 0,
'index' => 0,
'revision' => 0
]
],
'revision' => 0,
'type' => ''
],
'redacted' => null,
'textAnchor' => [
'content' => '',
'textSegments' => [
[
'endIndex' => '',
'startIndex' => ''
]
]
],
'type' => ''
]
],
'entityRelations' => [
[
'objectId' => '',
'relation' => '',
'subjectId' => ''
]
],
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'mimeType' => '',
'pages' => [
[
'blocks' => [
[
'detectedLanguages' => [
[
'confidence' => '',
'languageCode' => ''
]
],
'layout' => [
'boundingPoly' => [
],
'confidence' => '',
'orientation' => '',
'textAnchor' => [
]
],
'provenance' => [
]
]
],
'detectedBarcodes' => [
[
'barcode' => [
'format' => '',
'rawValue' => '',
'valueFormat' => ''
],
'layout' => [
]
]
],
'detectedLanguages' => [
[
]
],
'dimension' => [
'height' => '',
'unit' => '',
'width' => ''
],
'formFields' => [
[
'correctedKeyText' => '',
'correctedValueText' => '',
'fieldName' => [
],
'fieldValue' => [
],
'nameDetectedLanguages' => [
[
]
],
'provenance' => [
],
'valueDetectedLanguages' => [
[
]
],
'valueType' => ''
]
],
'image' => [
'content' => '',
'height' => 0,
'mimeType' => '',
'width' => 0
],
'imageQualityScores' => [
'detectedDefects' => [
[
'confidence' => '',
'type' => ''
]
],
'qualityScore' => ''
],
'layout' => [
],
'lines' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'pageNumber' => 0,
'paragraphs' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'provenance' => [
],
'symbols' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
]
]
],
'tables' => [
[
'bodyRows' => [
[
'cells' => [
[
'colSpan' => 0,
'detectedLanguages' => [
[
]
],
'layout' => [
],
'rowSpan' => 0
]
]
]
],
'detectedLanguages' => [
[
]
],
'headerRows' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'tokens' => [
[
'detectedBreak' => [
'type' => ''
],
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'transforms' => [
[
'cols' => 0,
'data' => '',
'rows' => 0,
'type' => 0
]
],
'visualElements' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'type' => ''
]
]
]
],
'revisions' => [
[
'agent' => '',
'createTime' => '',
'humanReview' => [
'state' => '',
'stateMessage' => ''
],
'id' => '',
'parent' => [
],
'parentIds' => [
],
'processor' => ''
]
],
'shardInfo' => [
'shardCount' => '',
'shardIndex' => '',
'textOffset' => ''
],
'text' => '',
'textChanges' => [
[
'changedText' => '',
'provenance' => [
[
]
],
'textAnchor' => [
]
]
],
'textStyles' => [
[
'backgroundColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'color' => [
],
'fontFamily' => '',
'fontSize' => [
'size' => '',
'unit' => ''
],
'fontWeight' => '',
'textAnchor' => [
],
'textDecoration' => '',
'textStyle' => ''
]
],
'uri' => ''
],
'documentSchema' => [
'description' => '',
'displayName' => '',
'entityTypes' => [
[
'baseTypes' => [
],
'displayName' => '',
'enumValues' => [
'values' => [
]
],
'name' => '',
'properties' => [
[
'name' => '',
'occurrenceType' => '',
'valueType' => ''
]
]
]
],
'metadata' => [
'documentAllowMultipleLabels' => null,
'documentSplitter' => null,
'prefixedNamingOnProperties' => null,
'skipNamingValidation' => null
]
],
'enableSchemaValidation' => null,
'inlineDocument' => [
],
'priority' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'document' => [
'content' => '',
'entities' => [
[
'confidence' => '',
'id' => '',
'mentionId' => '',
'mentionText' => '',
'normalizedValue' => [
'addressValue' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'booleanValue' => null,
'dateValue' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'datetimeValue' => [
'day' => 0,
'hours' => 0,
'minutes' => 0,
'month' => 0,
'nanos' => 0,
'seconds' => 0,
'timeZone' => [
'id' => '',
'version' => ''
],
'utcOffset' => '',
'year' => 0
],
'floatValue' => '',
'integerValue' => 0,
'moneyValue' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
],
'text' => ''
],
'pageAnchor' => [
'pageRefs' => [
[
'boundingPoly' => [
'normalizedVertices' => [
[
'x' => '',
'y' => ''
]
],
'vertices' => [
[
'x' => 0,
'y' => 0
]
]
],
'confidence' => '',
'layoutId' => '',
'layoutType' => '',
'page' => ''
]
]
],
'properties' => [
],
'provenance' => [
'id' => 0,
'parents' => [
[
'id' => 0,
'index' => 0,
'revision' => 0
]
],
'revision' => 0,
'type' => ''
],
'redacted' => null,
'textAnchor' => [
'content' => '',
'textSegments' => [
[
'endIndex' => '',
'startIndex' => ''
]
]
],
'type' => ''
]
],
'entityRelations' => [
[
'objectId' => '',
'relation' => '',
'subjectId' => ''
]
],
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'mimeType' => '',
'pages' => [
[
'blocks' => [
[
'detectedLanguages' => [
[
'confidence' => '',
'languageCode' => ''
]
],
'layout' => [
'boundingPoly' => [
],
'confidence' => '',
'orientation' => '',
'textAnchor' => [
]
],
'provenance' => [
]
]
],
'detectedBarcodes' => [
[
'barcode' => [
'format' => '',
'rawValue' => '',
'valueFormat' => ''
],
'layout' => [
]
]
],
'detectedLanguages' => [
[
]
],
'dimension' => [
'height' => '',
'unit' => '',
'width' => ''
],
'formFields' => [
[
'correctedKeyText' => '',
'correctedValueText' => '',
'fieldName' => [
],
'fieldValue' => [
],
'nameDetectedLanguages' => [
[
]
],
'provenance' => [
],
'valueDetectedLanguages' => [
[
]
],
'valueType' => ''
]
],
'image' => [
'content' => '',
'height' => 0,
'mimeType' => '',
'width' => 0
],
'imageQualityScores' => [
'detectedDefects' => [
[
'confidence' => '',
'type' => ''
]
],
'qualityScore' => ''
],
'layout' => [
],
'lines' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'pageNumber' => 0,
'paragraphs' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'provenance' => [
],
'symbols' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
]
]
],
'tables' => [
[
'bodyRows' => [
[
'cells' => [
[
'colSpan' => 0,
'detectedLanguages' => [
[
]
],
'layout' => [
],
'rowSpan' => 0
]
]
]
],
'detectedLanguages' => [
[
]
],
'headerRows' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'tokens' => [
[
'detectedBreak' => [
'type' => ''
],
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'transforms' => [
[
'cols' => 0,
'data' => '',
'rows' => 0,
'type' => 0
]
],
'visualElements' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'type' => ''
]
]
]
],
'revisions' => [
[
'agent' => '',
'createTime' => '',
'humanReview' => [
'state' => '',
'stateMessage' => ''
],
'id' => '',
'parent' => [
],
'parentIds' => [
],
'processor' => ''
]
],
'shardInfo' => [
'shardCount' => '',
'shardIndex' => '',
'textOffset' => ''
],
'text' => '',
'textChanges' => [
[
'changedText' => '',
'provenance' => [
[
]
],
'textAnchor' => [
]
]
],
'textStyles' => [
[
'backgroundColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'color' => [
],
'fontFamily' => '',
'fontSize' => [
'size' => '',
'unit' => ''
],
'fontWeight' => '',
'textAnchor' => [
],
'textDecoration' => '',
'textStyle' => ''
]
],
'uri' => ''
],
'documentSchema' => [
'description' => '',
'displayName' => '',
'entityTypes' => [
[
'baseTypes' => [
],
'displayName' => '',
'enumValues' => [
'values' => [
]
],
'name' => '',
'properties' => [
[
'name' => '',
'occurrenceType' => '',
'valueType' => ''
]
]
]
],
'metadata' => [
'documentAllowMultipleLabels' => null,
'documentSplitter' => null,
'prefixedNamingOnProperties' => null,
'skipNamingValidation' => null
]
],
'enableSchemaValidation' => null,
'inlineDocument' => [
],
'priority' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument');
$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}}/v1beta3/:humanReviewConfig:reviewDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"enableSchemaValidation": false,
"inlineDocument": {},
"priority": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"enableSchemaValidation": false,
"inlineDocument": {},
"priority": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta3/:humanReviewConfig:reviewDocument", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument"
payload = {
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": False,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": { "pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
] },
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": False,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [{}],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [{}],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [{}],
"provenance": {},
"valueDetectedLanguages": [{}],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [{}],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [{}],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [{}],
"layout": {}
}
],
"tables": [
{
"bodyRows": [{ "cells": [
{
"colSpan": 0,
"detectedLanguages": [{}],
"layout": {},
"rowSpan": 0
}
] }],
"detectedLanguages": [{}],
"headerRows": [{}],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": { "type": "" },
"detectedLanguages": [{}],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [{}],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [{}],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": { "values": [] },
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": False,
"documentSplitter": False,
"prefixedNamingOnProperties": False,
"skipNamingValidation": False
}
},
"enableSchemaValidation": False,
"inlineDocument": {},
"priority": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument"
payload <- "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\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}}/v1beta3/:humanReviewConfig:reviewDocument")
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 \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\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/v1beta3/:humanReviewConfig:reviewDocument') do |req|
req.body = "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"enableSchemaValidation\": false,\n \"inlineDocument\": {},\n \"priority\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument";
let payload = json!({
"document": json!({
"content": "",
"entities": (
json!({
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": json!({
"addressValue": json!({
"addressLines": (),
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": (),
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}),
"booleanValue": false,
"dateValue": json!({
"day": 0,
"month": 0,
"year": 0
}),
"datetimeValue": json!({
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": json!({
"id": "",
"version": ""
}),
"utcOffset": "",
"year": 0
}),
"floatValue": "",
"integerValue": 0,
"moneyValue": json!({
"currencyCode": "",
"nanos": 0,
"units": ""
}),
"text": ""
}),
"pageAnchor": json!({"pageRefs": (
json!({
"boundingPoly": json!({
"normalizedVertices": (
json!({
"x": "",
"y": ""
})
),
"vertices": (
json!({
"x": 0,
"y": 0
})
)
}),
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
})
)}),
"properties": (),
"provenance": json!({
"id": 0,
"parents": (
json!({
"id": 0,
"index": 0,
"revision": 0
})
),
"revision": 0,
"type": ""
}),
"redacted": false,
"textAnchor": json!({
"content": "",
"textSegments": (
json!({
"endIndex": "",
"startIndex": ""
})
)
}),
"type": ""
})
),
"entityRelations": (
json!({
"objectId": "",
"relation": "",
"subjectId": ""
})
),
"error": json!({
"code": 0,
"details": (json!({})),
"message": ""
}),
"mimeType": "",
"pages": (
json!({
"blocks": (
json!({
"detectedLanguages": (
json!({
"confidence": "",
"languageCode": ""
})
),
"layout": json!({
"boundingPoly": json!({}),
"confidence": "",
"orientation": "",
"textAnchor": json!({})
}),
"provenance": json!({})
})
),
"detectedBarcodes": (
json!({
"barcode": json!({
"format": "",
"rawValue": "",
"valueFormat": ""
}),
"layout": json!({})
})
),
"detectedLanguages": (json!({})),
"dimension": json!({
"height": "",
"unit": "",
"width": ""
}),
"formFields": (
json!({
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": json!({}),
"fieldValue": json!({}),
"nameDetectedLanguages": (json!({})),
"provenance": json!({}),
"valueDetectedLanguages": (json!({})),
"valueType": ""
})
),
"image": json!({
"content": "",
"height": 0,
"mimeType": "",
"width": 0
}),
"imageQualityScores": json!({
"detectedDefects": (
json!({
"confidence": "",
"type": ""
})
),
"qualityScore": ""
}),
"layout": json!({}),
"lines": (
json!({
"detectedLanguages": (json!({})),
"layout": json!({}),
"provenance": json!({})
})
),
"pageNumber": 0,
"paragraphs": (
json!({
"detectedLanguages": (json!({})),
"layout": json!({}),
"provenance": json!({})
})
),
"provenance": json!({}),
"symbols": (
json!({
"detectedLanguages": (json!({})),
"layout": json!({})
})
),
"tables": (
json!({
"bodyRows": (json!({"cells": (
json!({
"colSpan": 0,
"detectedLanguages": (json!({})),
"layout": json!({}),
"rowSpan": 0
})
)})),
"detectedLanguages": (json!({})),
"headerRows": (json!({})),
"layout": json!({}),
"provenance": json!({})
})
),
"tokens": (
json!({
"detectedBreak": json!({"type": ""}),
"detectedLanguages": (json!({})),
"layout": json!({}),
"provenance": json!({})
})
),
"transforms": (
json!({
"cols": 0,
"data": "",
"rows": 0,
"type": 0
})
),
"visualElements": (
json!({
"detectedLanguages": (json!({})),
"layout": json!({}),
"type": ""
})
)
})
),
"revisions": (
json!({
"agent": "",
"createTime": "",
"humanReview": json!({
"state": "",
"stateMessage": ""
}),
"id": "",
"parent": (),
"parentIds": (),
"processor": ""
})
),
"shardInfo": json!({
"shardCount": "",
"shardIndex": "",
"textOffset": ""
}),
"text": "",
"textChanges": (
json!({
"changedText": "",
"provenance": (json!({})),
"textAnchor": json!({})
})
),
"textStyles": (
json!({
"backgroundColor": json!({
"alpha": "",
"blue": "",
"green": "",
"red": ""
}),
"color": json!({}),
"fontFamily": "",
"fontSize": json!({
"size": "",
"unit": ""
}),
"fontWeight": "",
"textAnchor": json!({}),
"textDecoration": "",
"textStyle": ""
})
),
"uri": ""
}),
"documentSchema": json!({
"description": "",
"displayName": "",
"entityTypes": (
json!({
"baseTypes": (),
"displayName": "",
"enumValues": json!({"values": ()}),
"name": "",
"properties": (
json!({
"name": "",
"occurrenceType": "",
"valueType": ""
})
)
})
),
"metadata": json!({
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
})
}),
"enableSchemaValidation": false,
"inlineDocument": json!({}),
"priority": ""
});
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}}/v1beta3/:humanReviewConfig:reviewDocument \
--header 'content-type: application/json' \
--data '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"enableSchemaValidation": false,
"inlineDocument": {},
"priority": ""
}'
echo '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"enableSchemaValidation": false,
"inlineDocument": {},
"priority": ""
}' | \
http POST {{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "document": {\n "content": "",\n "entities": [\n {\n "confidence": "",\n "id": "",\n "mentionId": "",\n "mentionText": "",\n "normalizedValue": {\n "addressValue": {\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 "booleanValue": false,\n "dateValue": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "datetimeValue": {\n "day": 0,\n "hours": 0,\n "minutes": 0,\n "month": 0,\n "nanos": 0,\n "seconds": 0,\n "timeZone": {\n "id": "",\n "version": ""\n },\n "utcOffset": "",\n "year": 0\n },\n "floatValue": "",\n "integerValue": 0,\n "moneyValue": {\n "currencyCode": "",\n "nanos": 0,\n "units": ""\n },\n "text": ""\n },\n "pageAnchor": {\n "pageRefs": [\n {\n "boundingPoly": {\n "normalizedVertices": [\n {\n "x": "",\n "y": ""\n }\n ],\n "vertices": [\n {\n "x": 0,\n "y": 0\n }\n ]\n },\n "confidence": "",\n "layoutId": "",\n "layoutType": "",\n "page": ""\n }\n ]\n },\n "properties": [],\n "provenance": {\n "id": 0,\n "parents": [\n {\n "id": 0,\n "index": 0,\n "revision": 0\n }\n ],\n "revision": 0,\n "type": ""\n },\n "redacted": false,\n "textAnchor": {\n "content": "",\n "textSegments": [\n {\n "endIndex": "",\n "startIndex": ""\n }\n ]\n },\n "type": ""\n }\n ],\n "entityRelations": [\n {\n "objectId": "",\n "relation": "",\n "subjectId": ""\n }\n ],\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "mimeType": "",\n "pages": [\n {\n "blocks": [\n {\n "detectedLanguages": [\n {\n "confidence": "",\n "languageCode": ""\n }\n ],\n "layout": {\n "boundingPoly": {},\n "confidence": "",\n "orientation": "",\n "textAnchor": {}\n },\n "provenance": {}\n }\n ],\n "detectedBarcodes": [\n {\n "barcode": {\n "format": "",\n "rawValue": "",\n "valueFormat": ""\n },\n "layout": {}\n }\n ],\n "detectedLanguages": [\n {}\n ],\n "dimension": {\n "height": "",\n "unit": "",\n "width": ""\n },\n "formFields": [\n {\n "correctedKeyText": "",\n "correctedValueText": "",\n "fieldName": {},\n "fieldValue": {},\n "nameDetectedLanguages": [\n {}\n ],\n "provenance": {},\n "valueDetectedLanguages": [\n {}\n ],\n "valueType": ""\n }\n ],\n "image": {\n "content": "",\n "height": 0,\n "mimeType": "",\n "width": 0\n },\n "imageQualityScores": {\n "detectedDefects": [\n {\n "confidence": "",\n "type": ""\n }\n ],\n "qualityScore": ""\n },\n "layout": {},\n "lines": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "pageNumber": 0,\n "paragraphs": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "provenance": {},\n "symbols": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {}\n }\n ],\n "tables": [\n {\n "bodyRows": [\n {\n "cells": [\n {\n "colSpan": 0,\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "rowSpan": 0\n }\n ]\n }\n ],\n "detectedLanguages": [\n {}\n ],\n "headerRows": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "tokens": [\n {\n "detectedBreak": {\n "type": ""\n },\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "transforms": [\n {\n "cols": 0,\n "data": "",\n "rows": 0,\n "type": 0\n }\n ],\n "visualElements": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "type": ""\n }\n ]\n }\n ],\n "revisions": [\n {\n "agent": "",\n "createTime": "",\n "humanReview": {\n "state": "",\n "stateMessage": ""\n },\n "id": "",\n "parent": [],\n "parentIds": [],\n "processor": ""\n }\n ],\n "shardInfo": {\n "shardCount": "",\n "shardIndex": "",\n "textOffset": ""\n },\n "text": "",\n "textChanges": [\n {\n "changedText": "",\n "provenance": [\n {}\n ],\n "textAnchor": {}\n }\n ],\n "textStyles": [\n {\n "backgroundColor": {\n "alpha": "",\n "blue": "",\n "green": "",\n "red": ""\n },\n "color": {},\n "fontFamily": "",\n "fontSize": {\n "size": "",\n "unit": ""\n },\n "fontWeight": "",\n "textAnchor": {},\n "textDecoration": "",\n "textStyle": ""\n }\n ],\n "uri": ""\n },\n "documentSchema": {\n "description": "",\n "displayName": "",\n "entityTypes": [\n {\n "baseTypes": [],\n "displayName": "",\n "enumValues": {\n "values": []\n },\n "name": "",\n "properties": [\n {\n "name": "",\n "occurrenceType": "",\n "valueType": ""\n }\n ]\n }\n ],\n "metadata": {\n "documentAllowMultipleLabels": false,\n "documentSplitter": false,\n "prefixedNamingOnProperties": false,\n "skipNamingValidation": false\n }\n },\n "enableSchemaValidation": false,\n "inlineDocument": {},\n "priority": ""\n}' \
--output-document \
- {{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"document": [
"content": "",
"entities": [
[
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": [
"addressValue": [
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
],
"booleanValue": false,
"dateValue": [
"day": 0,
"month": 0,
"year": 0
],
"datetimeValue": [
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": [
"id": "",
"version": ""
],
"utcOffset": "",
"year": 0
],
"floatValue": "",
"integerValue": 0,
"moneyValue": [
"currencyCode": "",
"nanos": 0,
"units": ""
],
"text": ""
],
"pageAnchor": ["pageRefs": [
[
"boundingPoly": [
"normalizedVertices": [
[
"x": "",
"y": ""
]
],
"vertices": [
[
"x": 0,
"y": 0
]
]
],
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
]
]],
"properties": [],
"provenance": [
"id": 0,
"parents": [
[
"id": 0,
"index": 0,
"revision": 0
]
],
"revision": 0,
"type": ""
],
"redacted": false,
"textAnchor": [
"content": "",
"textSegments": [
[
"endIndex": "",
"startIndex": ""
]
]
],
"type": ""
]
],
"entityRelations": [
[
"objectId": "",
"relation": "",
"subjectId": ""
]
],
"error": [
"code": 0,
"details": [[]],
"message": ""
],
"mimeType": "",
"pages": [
[
"blocks": [
[
"detectedLanguages": [
[
"confidence": "",
"languageCode": ""
]
],
"layout": [
"boundingPoly": [],
"confidence": "",
"orientation": "",
"textAnchor": []
],
"provenance": []
]
],
"detectedBarcodes": [
[
"barcode": [
"format": "",
"rawValue": "",
"valueFormat": ""
],
"layout": []
]
],
"detectedLanguages": [[]],
"dimension": [
"height": "",
"unit": "",
"width": ""
],
"formFields": [
[
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": [],
"fieldValue": [],
"nameDetectedLanguages": [[]],
"provenance": [],
"valueDetectedLanguages": [[]],
"valueType": ""
]
],
"image": [
"content": "",
"height": 0,
"mimeType": "",
"width": 0
],
"imageQualityScores": [
"detectedDefects": [
[
"confidence": "",
"type": ""
]
],
"qualityScore": ""
],
"layout": [],
"lines": [
[
"detectedLanguages": [[]],
"layout": [],
"provenance": []
]
],
"pageNumber": 0,
"paragraphs": [
[
"detectedLanguages": [[]],
"layout": [],
"provenance": []
]
],
"provenance": [],
"symbols": [
[
"detectedLanguages": [[]],
"layout": []
]
],
"tables": [
[
"bodyRows": [["cells": [
[
"colSpan": 0,
"detectedLanguages": [[]],
"layout": [],
"rowSpan": 0
]
]]],
"detectedLanguages": [[]],
"headerRows": [[]],
"layout": [],
"provenance": []
]
],
"tokens": [
[
"detectedBreak": ["type": ""],
"detectedLanguages": [[]],
"layout": [],
"provenance": []
]
],
"transforms": [
[
"cols": 0,
"data": "",
"rows": 0,
"type": 0
]
],
"visualElements": [
[
"detectedLanguages": [[]],
"layout": [],
"type": ""
]
]
]
],
"revisions": [
[
"agent": "",
"createTime": "",
"humanReview": [
"state": "",
"stateMessage": ""
],
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
]
],
"shardInfo": [
"shardCount": "",
"shardIndex": "",
"textOffset": ""
],
"text": "",
"textChanges": [
[
"changedText": "",
"provenance": [[]],
"textAnchor": []
]
],
"textStyles": [
[
"backgroundColor": [
"alpha": "",
"blue": "",
"green": "",
"red": ""
],
"color": [],
"fontFamily": "",
"fontSize": [
"size": "",
"unit": ""
],
"fontWeight": "",
"textAnchor": [],
"textDecoration": "",
"textStyle": ""
]
],
"uri": ""
],
"documentSchema": [
"description": "",
"displayName": "",
"entityTypes": [
[
"baseTypes": [],
"displayName": "",
"enumValues": ["values": []],
"name": "",
"properties": [
[
"name": "",
"occurrenceType": "",
"valueType": ""
]
]
]
],
"metadata": [
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
]
],
"enableSchemaValidation": false,
"inlineDocument": [],
"priority": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:humanReviewConfig:reviewDocument")! 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
documentai.projects.locations.processors.list
{{baseUrl}}/v1beta3/:parent/processors
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:parent/processors");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta3/:parent/processors")
require "http/client"
url = "{{baseUrl}}/v1beta3/:parent/processors"
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}}/v1beta3/:parent/processors"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:parent/processors");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:parent/processors"
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/v1beta3/:parent/processors HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta3/:parent/processors")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:parent/processors"))
.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}}/v1beta3/:parent/processors")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta3/:parent/processors")
.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}}/v1beta3/:parent/processors');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1beta3/:parent/processors'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:parent/processors';
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}}/v1beta3/:parent/processors',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/processors")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/:parent/processors',
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}}/v1beta3/:parent/processors'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta3/:parent/processors');
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}}/v1beta3/:parent/processors'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:parent/processors';
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}}/v1beta3/:parent/processors"]
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}}/v1beta3/:parent/processors" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:parent/processors",
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}}/v1beta3/:parent/processors');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:parent/processors');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta3/:parent/processors');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:parent/processors' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:parent/processors' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta3/:parent/processors")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:parent/processors"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:parent/processors"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:parent/processors")
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/v1beta3/:parent/processors') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:parent/processors";
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}}/v1beta3/:parent/processors
http GET {{baseUrl}}/v1beta3/:parent/processors
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1beta3/:parent/processors
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:parent/processors")! 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
documentai.projects.locations.processors.processorVersions.batchProcess
{{baseUrl}}/v1beta3/:name:batchProcess
QUERY PARAMS
name
BODY json
{
"documentOutputConfig": {
"gcsOutputConfig": {
"fieldMask": "",
"gcsUri": "",
"shardingConfig": {
"pagesOverlap": 0,
"pagesPerShard": 0
}
}
},
"inputConfigs": [
{
"gcsSource": "",
"mimeType": ""
}
],
"inputDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"outputConfig": {
"gcsDestination": ""
},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"skipHumanReview": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:name:batchProcess");
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 \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:name:batchProcess" {:content-type :json
:form-params {:documentOutputConfig {:gcsOutputConfig {:fieldMask ""
:gcsUri ""
:shardingConfig {:pagesOverlap 0
:pagesPerShard 0}}}
:inputConfigs [{:gcsSource ""
:mimeType ""}]
:inputDocuments {:gcsDocuments {:documents [{:gcsUri ""
:mimeType ""}]}
:gcsPrefix {:gcsUriPrefix ""}}
:outputConfig {:gcsDestination ""}
:processOptions {:ocrConfig {:advancedOcrOptions []
:enableImageQualityScores false
:enableNativePdfParsing false
:enableSymbol false
:hints {:languageHints []}}}
:skipHumanReview false}})
require "http/client"
url = "{{baseUrl}}/v1beta3/:name:batchProcess"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1beta3/:name:batchProcess"),
Content = new StringContent("{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:name:batchProcess");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:name:batchProcess"
payload := strings.NewReader("{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1beta3/:name:batchProcess HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 806
{
"documentOutputConfig": {
"gcsOutputConfig": {
"fieldMask": "",
"gcsUri": "",
"shardingConfig": {
"pagesOverlap": 0,
"pagesPerShard": 0
}
}
},
"inputConfigs": [
{
"gcsSource": "",
"mimeType": ""
}
],
"inputDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"outputConfig": {
"gcsDestination": ""
},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"skipHumanReview": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:name:batchProcess")
.setHeader("content-type", "application/json")
.setBody("{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:name:batchProcess"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta3/:name:batchProcess")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:name:batchProcess")
.header("content-type", "application/json")
.body("{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}")
.asString();
const data = JSON.stringify({
documentOutputConfig: {
gcsOutputConfig: {
fieldMask: '',
gcsUri: '',
shardingConfig: {
pagesOverlap: 0,
pagesPerShard: 0
}
}
},
inputConfigs: [
{
gcsSource: '',
mimeType: ''
}
],
inputDocuments: {
gcsDocuments: {
documents: [
{
gcsUri: '',
mimeType: ''
}
]
},
gcsPrefix: {
gcsUriPrefix: ''
}
},
outputConfig: {
gcsDestination: ''
},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {
languageHints: []
}
}
},
skipHumanReview: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta3/:name:batchProcess');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:batchProcess',
headers: {'content-type': 'application/json'},
data: {
documentOutputConfig: {
gcsOutputConfig: {fieldMask: '', gcsUri: '', shardingConfig: {pagesOverlap: 0, pagesPerShard: 0}}
},
inputConfigs: [{gcsSource: '', mimeType: ''}],
inputDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
},
outputConfig: {gcsDestination: ''},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {languageHints: []}
}
},
skipHumanReview: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:name:batchProcess';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"documentOutputConfig":{"gcsOutputConfig":{"fieldMask":"","gcsUri":"","shardingConfig":{"pagesOverlap":0,"pagesPerShard":0}}},"inputConfigs":[{"gcsSource":"","mimeType":""}],"inputDocuments":{"gcsDocuments":{"documents":[{"gcsUri":"","mimeType":""}]},"gcsPrefix":{"gcsUriPrefix":""}},"outputConfig":{"gcsDestination":""},"processOptions":{"ocrConfig":{"advancedOcrOptions":[],"enableImageQualityScores":false,"enableNativePdfParsing":false,"enableSymbol":false,"hints":{"languageHints":[]}}},"skipHumanReview":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1beta3/:name:batchProcess',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "documentOutputConfig": {\n "gcsOutputConfig": {\n "fieldMask": "",\n "gcsUri": "",\n "shardingConfig": {\n "pagesOverlap": 0,\n "pagesPerShard": 0\n }\n }\n },\n "inputConfigs": [\n {\n "gcsSource": "",\n "mimeType": ""\n }\n ],\n "inputDocuments": {\n "gcsDocuments": {\n "documents": [\n {\n "gcsUri": "",\n "mimeType": ""\n }\n ]\n },\n "gcsPrefix": {\n "gcsUriPrefix": ""\n }\n },\n "outputConfig": {\n "gcsDestination": ""\n },\n "processOptions": {\n "ocrConfig": {\n "advancedOcrOptions": [],\n "enableImageQualityScores": false,\n "enableNativePdfParsing": false,\n "enableSymbol": false,\n "hints": {\n "languageHints": []\n }\n }\n },\n "skipHumanReview": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:name:batchProcess")
.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/v1beta3/:name:batchProcess',
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({
documentOutputConfig: {
gcsOutputConfig: {fieldMask: '', gcsUri: '', shardingConfig: {pagesOverlap: 0, pagesPerShard: 0}}
},
inputConfigs: [{gcsSource: '', mimeType: ''}],
inputDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
},
outputConfig: {gcsDestination: ''},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {languageHints: []}
}
},
skipHumanReview: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:batchProcess',
headers: {'content-type': 'application/json'},
body: {
documentOutputConfig: {
gcsOutputConfig: {fieldMask: '', gcsUri: '', shardingConfig: {pagesOverlap: 0, pagesPerShard: 0}}
},
inputConfigs: [{gcsSource: '', mimeType: ''}],
inputDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
},
outputConfig: {gcsDestination: ''},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {languageHints: []}
}
},
skipHumanReview: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1beta3/:name:batchProcess');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
documentOutputConfig: {
gcsOutputConfig: {
fieldMask: '',
gcsUri: '',
shardingConfig: {
pagesOverlap: 0,
pagesPerShard: 0
}
}
},
inputConfigs: [
{
gcsSource: '',
mimeType: ''
}
],
inputDocuments: {
gcsDocuments: {
documents: [
{
gcsUri: '',
mimeType: ''
}
]
},
gcsPrefix: {
gcsUriPrefix: ''
}
},
outputConfig: {
gcsDestination: ''
},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {
languageHints: []
}
}
},
skipHumanReview: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:batchProcess',
headers: {'content-type': 'application/json'},
data: {
documentOutputConfig: {
gcsOutputConfig: {fieldMask: '', gcsUri: '', shardingConfig: {pagesOverlap: 0, pagesPerShard: 0}}
},
inputConfigs: [{gcsSource: '', mimeType: ''}],
inputDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
},
outputConfig: {gcsDestination: ''},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {languageHints: []}
}
},
skipHumanReview: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:name:batchProcess';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"documentOutputConfig":{"gcsOutputConfig":{"fieldMask":"","gcsUri":"","shardingConfig":{"pagesOverlap":0,"pagesPerShard":0}}},"inputConfigs":[{"gcsSource":"","mimeType":""}],"inputDocuments":{"gcsDocuments":{"documents":[{"gcsUri":"","mimeType":""}]},"gcsPrefix":{"gcsUriPrefix":""}},"outputConfig":{"gcsDestination":""},"processOptions":{"ocrConfig":{"advancedOcrOptions":[],"enableImageQualityScores":false,"enableNativePdfParsing":false,"enableSymbol":false,"hints":{"languageHints":[]}}},"skipHumanReview":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"documentOutputConfig": @{ @"gcsOutputConfig": @{ @"fieldMask": @"", @"gcsUri": @"", @"shardingConfig": @{ @"pagesOverlap": @0, @"pagesPerShard": @0 } } },
@"inputConfigs": @[ @{ @"gcsSource": @"", @"mimeType": @"" } ],
@"inputDocuments": @{ @"gcsDocuments": @{ @"documents": @[ @{ @"gcsUri": @"", @"mimeType": @"" } ] }, @"gcsPrefix": @{ @"gcsUriPrefix": @"" } },
@"outputConfig": @{ @"gcsDestination": @"" },
@"processOptions": @{ @"ocrConfig": @{ @"advancedOcrOptions": @[ ], @"enableImageQualityScores": @NO, @"enableNativePdfParsing": @NO, @"enableSymbol": @NO, @"hints": @{ @"languageHints": @[ ] } } },
@"skipHumanReview": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta3/:name:batchProcess"]
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}}/v1beta3/:name:batchProcess" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:name:batchProcess",
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([
'documentOutputConfig' => [
'gcsOutputConfig' => [
'fieldMask' => '',
'gcsUri' => '',
'shardingConfig' => [
'pagesOverlap' => 0,
'pagesPerShard' => 0
]
]
],
'inputConfigs' => [
[
'gcsSource' => '',
'mimeType' => ''
]
],
'inputDocuments' => [
'gcsDocuments' => [
'documents' => [
[
'gcsUri' => '',
'mimeType' => ''
]
]
],
'gcsPrefix' => [
'gcsUriPrefix' => ''
]
],
'outputConfig' => [
'gcsDestination' => ''
],
'processOptions' => [
'ocrConfig' => [
'advancedOcrOptions' => [
],
'enableImageQualityScores' => null,
'enableNativePdfParsing' => null,
'enableSymbol' => null,
'hints' => [
'languageHints' => [
]
]
]
],
'skipHumanReview' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1beta3/:name:batchProcess', [
'body' => '{
"documentOutputConfig": {
"gcsOutputConfig": {
"fieldMask": "",
"gcsUri": "",
"shardingConfig": {
"pagesOverlap": 0,
"pagesPerShard": 0
}
}
},
"inputConfigs": [
{
"gcsSource": "",
"mimeType": ""
}
],
"inputDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"outputConfig": {
"gcsDestination": ""
},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"skipHumanReview": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name:batchProcess');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'documentOutputConfig' => [
'gcsOutputConfig' => [
'fieldMask' => '',
'gcsUri' => '',
'shardingConfig' => [
'pagesOverlap' => 0,
'pagesPerShard' => 0
]
]
],
'inputConfigs' => [
[
'gcsSource' => '',
'mimeType' => ''
]
],
'inputDocuments' => [
'gcsDocuments' => [
'documents' => [
[
'gcsUri' => '',
'mimeType' => ''
]
]
],
'gcsPrefix' => [
'gcsUriPrefix' => ''
]
],
'outputConfig' => [
'gcsDestination' => ''
],
'processOptions' => [
'ocrConfig' => [
'advancedOcrOptions' => [
],
'enableImageQualityScores' => null,
'enableNativePdfParsing' => null,
'enableSymbol' => null,
'hints' => [
'languageHints' => [
]
]
]
],
'skipHumanReview' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'documentOutputConfig' => [
'gcsOutputConfig' => [
'fieldMask' => '',
'gcsUri' => '',
'shardingConfig' => [
'pagesOverlap' => 0,
'pagesPerShard' => 0
]
]
],
'inputConfigs' => [
[
'gcsSource' => '',
'mimeType' => ''
]
],
'inputDocuments' => [
'gcsDocuments' => [
'documents' => [
[
'gcsUri' => '',
'mimeType' => ''
]
]
],
'gcsPrefix' => [
'gcsUriPrefix' => ''
]
],
'outputConfig' => [
'gcsDestination' => ''
],
'processOptions' => [
'ocrConfig' => [
'advancedOcrOptions' => [
],
'enableImageQualityScores' => null,
'enableNativePdfParsing' => null,
'enableSymbol' => null,
'hints' => [
'languageHints' => [
]
]
]
],
'skipHumanReview' => null
]));
$request->setRequestUrl('{{baseUrl}}/v1beta3/:name:batchProcess');
$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}}/v1beta3/:name:batchProcess' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"documentOutputConfig": {
"gcsOutputConfig": {
"fieldMask": "",
"gcsUri": "",
"shardingConfig": {
"pagesOverlap": 0,
"pagesPerShard": 0
}
}
},
"inputConfigs": [
{
"gcsSource": "",
"mimeType": ""
}
],
"inputDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"outputConfig": {
"gcsDestination": ""
},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"skipHumanReview": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name:batchProcess' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"documentOutputConfig": {
"gcsOutputConfig": {
"fieldMask": "",
"gcsUri": "",
"shardingConfig": {
"pagesOverlap": 0,
"pagesPerShard": 0
}
}
},
"inputConfigs": [
{
"gcsSource": "",
"mimeType": ""
}
],
"inputDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"outputConfig": {
"gcsDestination": ""
},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"skipHumanReview": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta3/:name:batchProcess", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name:batchProcess"
payload = {
"documentOutputConfig": { "gcsOutputConfig": {
"fieldMask": "",
"gcsUri": "",
"shardingConfig": {
"pagesOverlap": 0,
"pagesPerShard": 0
}
} },
"inputConfigs": [
{
"gcsSource": "",
"mimeType": ""
}
],
"inputDocuments": {
"gcsDocuments": { "documents": [
{
"gcsUri": "",
"mimeType": ""
}
] },
"gcsPrefix": { "gcsUriPrefix": "" }
},
"outputConfig": { "gcsDestination": "" },
"processOptions": { "ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": False,
"enableNativePdfParsing": False,
"enableSymbol": False,
"hints": { "languageHints": [] }
} },
"skipHumanReview": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name:batchProcess"
payload <- "{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:name:batchProcess")
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 \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1beta3/:name:batchProcess') do |req|
req.body = "{\n \"documentOutputConfig\": {\n \"gcsOutputConfig\": {\n \"fieldMask\": \"\",\n \"gcsUri\": \"\",\n \"shardingConfig\": {\n \"pagesOverlap\": 0,\n \"pagesPerShard\": 0\n }\n }\n },\n \"inputConfigs\": [\n {\n \"gcsSource\": \"\",\n \"mimeType\": \"\"\n }\n ],\n \"inputDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"outputConfig\": {\n \"gcsDestination\": \"\"\n },\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"skipHumanReview\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:name:batchProcess";
let payload = json!({
"documentOutputConfig": json!({"gcsOutputConfig": json!({
"fieldMask": "",
"gcsUri": "",
"shardingConfig": json!({
"pagesOverlap": 0,
"pagesPerShard": 0
})
})}),
"inputConfigs": (
json!({
"gcsSource": "",
"mimeType": ""
})
),
"inputDocuments": json!({
"gcsDocuments": json!({"documents": (
json!({
"gcsUri": "",
"mimeType": ""
})
)}),
"gcsPrefix": json!({"gcsUriPrefix": ""})
}),
"outputConfig": json!({"gcsDestination": ""}),
"processOptions": json!({"ocrConfig": json!({
"advancedOcrOptions": (),
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": json!({"languageHints": ()})
})}),
"skipHumanReview": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1beta3/:name:batchProcess \
--header 'content-type: application/json' \
--data '{
"documentOutputConfig": {
"gcsOutputConfig": {
"fieldMask": "",
"gcsUri": "",
"shardingConfig": {
"pagesOverlap": 0,
"pagesPerShard": 0
}
}
},
"inputConfigs": [
{
"gcsSource": "",
"mimeType": ""
}
],
"inputDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"outputConfig": {
"gcsDestination": ""
},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"skipHumanReview": false
}'
echo '{
"documentOutputConfig": {
"gcsOutputConfig": {
"fieldMask": "",
"gcsUri": "",
"shardingConfig": {
"pagesOverlap": 0,
"pagesPerShard": 0
}
}
},
"inputConfigs": [
{
"gcsSource": "",
"mimeType": ""
}
],
"inputDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"outputConfig": {
"gcsDestination": ""
},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"skipHumanReview": false
}' | \
http POST {{baseUrl}}/v1beta3/:name:batchProcess \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "documentOutputConfig": {\n "gcsOutputConfig": {\n "fieldMask": "",\n "gcsUri": "",\n "shardingConfig": {\n "pagesOverlap": 0,\n "pagesPerShard": 0\n }\n }\n },\n "inputConfigs": [\n {\n "gcsSource": "",\n "mimeType": ""\n }\n ],\n "inputDocuments": {\n "gcsDocuments": {\n "documents": [\n {\n "gcsUri": "",\n "mimeType": ""\n }\n ]\n },\n "gcsPrefix": {\n "gcsUriPrefix": ""\n }\n },\n "outputConfig": {\n "gcsDestination": ""\n },\n "processOptions": {\n "ocrConfig": {\n "advancedOcrOptions": [],\n "enableImageQualityScores": false,\n "enableNativePdfParsing": false,\n "enableSymbol": false,\n "hints": {\n "languageHints": []\n }\n }\n },\n "skipHumanReview": false\n}' \
--output-document \
- {{baseUrl}}/v1beta3/:name:batchProcess
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"documentOutputConfig": ["gcsOutputConfig": [
"fieldMask": "",
"gcsUri": "",
"shardingConfig": [
"pagesOverlap": 0,
"pagesPerShard": 0
]
]],
"inputConfigs": [
[
"gcsSource": "",
"mimeType": ""
]
],
"inputDocuments": [
"gcsDocuments": ["documents": [
[
"gcsUri": "",
"mimeType": ""
]
]],
"gcsPrefix": ["gcsUriPrefix": ""]
],
"outputConfig": ["gcsDestination": ""],
"processOptions": ["ocrConfig": [
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": ["languageHints": []]
]],
"skipHumanReview": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:name:batchProcess")! 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
documentai.projects.locations.processors.processorVersions.delete
{{baseUrl}}/v1beta3/: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}}/v1beta3/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1beta3/:name")
require "http/client"
url = "{{baseUrl}}/v1beta3/: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}}/v1beta3/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:name");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/: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/v1beta3/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1beta3/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/: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}}/v1beta3/:name")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1beta3/: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}}/v1beta3/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v1beta3/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/: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}}/v1beta3/:name',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/: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/v1beta3/: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}}/v1beta3/: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}}/v1beta3/: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}}/v1beta3/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/: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}}/v1beta3/: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}}/v1beta3/:name" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/: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}}/v1beta3/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta3/:name');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:name' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1beta3/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/: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/v1beta3/: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}}/v1beta3/: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}}/v1beta3/:name
http DELETE {{baseUrl}}/v1beta3/:name
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v1beta3/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/: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()
POST
documentai.projects.locations.processors.processorVersions.deploy
{{baseUrl}}/v1beta3/:name:deploy
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}}/v1beta3/:name:deploy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:name:deploy" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v1beta3/:name:deploy"
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}}/v1beta3/:name:deploy"),
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}}/v1beta3/:name:deploy");
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}}/v1beta3/:name:deploy"
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/v1beta3/:name:deploy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:name:deploy")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:name:deploy"))
.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}}/v1beta3/:name:deploy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:name:deploy")
.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}}/v1beta3/:name:deploy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:deploy',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:name:deploy';
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}}/v1beta3/:name:deploy',
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}}/v1beta3/:name:deploy")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/:name:deploy',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:deploy',
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}}/v1beta3/:name:deploy');
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}}/v1beta3/:name:deploy',
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}}/v1beta3/:name:deploy';
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}}/v1beta3/:name:deploy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1beta3/:name:deploy" 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}}/v1beta3/:name:deploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
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}}/v1beta3/:name:deploy', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name:deploy');
$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}}/v1beta3/:name:deploy');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:name:deploy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name:deploy' -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/v1beta3/:name:deploy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name:deploy"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name:deploy"
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}}/v1beta3/:name:deploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{}"
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/v1beta3/:name:deploy') 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}}/v1beta3/:name:deploy";
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}}/v1beta3/:name:deploy \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v1beta3/:name:deploy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v1beta3/:name:deploy
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}}/v1beta3/:name:deploy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
documentai.projects.locations.processors.processorVersions.evaluateProcessorVersion
{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion
QUERY PARAMS
processorVersion
BODY json
{
"evaluationDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion");
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 \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion" {:content-type :json
:form-params {:evaluationDocuments {:gcsDocuments {:documents [{:gcsUri ""
:mimeType ""}]}
:gcsPrefix {:gcsUriPrefix ""}}}})
require "http/client"
url = "{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion"),
Content = new StringContent("{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion"
payload := strings.NewReader("{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1beta3/:processorVersion:evaluateProcessorVersion HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 211
{
"evaluationDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion")
.setHeader("content-type", "application/json")
.setBody("{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion")
.header("content-type", "application/json")
.body("{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
evaluationDocuments: {
gcsDocuments: {
documents: [
{
gcsUri: '',
mimeType: ''
}
]
},
gcsPrefix: {
gcsUriPrefix: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion',
headers: {'content-type': 'application/json'},
data: {
evaluationDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"evaluationDocuments":{"gcsDocuments":{"documents":[{"gcsUri":"","mimeType":""}]},"gcsPrefix":{"gcsUriPrefix":""}}}'
};
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}}/v1beta3/:processorVersion:evaluateProcessorVersion',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "evaluationDocuments": {\n "gcsDocuments": {\n "documents": [\n {\n "gcsUri": "",\n "mimeType": ""\n }\n ]\n },\n "gcsPrefix": {\n "gcsUriPrefix": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion")
.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/v1beta3/:processorVersion:evaluateProcessorVersion',
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({
evaluationDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion',
headers: {'content-type': 'application/json'},
body: {
evaluationDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
}
},
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}}/v1beta3/:processorVersion:evaluateProcessorVersion');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
evaluationDocuments: {
gcsDocuments: {
documents: [
{
gcsUri: '',
mimeType: ''
}
]
},
gcsPrefix: {
gcsUriPrefix: ''
}
}
});
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}}/v1beta3/:processorVersion:evaluateProcessorVersion',
headers: {'content-type': 'application/json'},
data: {
evaluationDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"evaluationDocuments":{"gcsDocuments":{"documents":[{"gcsUri":"","mimeType":""}]},"gcsPrefix":{"gcsUriPrefix":""}}}'
};
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 = @{ @"evaluationDocuments": @{ @"gcsDocuments": @{ @"documents": @[ @{ @"gcsUri": @"", @"mimeType": @"" } ] }, @"gcsPrefix": @{ @"gcsUriPrefix": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion"]
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}}/v1beta3/:processorVersion:evaluateProcessorVersion" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion",
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([
'evaluationDocuments' => [
'gcsDocuments' => [
'documents' => [
[
'gcsUri' => '',
'mimeType' => ''
]
]
],
'gcsPrefix' => [
'gcsUriPrefix' => ''
]
]
]),
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}}/v1beta3/:processorVersion:evaluateProcessorVersion', [
'body' => '{
"evaluationDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'evaluationDocuments' => [
'gcsDocuments' => [
'documents' => [
[
'gcsUri' => '',
'mimeType' => ''
]
]
],
'gcsPrefix' => [
'gcsUriPrefix' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'evaluationDocuments' => [
'gcsDocuments' => [
'documents' => [
[
'gcsUri' => '',
'mimeType' => ''
]
]
],
'gcsPrefix' => [
'gcsUriPrefix' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion');
$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}}/v1beta3/:processorVersion:evaluateProcessorVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"evaluationDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"evaluationDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta3/:processorVersion:evaluateProcessorVersion", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion"
payload = { "evaluationDocuments": {
"gcsDocuments": { "documents": [
{
"gcsUri": "",
"mimeType": ""
}
] },
"gcsPrefix": { "gcsUriPrefix": "" }
} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion"
payload <- "{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion")
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 \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1beta3/:processorVersion:evaluateProcessorVersion') do |req|
req.body = "{\n \"evaluationDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion";
let payload = json!({"evaluationDocuments": json!({
"gcsDocuments": json!({"documents": (
json!({
"gcsUri": "",
"mimeType": ""
})
)}),
"gcsPrefix": json!({"gcsUriPrefix": ""})
})});
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}}/v1beta3/:processorVersion:evaluateProcessorVersion \
--header 'content-type: application/json' \
--data '{
"evaluationDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
}
}'
echo '{
"evaluationDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
}
}' | \
http POST {{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "evaluationDocuments": {\n "gcsDocuments": {\n "documents": [\n {\n "gcsUri": "",\n "mimeType": ""\n }\n ]\n },\n "gcsPrefix": {\n "gcsUriPrefix": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["evaluationDocuments": [
"gcsDocuments": ["documents": [
[
"gcsUri": "",
"mimeType": ""
]
]],
"gcsPrefix": ["gcsUriPrefix": ""]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:processorVersion:evaluateProcessorVersion")! 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
documentai.projects.locations.processors.processorVersions.evaluations.list
{{baseUrl}}/v1beta3/:parent/evaluations
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:parent/evaluations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta3/:parent/evaluations")
require "http/client"
url = "{{baseUrl}}/v1beta3/:parent/evaluations"
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}}/v1beta3/:parent/evaluations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:parent/evaluations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:parent/evaluations"
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/v1beta3/:parent/evaluations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta3/:parent/evaluations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:parent/evaluations"))
.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}}/v1beta3/:parent/evaluations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta3/:parent/evaluations")
.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}}/v1beta3/:parent/evaluations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1beta3/:parent/evaluations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:parent/evaluations';
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}}/v1beta3/:parent/evaluations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/evaluations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/:parent/evaluations',
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}}/v1beta3/:parent/evaluations'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta3/:parent/evaluations');
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}}/v1beta3/:parent/evaluations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:parent/evaluations';
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}}/v1beta3/:parent/evaluations"]
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}}/v1beta3/:parent/evaluations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:parent/evaluations",
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}}/v1beta3/:parent/evaluations');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:parent/evaluations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta3/:parent/evaluations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:parent/evaluations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:parent/evaluations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta3/:parent/evaluations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:parent/evaluations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:parent/evaluations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:parent/evaluations")
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/v1beta3/:parent/evaluations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:parent/evaluations";
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}}/v1beta3/:parent/evaluations
http GET {{baseUrl}}/v1beta3/:parent/evaluations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1beta3/:parent/evaluations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:parent/evaluations")! 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
documentai.projects.locations.processors.processorVersions.importProcessorVersion
{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion
QUERY PARAMS
parent
BODY json
{
"processorVersionSource": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion");
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 \"processorVersionSource\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion" {:content-type :json
:form-params {:processorVersionSource ""}})
require "http/client"
url = "{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"processorVersionSource\": \"\"\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}}/v1beta3/:parent/processorVersions:importProcessorVersion"),
Content = new StringContent("{\n \"processorVersionSource\": \"\"\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}}/v1beta3/:parent/processorVersions:importProcessorVersion");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"processorVersionSource\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion"
payload := strings.NewReader("{\n \"processorVersionSource\": \"\"\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/v1beta3/:parent/processorVersions:importProcessorVersion HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 34
{
"processorVersionSource": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion")
.setHeader("content-type", "application/json")
.setBody("{\n \"processorVersionSource\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"processorVersionSource\": \"\"\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 \"processorVersionSource\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion")
.header("content-type", "application/json")
.body("{\n \"processorVersionSource\": \"\"\n}")
.asString();
const data = JSON.stringify({
processorVersionSource: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion',
headers: {'content-type': 'application/json'},
data: {processorVersionSource: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"processorVersionSource":""}'
};
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}}/v1beta3/:parent/processorVersions:importProcessorVersion',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "processorVersionSource": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"processorVersionSource\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion")
.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/v1beta3/:parent/processorVersions:importProcessorVersion',
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({processorVersionSource: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion',
headers: {'content-type': 'application/json'},
body: {processorVersionSource: ''},
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}}/v1beta3/:parent/processorVersions:importProcessorVersion');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
processorVersionSource: ''
});
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}}/v1beta3/:parent/processorVersions:importProcessorVersion',
headers: {'content-type': 'application/json'},
data: {processorVersionSource: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"processorVersionSource":""}'
};
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 = @{ @"processorVersionSource": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion"]
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}}/v1beta3/:parent/processorVersions:importProcessorVersion" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"processorVersionSource\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion",
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([
'processorVersionSource' => ''
]),
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}}/v1beta3/:parent/processorVersions:importProcessorVersion', [
'body' => '{
"processorVersionSource": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'processorVersionSource' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'processorVersionSource' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion');
$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}}/v1beta3/:parent/processorVersions:importProcessorVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"processorVersionSource": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"processorVersionSource": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"processorVersionSource\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta3/:parent/processorVersions:importProcessorVersion", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion"
payload = { "processorVersionSource": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion"
payload <- "{\n \"processorVersionSource\": \"\"\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}}/v1beta3/:parent/processorVersions:importProcessorVersion")
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 \"processorVersionSource\": \"\"\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/v1beta3/:parent/processorVersions:importProcessorVersion') do |req|
req.body = "{\n \"processorVersionSource\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion";
let payload = json!({"processorVersionSource": ""});
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}}/v1beta3/:parent/processorVersions:importProcessorVersion \
--header 'content-type: application/json' \
--data '{
"processorVersionSource": ""
}'
echo '{
"processorVersionSource": ""
}' | \
http POST {{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "processorVersionSource": ""\n}' \
--output-document \
- {{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["processorVersionSource": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:parent/processorVersions:importProcessorVersion")! 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
documentai.projects.locations.processors.processorVersions.list
{{baseUrl}}/v1beta3/:parent/processorVersions
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:parent/processorVersions");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1beta3/:parent/processorVersions")
require "http/client"
url = "{{baseUrl}}/v1beta3/:parent/processorVersions"
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}}/v1beta3/:parent/processorVersions"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:parent/processorVersions");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:parent/processorVersions"
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/v1beta3/:parent/processorVersions HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1beta3/:parent/processorVersions")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:parent/processorVersions"))
.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}}/v1beta3/:parent/processorVersions")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1beta3/:parent/processorVersions")
.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}}/v1beta3/:parent/processorVersions');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1beta3/:parent/processorVersions'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:parent/processorVersions';
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}}/v1beta3/:parent/processorVersions',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/processorVersions")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/:parent/processorVersions',
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}}/v1beta3/:parent/processorVersions'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1beta3/:parent/processorVersions');
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}}/v1beta3/:parent/processorVersions'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:parent/processorVersions';
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}}/v1beta3/:parent/processorVersions"]
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}}/v1beta3/:parent/processorVersions" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:parent/processorVersions",
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}}/v1beta3/:parent/processorVersions');
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:parent/processorVersions');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1beta3/:parent/processorVersions');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:parent/processorVersions' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:parent/processorVersions' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1beta3/:parent/processorVersions")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:parent/processorVersions"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:parent/processorVersions"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:parent/processorVersions")
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/v1beta3/:parent/processorVersions') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:parent/processorVersions";
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}}/v1beta3/:parent/processorVersions
http GET {{baseUrl}}/v1beta3/:parent/processorVersions
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1beta3/:parent/processorVersions
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:parent/processorVersions")! 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
documentai.projects.locations.processors.processorVersions.process
{{baseUrl}}/v1beta3/:name:process
QUERY PARAMS
name
BODY json
{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"fieldMask": "",
"inlineDocument": {},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"rawDocument": {
"content": "",
"mimeType": ""
},
"skipHumanReview": false
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:name:process");
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 \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:name:process" {:content-type :json
:form-params {:document {:content ""
:entities [{:confidence ""
:id ""
:mentionId ""
:mentionText ""
:normalizedValue {:addressValue {:addressLines []
:administrativeArea ""
:languageCode ""
:locality ""
:organization ""
:postalCode ""
:recipients []
:regionCode ""
:revision 0
:sortingCode ""
:sublocality ""}
:booleanValue false
:dateValue {:day 0
:month 0
:year 0}
:datetimeValue {:day 0
:hours 0
:minutes 0
:month 0
:nanos 0
:seconds 0
:timeZone {:id ""
:version ""}
:utcOffset ""
:year 0}
:floatValue ""
:integerValue 0
:moneyValue {:currencyCode ""
:nanos 0
:units ""}
:text ""}
:pageAnchor {:pageRefs [{:boundingPoly {:normalizedVertices [{:x ""
:y ""}]
:vertices [{:x 0
:y 0}]}
:confidence ""
:layoutId ""
:layoutType ""
:page ""}]}
:properties []
:provenance {:id 0
:parents [{:id 0
:index 0
:revision 0}]
:revision 0
:type ""}
:redacted false
:textAnchor {:content ""
:textSegments [{:endIndex ""
:startIndex ""}]}
:type ""}]
:entityRelations [{:objectId ""
:relation ""
:subjectId ""}]
:error {:code 0
:details [{}]
:message ""}
:mimeType ""
:pages [{:blocks [{:detectedLanguages [{:confidence ""
:languageCode ""}]
:layout {:boundingPoly {}
:confidence ""
:orientation ""
:textAnchor {}}
:provenance {}}]
:detectedBarcodes [{:barcode {:format ""
:rawValue ""
:valueFormat ""}
:layout {}}]
:detectedLanguages [{}]
:dimension {:height ""
:unit ""
:width ""}
:formFields [{:correctedKeyText ""
:correctedValueText ""
:fieldName {}
:fieldValue {}
:nameDetectedLanguages [{}]
:provenance {}
:valueDetectedLanguages [{}]
:valueType ""}]
:image {:content ""
:height 0
:mimeType ""
:width 0}
:imageQualityScores {:detectedDefects [{:confidence ""
:type ""}]
:qualityScore ""}
:layout {}
:lines [{:detectedLanguages [{}]
:layout {}
:provenance {}}]
:pageNumber 0
:paragraphs [{:detectedLanguages [{}]
:layout {}
:provenance {}}]
:provenance {}
:symbols [{:detectedLanguages [{}]
:layout {}}]
:tables [{:bodyRows [{:cells [{:colSpan 0
:detectedLanguages [{}]
:layout {}
:rowSpan 0}]}]
:detectedLanguages [{}]
:headerRows [{}]
:layout {}
:provenance {}}]
:tokens [{:detectedBreak {:type ""}
:detectedLanguages [{}]
:layout {}
:provenance {}}]
:transforms [{:cols 0
:data ""
:rows 0
:type 0}]
:visualElements [{:detectedLanguages [{}]
:layout {}
:type ""}]}]
:revisions [{:agent ""
:createTime ""
:humanReview {:state ""
:stateMessage ""}
:id ""
:parent []
:parentIds []
:processor ""}]
:shardInfo {:shardCount ""
:shardIndex ""
:textOffset ""}
:text ""
:textChanges [{:changedText ""
:provenance [{}]
:textAnchor {}}]
:textStyles [{:backgroundColor {:alpha ""
:blue ""
:green ""
:red ""}
:color {}
:fontFamily ""
:fontSize {:size ""
:unit ""}
:fontWeight ""
:textAnchor {}
:textDecoration ""
:textStyle ""}]
:uri ""}
:fieldMask ""
:inlineDocument {}
:processOptions {:ocrConfig {:advancedOcrOptions []
:enableImageQualityScores false
:enableNativePdfParsing false
:enableSymbol false
:hints {:languageHints []}}}
:rawDocument {:content ""
:mimeType ""}
:skipHumanReview false}})
require "http/client"
url = "{{baseUrl}}/v1beta3/:name:process"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1beta3/:name:process"),
Content = new StringContent("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1beta3/:name:process");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:name:process"
payload := strings.NewReader("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1beta3/:name:process HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 7170
{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"fieldMask": "",
"inlineDocument": {},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"rawDocument": {
"content": "",
"mimeType": ""
},
"skipHumanReview": false
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:name:process")
.setHeader("content-type", "application/json")
.setBody("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:name:process"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta3/:name:process")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:name:process")
.header("content-type", "application/json")
.body("{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}")
.asString();
const data = JSON.stringify({
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {
day: 0,
month: 0,
year: 0
},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {
id: '',
version: ''
},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {
currencyCode: '',
nanos: 0,
units: ''
},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {
normalizedVertices: [
{
x: '',
y: ''
}
],
vertices: [
{
x: 0,
y: 0
}
]
},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {
id: 0,
parents: [
{
id: 0,
index: 0,
revision: 0
}
],
revision: 0,
type: ''
},
redacted: false,
textAnchor: {
content: '',
textSegments: [
{
endIndex: '',
startIndex: ''
}
]
},
type: ''
}
],
entityRelations: [
{
objectId: '',
relation: '',
subjectId: ''
}
],
error: {
code: 0,
details: [
{}
],
message: ''
},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [
{
confidence: '',
languageCode: ''
}
],
layout: {
boundingPoly: {},
confidence: '',
orientation: '',
textAnchor: {}
},
provenance: {}
}
],
detectedBarcodes: [
{
barcode: {
format: '',
rawValue: '',
valueFormat: ''
},
layout: {}
}
],
detectedLanguages: [
{}
],
dimension: {
height: '',
unit: '',
width: ''
},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [
{}
],
provenance: {},
valueDetectedLanguages: [
{}
],
valueType: ''
}
],
image: {
content: '',
height: 0,
mimeType: '',
width: 0
},
imageQualityScores: {
detectedDefects: [
{
confidence: '',
type: ''
}
],
qualityScore: ''
},
layout: {},
lines: [
{
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
pageNumber: 0,
paragraphs: [
{
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
provenance: {},
symbols: [
{
detectedLanguages: [
{}
],
layout: {}
}
],
tables: [
{
bodyRows: [
{
cells: [
{
colSpan: 0,
detectedLanguages: [
{}
],
layout: {},
rowSpan: 0
}
]
}
],
detectedLanguages: [
{}
],
headerRows: [
{}
],
layout: {},
provenance: {}
}
],
tokens: [
{
detectedBreak: {
type: ''
},
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
transforms: [
{
cols: 0,
data: '',
rows: 0,
type: 0
}
],
visualElements: [
{
detectedLanguages: [
{}
],
layout: {},
type: ''
}
]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {
state: '',
stateMessage: ''
},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {
shardCount: '',
shardIndex: '',
textOffset: ''
},
text: '',
textChanges: [
{
changedText: '',
provenance: [
{}
],
textAnchor: {}
}
],
textStyles: [
{
backgroundColor: {
alpha: '',
blue: '',
green: '',
red: ''
},
color: {},
fontFamily: '',
fontSize: {
size: '',
unit: ''
},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
fieldMask: '',
inlineDocument: {},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {
languageHints: []
}
}
},
rawDocument: {
content: '',
mimeType: ''
},
skipHumanReview: false
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta3/:name:process');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:process',
headers: {'content-type': 'application/json'},
data: {
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {day: 0, month: 0, year: 0},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {currencyCode: '', nanos: 0, units: ''},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {normalizedVertices: [{x: '', y: ''}], vertices: [{x: 0, y: 0}]},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {id: 0, parents: [{id: 0, index: 0, revision: 0}], revision: 0, type: ''},
redacted: false,
textAnchor: {content: '', textSegments: [{endIndex: '', startIndex: ''}]},
type: ''
}
],
entityRelations: [{objectId: '', relation: '', subjectId: ''}],
error: {code: 0, details: [{}], message: ''},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [{confidence: '', languageCode: ''}],
layout: {boundingPoly: {}, confidence: '', orientation: '', textAnchor: {}},
provenance: {}
}
],
detectedBarcodes: [{barcode: {format: '', rawValue: '', valueFormat: ''}, layout: {}}],
detectedLanguages: [{}],
dimension: {height: '', unit: '', width: ''},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [{}],
provenance: {},
valueDetectedLanguages: [{}],
valueType: ''
}
],
image: {content: '', height: 0, mimeType: '', width: 0},
imageQualityScores: {detectedDefects: [{confidence: '', type: ''}], qualityScore: ''},
layout: {},
lines: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
pageNumber: 0,
paragraphs: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
provenance: {},
symbols: [{detectedLanguages: [{}], layout: {}}],
tables: [
{
bodyRows: [{cells: [{colSpan: 0, detectedLanguages: [{}], layout: {}, rowSpan: 0}]}],
detectedLanguages: [{}],
headerRows: [{}],
layout: {},
provenance: {}
}
],
tokens: [
{detectedBreak: {type: ''}, detectedLanguages: [{}], layout: {}, provenance: {}}
],
transforms: [{cols: 0, data: '', rows: 0, type: 0}],
visualElements: [{detectedLanguages: [{}], layout: {}, type: ''}]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {state: '', stateMessage: ''},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {shardCount: '', shardIndex: '', textOffset: ''},
text: '',
textChanges: [{changedText: '', provenance: [{}], textAnchor: {}}],
textStyles: [
{
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
color: {},
fontFamily: '',
fontSize: {size: '', unit: ''},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
fieldMask: '',
inlineDocument: {},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {languageHints: []}
}
},
rawDocument: {content: '', mimeType: ''},
skipHumanReview: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:name:process';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"document":{"content":"","entities":[{"confidence":"","id":"","mentionId":"","mentionText":"","normalizedValue":{"addressValue":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"booleanValue":false,"dateValue":{"day":0,"month":0,"year":0},"datetimeValue":{"day":0,"hours":0,"minutes":0,"month":0,"nanos":0,"seconds":0,"timeZone":{"id":"","version":""},"utcOffset":"","year":0},"floatValue":"","integerValue":0,"moneyValue":{"currencyCode":"","nanos":0,"units":""},"text":""},"pageAnchor":{"pageRefs":[{"boundingPoly":{"normalizedVertices":[{"x":"","y":""}],"vertices":[{"x":0,"y":0}]},"confidence":"","layoutId":"","layoutType":"","page":""}]},"properties":[],"provenance":{"id":0,"parents":[{"id":0,"index":0,"revision":0}],"revision":0,"type":""},"redacted":false,"textAnchor":{"content":"","textSegments":[{"endIndex":"","startIndex":""}]},"type":""}],"entityRelations":[{"objectId":"","relation":"","subjectId":""}],"error":{"code":0,"details":[{}],"message":""},"mimeType":"","pages":[{"blocks":[{"detectedLanguages":[{"confidence":"","languageCode":""}],"layout":{"boundingPoly":{},"confidence":"","orientation":"","textAnchor":{}},"provenance":{}}],"detectedBarcodes":[{"barcode":{"format":"","rawValue":"","valueFormat":""},"layout":{}}],"detectedLanguages":[{}],"dimension":{"height":"","unit":"","width":""},"formFields":[{"correctedKeyText":"","correctedValueText":"","fieldName":{},"fieldValue":{},"nameDetectedLanguages":[{}],"provenance":{},"valueDetectedLanguages":[{}],"valueType":""}],"image":{"content":"","height":0,"mimeType":"","width":0},"imageQualityScores":{"detectedDefects":[{"confidence":"","type":""}],"qualityScore":""},"layout":{},"lines":[{"detectedLanguages":[{}],"layout":{},"provenance":{}}],"pageNumber":0,"paragraphs":[{"detectedLanguages":[{}],"layout":{},"provenance":{}}],"provenance":{},"symbols":[{"detectedLanguages":[{}],"layout":{}}],"tables":[{"bodyRows":[{"cells":[{"colSpan":0,"detectedLanguages":[{}],"layout":{},"rowSpan":0}]}],"detectedLanguages":[{}],"headerRows":[{}],"layout":{},"provenance":{}}],"tokens":[{"detectedBreak":{"type":""},"detectedLanguages":[{}],"layout":{},"provenance":{}}],"transforms":[{"cols":0,"data":"","rows":0,"type":0}],"visualElements":[{"detectedLanguages":[{}],"layout":{},"type":""}]}],"revisions":[{"agent":"","createTime":"","humanReview":{"state":"","stateMessage":""},"id":"","parent":[],"parentIds":[],"processor":""}],"shardInfo":{"shardCount":"","shardIndex":"","textOffset":""},"text":"","textChanges":[{"changedText":"","provenance":[{}],"textAnchor":{}}],"textStyles":[{"backgroundColor":{"alpha":"","blue":"","green":"","red":""},"color":{},"fontFamily":"","fontSize":{"size":"","unit":""},"fontWeight":"","textAnchor":{},"textDecoration":"","textStyle":""}],"uri":""},"fieldMask":"","inlineDocument":{},"processOptions":{"ocrConfig":{"advancedOcrOptions":[],"enableImageQualityScores":false,"enableNativePdfParsing":false,"enableSymbol":false,"hints":{"languageHints":[]}}},"rawDocument":{"content":"","mimeType":""},"skipHumanReview":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1beta3/:name:process',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "document": {\n "content": "",\n "entities": [\n {\n "confidence": "",\n "id": "",\n "mentionId": "",\n "mentionText": "",\n "normalizedValue": {\n "addressValue": {\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 "booleanValue": false,\n "dateValue": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "datetimeValue": {\n "day": 0,\n "hours": 0,\n "minutes": 0,\n "month": 0,\n "nanos": 0,\n "seconds": 0,\n "timeZone": {\n "id": "",\n "version": ""\n },\n "utcOffset": "",\n "year": 0\n },\n "floatValue": "",\n "integerValue": 0,\n "moneyValue": {\n "currencyCode": "",\n "nanos": 0,\n "units": ""\n },\n "text": ""\n },\n "pageAnchor": {\n "pageRefs": [\n {\n "boundingPoly": {\n "normalizedVertices": [\n {\n "x": "",\n "y": ""\n }\n ],\n "vertices": [\n {\n "x": 0,\n "y": 0\n }\n ]\n },\n "confidence": "",\n "layoutId": "",\n "layoutType": "",\n "page": ""\n }\n ]\n },\n "properties": [],\n "provenance": {\n "id": 0,\n "parents": [\n {\n "id": 0,\n "index": 0,\n "revision": 0\n }\n ],\n "revision": 0,\n "type": ""\n },\n "redacted": false,\n "textAnchor": {\n "content": "",\n "textSegments": [\n {\n "endIndex": "",\n "startIndex": ""\n }\n ]\n },\n "type": ""\n }\n ],\n "entityRelations": [\n {\n "objectId": "",\n "relation": "",\n "subjectId": ""\n }\n ],\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "mimeType": "",\n "pages": [\n {\n "blocks": [\n {\n "detectedLanguages": [\n {\n "confidence": "",\n "languageCode": ""\n }\n ],\n "layout": {\n "boundingPoly": {},\n "confidence": "",\n "orientation": "",\n "textAnchor": {}\n },\n "provenance": {}\n }\n ],\n "detectedBarcodes": [\n {\n "barcode": {\n "format": "",\n "rawValue": "",\n "valueFormat": ""\n },\n "layout": {}\n }\n ],\n "detectedLanguages": [\n {}\n ],\n "dimension": {\n "height": "",\n "unit": "",\n "width": ""\n },\n "formFields": [\n {\n "correctedKeyText": "",\n "correctedValueText": "",\n "fieldName": {},\n "fieldValue": {},\n "nameDetectedLanguages": [\n {}\n ],\n "provenance": {},\n "valueDetectedLanguages": [\n {}\n ],\n "valueType": ""\n }\n ],\n "image": {\n "content": "",\n "height": 0,\n "mimeType": "",\n "width": 0\n },\n "imageQualityScores": {\n "detectedDefects": [\n {\n "confidence": "",\n "type": ""\n }\n ],\n "qualityScore": ""\n },\n "layout": {},\n "lines": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "pageNumber": 0,\n "paragraphs": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "provenance": {},\n "symbols": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {}\n }\n ],\n "tables": [\n {\n "bodyRows": [\n {\n "cells": [\n {\n "colSpan": 0,\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "rowSpan": 0\n }\n ]\n }\n ],\n "detectedLanguages": [\n {}\n ],\n "headerRows": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "tokens": [\n {\n "detectedBreak": {\n "type": ""\n },\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "transforms": [\n {\n "cols": 0,\n "data": "",\n "rows": 0,\n "type": 0\n }\n ],\n "visualElements": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "type": ""\n }\n ]\n }\n ],\n "revisions": [\n {\n "agent": "",\n "createTime": "",\n "humanReview": {\n "state": "",\n "stateMessage": ""\n },\n "id": "",\n "parent": [],\n "parentIds": [],\n "processor": ""\n }\n ],\n "shardInfo": {\n "shardCount": "",\n "shardIndex": "",\n "textOffset": ""\n },\n "text": "",\n "textChanges": [\n {\n "changedText": "",\n "provenance": [\n {}\n ],\n "textAnchor": {}\n }\n ],\n "textStyles": [\n {\n "backgroundColor": {\n "alpha": "",\n "blue": "",\n "green": "",\n "red": ""\n },\n "color": {},\n "fontFamily": "",\n "fontSize": {\n "size": "",\n "unit": ""\n },\n "fontWeight": "",\n "textAnchor": {},\n "textDecoration": "",\n "textStyle": ""\n }\n ],\n "uri": ""\n },\n "fieldMask": "",\n "inlineDocument": {},\n "processOptions": {\n "ocrConfig": {\n "advancedOcrOptions": [],\n "enableImageQualityScores": false,\n "enableNativePdfParsing": false,\n "enableSymbol": false,\n "hints": {\n "languageHints": []\n }\n }\n },\n "rawDocument": {\n "content": "",\n "mimeType": ""\n },\n "skipHumanReview": false\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:name:process")
.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/v1beta3/:name:process',
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({
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {day: 0, month: 0, year: 0},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {currencyCode: '', nanos: 0, units: ''},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {normalizedVertices: [{x: '', y: ''}], vertices: [{x: 0, y: 0}]},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {id: 0, parents: [{id: 0, index: 0, revision: 0}], revision: 0, type: ''},
redacted: false,
textAnchor: {content: '', textSegments: [{endIndex: '', startIndex: ''}]},
type: ''
}
],
entityRelations: [{objectId: '', relation: '', subjectId: ''}],
error: {code: 0, details: [{}], message: ''},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [{confidence: '', languageCode: ''}],
layout: {boundingPoly: {}, confidence: '', orientation: '', textAnchor: {}},
provenance: {}
}
],
detectedBarcodes: [{barcode: {format: '', rawValue: '', valueFormat: ''}, layout: {}}],
detectedLanguages: [{}],
dimension: {height: '', unit: '', width: ''},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [{}],
provenance: {},
valueDetectedLanguages: [{}],
valueType: ''
}
],
image: {content: '', height: 0, mimeType: '', width: 0},
imageQualityScores: {detectedDefects: [{confidence: '', type: ''}], qualityScore: ''},
layout: {},
lines: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
pageNumber: 0,
paragraphs: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
provenance: {},
symbols: [{detectedLanguages: [{}], layout: {}}],
tables: [
{
bodyRows: [{cells: [{colSpan: 0, detectedLanguages: [{}], layout: {}, rowSpan: 0}]}],
detectedLanguages: [{}],
headerRows: [{}],
layout: {},
provenance: {}
}
],
tokens: [
{detectedBreak: {type: ''}, detectedLanguages: [{}], layout: {}, provenance: {}}
],
transforms: [{cols: 0, data: '', rows: 0, type: 0}],
visualElements: [{detectedLanguages: [{}], layout: {}, type: ''}]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {state: '', stateMessage: ''},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {shardCount: '', shardIndex: '', textOffset: ''},
text: '',
textChanges: [{changedText: '', provenance: [{}], textAnchor: {}}],
textStyles: [
{
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
color: {},
fontFamily: '',
fontSize: {size: '', unit: ''},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
fieldMask: '',
inlineDocument: {},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {languageHints: []}
}
},
rawDocument: {content: '', mimeType: ''},
skipHumanReview: false
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:process',
headers: {'content-type': 'application/json'},
body: {
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {day: 0, month: 0, year: 0},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {currencyCode: '', nanos: 0, units: ''},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {normalizedVertices: [{x: '', y: ''}], vertices: [{x: 0, y: 0}]},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {id: 0, parents: [{id: 0, index: 0, revision: 0}], revision: 0, type: ''},
redacted: false,
textAnchor: {content: '', textSegments: [{endIndex: '', startIndex: ''}]},
type: ''
}
],
entityRelations: [{objectId: '', relation: '', subjectId: ''}],
error: {code: 0, details: [{}], message: ''},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [{confidence: '', languageCode: ''}],
layout: {boundingPoly: {}, confidence: '', orientation: '', textAnchor: {}},
provenance: {}
}
],
detectedBarcodes: [{barcode: {format: '', rawValue: '', valueFormat: ''}, layout: {}}],
detectedLanguages: [{}],
dimension: {height: '', unit: '', width: ''},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [{}],
provenance: {},
valueDetectedLanguages: [{}],
valueType: ''
}
],
image: {content: '', height: 0, mimeType: '', width: 0},
imageQualityScores: {detectedDefects: [{confidence: '', type: ''}], qualityScore: ''},
layout: {},
lines: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
pageNumber: 0,
paragraphs: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
provenance: {},
symbols: [{detectedLanguages: [{}], layout: {}}],
tables: [
{
bodyRows: [{cells: [{colSpan: 0, detectedLanguages: [{}], layout: {}, rowSpan: 0}]}],
detectedLanguages: [{}],
headerRows: [{}],
layout: {},
provenance: {}
}
],
tokens: [
{detectedBreak: {type: ''}, detectedLanguages: [{}], layout: {}, provenance: {}}
],
transforms: [{cols: 0, data: '', rows: 0, type: 0}],
visualElements: [{detectedLanguages: [{}], layout: {}, type: ''}]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {state: '', stateMessage: ''},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {shardCount: '', shardIndex: '', textOffset: ''},
text: '',
textChanges: [{changedText: '', provenance: [{}], textAnchor: {}}],
textStyles: [
{
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
color: {},
fontFamily: '',
fontSize: {size: '', unit: ''},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
fieldMask: '',
inlineDocument: {},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {languageHints: []}
}
},
rawDocument: {content: '', mimeType: ''},
skipHumanReview: false
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1beta3/:name:process');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {
day: 0,
month: 0,
year: 0
},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {
id: '',
version: ''
},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {
currencyCode: '',
nanos: 0,
units: ''
},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {
normalizedVertices: [
{
x: '',
y: ''
}
],
vertices: [
{
x: 0,
y: 0
}
]
},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {
id: 0,
parents: [
{
id: 0,
index: 0,
revision: 0
}
],
revision: 0,
type: ''
},
redacted: false,
textAnchor: {
content: '',
textSegments: [
{
endIndex: '',
startIndex: ''
}
]
},
type: ''
}
],
entityRelations: [
{
objectId: '',
relation: '',
subjectId: ''
}
],
error: {
code: 0,
details: [
{}
],
message: ''
},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [
{
confidence: '',
languageCode: ''
}
],
layout: {
boundingPoly: {},
confidence: '',
orientation: '',
textAnchor: {}
},
provenance: {}
}
],
detectedBarcodes: [
{
barcode: {
format: '',
rawValue: '',
valueFormat: ''
},
layout: {}
}
],
detectedLanguages: [
{}
],
dimension: {
height: '',
unit: '',
width: ''
},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [
{}
],
provenance: {},
valueDetectedLanguages: [
{}
],
valueType: ''
}
],
image: {
content: '',
height: 0,
mimeType: '',
width: 0
},
imageQualityScores: {
detectedDefects: [
{
confidence: '',
type: ''
}
],
qualityScore: ''
},
layout: {},
lines: [
{
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
pageNumber: 0,
paragraphs: [
{
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
provenance: {},
symbols: [
{
detectedLanguages: [
{}
],
layout: {}
}
],
tables: [
{
bodyRows: [
{
cells: [
{
colSpan: 0,
detectedLanguages: [
{}
],
layout: {},
rowSpan: 0
}
]
}
],
detectedLanguages: [
{}
],
headerRows: [
{}
],
layout: {},
provenance: {}
}
],
tokens: [
{
detectedBreak: {
type: ''
},
detectedLanguages: [
{}
],
layout: {},
provenance: {}
}
],
transforms: [
{
cols: 0,
data: '',
rows: 0,
type: 0
}
],
visualElements: [
{
detectedLanguages: [
{}
],
layout: {},
type: ''
}
]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {
state: '',
stateMessage: ''
},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {
shardCount: '',
shardIndex: '',
textOffset: ''
},
text: '',
textChanges: [
{
changedText: '',
provenance: [
{}
],
textAnchor: {}
}
],
textStyles: [
{
backgroundColor: {
alpha: '',
blue: '',
green: '',
red: ''
},
color: {},
fontFamily: '',
fontSize: {
size: '',
unit: ''
},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
fieldMask: '',
inlineDocument: {},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {
languageHints: []
}
}
},
rawDocument: {
content: '',
mimeType: ''
},
skipHumanReview: false
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:process',
headers: {'content-type': 'application/json'},
data: {
document: {
content: '',
entities: [
{
confidence: '',
id: '',
mentionId: '',
mentionText: '',
normalizedValue: {
addressValue: {
addressLines: [],
administrativeArea: '',
languageCode: '',
locality: '',
organization: '',
postalCode: '',
recipients: [],
regionCode: '',
revision: 0,
sortingCode: '',
sublocality: ''
},
booleanValue: false,
dateValue: {day: 0, month: 0, year: 0},
datetimeValue: {
day: 0,
hours: 0,
minutes: 0,
month: 0,
nanos: 0,
seconds: 0,
timeZone: {id: '', version: ''},
utcOffset: '',
year: 0
},
floatValue: '',
integerValue: 0,
moneyValue: {currencyCode: '', nanos: 0, units: ''},
text: ''
},
pageAnchor: {
pageRefs: [
{
boundingPoly: {normalizedVertices: [{x: '', y: ''}], vertices: [{x: 0, y: 0}]},
confidence: '',
layoutId: '',
layoutType: '',
page: ''
}
]
},
properties: [],
provenance: {id: 0, parents: [{id: 0, index: 0, revision: 0}], revision: 0, type: ''},
redacted: false,
textAnchor: {content: '', textSegments: [{endIndex: '', startIndex: ''}]},
type: ''
}
],
entityRelations: [{objectId: '', relation: '', subjectId: ''}],
error: {code: 0, details: [{}], message: ''},
mimeType: '',
pages: [
{
blocks: [
{
detectedLanguages: [{confidence: '', languageCode: ''}],
layout: {boundingPoly: {}, confidence: '', orientation: '', textAnchor: {}},
provenance: {}
}
],
detectedBarcodes: [{barcode: {format: '', rawValue: '', valueFormat: ''}, layout: {}}],
detectedLanguages: [{}],
dimension: {height: '', unit: '', width: ''},
formFields: [
{
correctedKeyText: '',
correctedValueText: '',
fieldName: {},
fieldValue: {},
nameDetectedLanguages: [{}],
provenance: {},
valueDetectedLanguages: [{}],
valueType: ''
}
],
image: {content: '', height: 0, mimeType: '', width: 0},
imageQualityScores: {detectedDefects: [{confidence: '', type: ''}], qualityScore: ''},
layout: {},
lines: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
pageNumber: 0,
paragraphs: [{detectedLanguages: [{}], layout: {}, provenance: {}}],
provenance: {},
symbols: [{detectedLanguages: [{}], layout: {}}],
tables: [
{
bodyRows: [{cells: [{colSpan: 0, detectedLanguages: [{}], layout: {}, rowSpan: 0}]}],
detectedLanguages: [{}],
headerRows: [{}],
layout: {},
provenance: {}
}
],
tokens: [
{detectedBreak: {type: ''}, detectedLanguages: [{}], layout: {}, provenance: {}}
],
transforms: [{cols: 0, data: '', rows: 0, type: 0}],
visualElements: [{detectedLanguages: [{}], layout: {}, type: ''}]
}
],
revisions: [
{
agent: '',
createTime: '',
humanReview: {state: '', stateMessage: ''},
id: '',
parent: [],
parentIds: [],
processor: ''
}
],
shardInfo: {shardCount: '', shardIndex: '', textOffset: ''},
text: '',
textChanges: [{changedText: '', provenance: [{}], textAnchor: {}}],
textStyles: [
{
backgroundColor: {alpha: '', blue: '', green: '', red: ''},
color: {},
fontFamily: '',
fontSize: {size: '', unit: ''},
fontWeight: '',
textAnchor: {},
textDecoration: '',
textStyle: ''
}
],
uri: ''
},
fieldMask: '',
inlineDocument: {},
processOptions: {
ocrConfig: {
advancedOcrOptions: [],
enableImageQualityScores: false,
enableNativePdfParsing: false,
enableSymbol: false,
hints: {languageHints: []}
}
},
rawDocument: {content: '', mimeType: ''},
skipHumanReview: false
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:name:process';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"document":{"content":"","entities":[{"confidence":"","id":"","mentionId":"","mentionText":"","normalizedValue":{"addressValue":{"addressLines":[],"administrativeArea":"","languageCode":"","locality":"","organization":"","postalCode":"","recipients":[],"regionCode":"","revision":0,"sortingCode":"","sublocality":""},"booleanValue":false,"dateValue":{"day":0,"month":0,"year":0},"datetimeValue":{"day":0,"hours":0,"minutes":0,"month":0,"nanos":0,"seconds":0,"timeZone":{"id":"","version":""},"utcOffset":"","year":0},"floatValue":"","integerValue":0,"moneyValue":{"currencyCode":"","nanos":0,"units":""},"text":""},"pageAnchor":{"pageRefs":[{"boundingPoly":{"normalizedVertices":[{"x":"","y":""}],"vertices":[{"x":0,"y":0}]},"confidence":"","layoutId":"","layoutType":"","page":""}]},"properties":[],"provenance":{"id":0,"parents":[{"id":0,"index":0,"revision":0}],"revision":0,"type":""},"redacted":false,"textAnchor":{"content":"","textSegments":[{"endIndex":"","startIndex":""}]},"type":""}],"entityRelations":[{"objectId":"","relation":"","subjectId":""}],"error":{"code":0,"details":[{}],"message":""},"mimeType":"","pages":[{"blocks":[{"detectedLanguages":[{"confidence":"","languageCode":""}],"layout":{"boundingPoly":{},"confidence":"","orientation":"","textAnchor":{}},"provenance":{}}],"detectedBarcodes":[{"barcode":{"format":"","rawValue":"","valueFormat":""},"layout":{}}],"detectedLanguages":[{}],"dimension":{"height":"","unit":"","width":""},"formFields":[{"correctedKeyText":"","correctedValueText":"","fieldName":{},"fieldValue":{},"nameDetectedLanguages":[{}],"provenance":{},"valueDetectedLanguages":[{}],"valueType":""}],"image":{"content":"","height":0,"mimeType":"","width":0},"imageQualityScores":{"detectedDefects":[{"confidence":"","type":""}],"qualityScore":""},"layout":{},"lines":[{"detectedLanguages":[{}],"layout":{},"provenance":{}}],"pageNumber":0,"paragraphs":[{"detectedLanguages":[{}],"layout":{},"provenance":{}}],"provenance":{},"symbols":[{"detectedLanguages":[{}],"layout":{}}],"tables":[{"bodyRows":[{"cells":[{"colSpan":0,"detectedLanguages":[{}],"layout":{},"rowSpan":0}]}],"detectedLanguages":[{}],"headerRows":[{}],"layout":{},"provenance":{}}],"tokens":[{"detectedBreak":{"type":""},"detectedLanguages":[{}],"layout":{},"provenance":{}}],"transforms":[{"cols":0,"data":"","rows":0,"type":0}],"visualElements":[{"detectedLanguages":[{}],"layout":{},"type":""}]}],"revisions":[{"agent":"","createTime":"","humanReview":{"state":"","stateMessage":""},"id":"","parent":[],"parentIds":[],"processor":""}],"shardInfo":{"shardCount":"","shardIndex":"","textOffset":""},"text":"","textChanges":[{"changedText":"","provenance":[{}],"textAnchor":{}}],"textStyles":[{"backgroundColor":{"alpha":"","blue":"","green":"","red":""},"color":{},"fontFamily":"","fontSize":{"size":"","unit":""},"fontWeight":"","textAnchor":{},"textDecoration":"","textStyle":""}],"uri":""},"fieldMask":"","inlineDocument":{},"processOptions":{"ocrConfig":{"advancedOcrOptions":[],"enableImageQualityScores":false,"enableNativePdfParsing":false,"enableSymbol":false,"hints":{"languageHints":[]}}},"rawDocument":{"content":"","mimeType":""},"skipHumanReview":false}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"document": @{ @"content": @"", @"entities": @[ @{ @"confidence": @"", @"id": @"", @"mentionId": @"", @"mentionText": @"", @"normalizedValue": @{ @"addressValue": @{ @"addressLines": @[ ], @"administrativeArea": @"", @"languageCode": @"", @"locality": @"", @"organization": @"", @"postalCode": @"", @"recipients": @[ ], @"regionCode": @"", @"revision": @0, @"sortingCode": @"", @"sublocality": @"" }, @"booleanValue": @NO, @"dateValue": @{ @"day": @0, @"month": @0, @"year": @0 }, @"datetimeValue": @{ @"day": @0, @"hours": @0, @"minutes": @0, @"month": @0, @"nanos": @0, @"seconds": @0, @"timeZone": @{ @"id": @"", @"version": @"" }, @"utcOffset": @"", @"year": @0 }, @"floatValue": @"", @"integerValue": @0, @"moneyValue": @{ @"currencyCode": @"", @"nanos": @0, @"units": @"" }, @"text": @"" }, @"pageAnchor": @{ @"pageRefs": @[ @{ @"boundingPoly": @{ @"normalizedVertices": @[ @{ @"x": @"", @"y": @"" } ], @"vertices": @[ @{ @"x": @0, @"y": @0 } ] }, @"confidence": @"", @"layoutId": @"", @"layoutType": @"", @"page": @"" } ] }, @"properties": @[ ], @"provenance": @{ @"id": @0, @"parents": @[ @{ @"id": @0, @"index": @0, @"revision": @0 } ], @"revision": @0, @"type": @"" }, @"redacted": @NO, @"textAnchor": @{ @"content": @"", @"textSegments": @[ @{ @"endIndex": @"", @"startIndex": @"" } ] }, @"type": @"" } ], @"entityRelations": @[ @{ @"objectId": @"", @"relation": @"", @"subjectId": @"" } ], @"error": @{ @"code": @0, @"details": @[ @{ } ], @"message": @"" }, @"mimeType": @"", @"pages": @[ @{ @"blocks": @[ @{ @"detectedLanguages": @[ @{ @"confidence": @"", @"languageCode": @"" } ], @"layout": @{ @"boundingPoly": @{ }, @"confidence": @"", @"orientation": @"", @"textAnchor": @{ } }, @"provenance": @{ } } ], @"detectedBarcodes": @[ @{ @"barcode": @{ @"format": @"", @"rawValue": @"", @"valueFormat": @"" }, @"layout": @{ } } ], @"detectedLanguages": @[ @{ } ], @"dimension": @{ @"height": @"", @"unit": @"", @"width": @"" }, @"formFields": @[ @{ @"correctedKeyText": @"", @"correctedValueText": @"", @"fieldName": @{ }, @"fieldValue": @{ }, @"nameDetectedLanguages": @[ @{ } ], @"provenance": @{ }, @"valueDetectedLanguages": @[ @{ } ], @"valueType": @"" } ], @"image": @{ @"content": @"", @"height": @0, @"mimeType": @"", @"width": @0 }, @"imageQualityScores": @{ @"detectedDefects": @[ @{ @"confidence": @"", @"type": @"" } ], @"qualityScore": @"" }, @"layout": @{ }, @"lines": @[ @{ @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"provenance": @{ } } ], @"pageNumber": @0, @"paragraphs": @[ @{ @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"provenance": @{ } } ], @"provenance": @{ }, @"symbols": @[ @{ @"detectedLanguages": @[ @{ } ], @"layout": @{ } } ], @"tables": @[ @{ @"bodyRows": @[ @{ @"cells": @[ @{ @"colSpan": @0, @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"rowSpan": @0 } ] } ], @"detectedLanguages": @[ @{ } ], @"headerRows": @[ @{ } ], @"layout": @{ }, @"provenance": @{ } } ], @"tokens": @[ @{ @"detectedBreak": @{ @"type": @"" }, @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"provenance": @{ } } ], @"transforms": @[ @{ @"cols": @0, @"data": @"", @"rows": @0, @"type": @0 } ], @"visualElements": @[ @{ @"detectedLanguages": @[ @{ } ], @"layout": @{ }, @"type": @"" } ] } ], @"revisions": @[ @{ @"agent": @"", @"createTime": @"", @"humanReview": @{ @"state": @"", @"stateMessage": @"" }, @"id": @"", @"parent": @[ ], @"parentIds": @[ ], @"processor": @"" } ], @"shardInfo": @{ @"shardCount": @"", @"shardIndex": @"", @"textOffset": @"" }, @"text": @"", @"textChanges": @[ @{ @"changedText": @"", @"provenance": @[ @{ } ], @"textAnchor": @{ } } ], @"textStyles": @[ @{ @"backgroundColor": @{ @"alpha": @"", @"blue": @"", @"green": @"", @"red": @"" }, @"color": @{ }, @"fontFamily": @"", @"fontSize": @{ @"size": @"", @"unit": @"" }, @"fontWeight": @"", @"textAnchor": @{ }, @"textDecoration": @"", @"textStyle": @"" } ], @"uri": @"" },
@"fieldMask": @"",
@"inlineDocument": @{ },
@"processOptions": @{ @"ocrConfig": @{ @"advancedOcrOptions": @[ ], @"enableImageQualityScores": @NO, @"enableNativePdfParsing": @NO, @"enableSymbol": @NO, @"hints": @{ @"languageHints": @[ ] } } },
@"rawDocument": @{ @"content": @"", @"mimeType": @"" },
@"skipHumanReview": @NO };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta3/:name:process"]
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}}/v1beta3/:name:process" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:name:process",
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([
'document' => [
'content' => '',
'entities' => [
[
'confidence' => '',
'id' => '',
'mentionId' => '',
'mentionText' => '',
'normalizedValue' => [
'addressValue' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'booleanValue' => null,
'dateValue' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'datetimeValue' => [
'day' => 0,
'hours' => 0,
'minutes' => 0,
'month' => 0,
'nanos' => 0,
'seconds' => 0,
'timeZone' => [
'id' => '',
'version' => ''
],
'utcOffset' => '',
'year' => 0
],
'floatValue' => '',
'integerValue' => 0,
'moneyValue' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
],
'text' => ''
],
'pageAnchor' => [
'pageRefs' => [
[
'boundingPoly' => [
'normalizedVertices' => [
[
'x' => '',
'y' => ''
]
],
'vertices' => [
[
'x' => 0,
'y' => 0
]
]
],
'confidence' => '',
'layoutId' => '',
'layoutType' => '',
'page' => ''
]
]
],
'properties' => [
],
'provenance' => [
'id' => 0,
'parents' => [
[
'id' => 0,
'index' => 0,
'revision' => 0
]
],
'revision' => 0,
'type' => ''
],
'redacted' => null,
'textAnchor' => [
'content' => '',
'textSegments' => [
[
'endIndex' => '',
'startIndex' => ''
]
]
],
'type' => ''
]
],
'entityRelations' => [
[
'objectId' => '',
'relation' => '',
'subjectId' => ''
]
],
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'mimeType' => '',
'pages' => [
[
'blocks' => [
[
'detectedLanguages' => [
[
'confidence' => '',
'languageCode' => ''
]
],
'layout' => [
'boundingPoly' => [
],
'confidence' => '',
'orientation' => '',
'textAnchor' => [
]
],
'provenance' => [
]
]
],
'detectedBarcodes' => [
[
'barcode' => [
'format' => '',
'rawValue' => '',
'valueFormat' => ''
],
'layout' => [
]
]
],
'detectedLanguages' => [
[
]
],
'dimension' => [
'height' => '',
'unit' => '',
'width' => ''
],
'formFields' => [
[
'correctedKeyText' => '',
'correctedValueText' => '',
'fieldName' => [
],
'fieldValue' => [
],
'nameDetectedLanguages' => [
[
]
],
'provenance' => [
],
'valueDetectedLanguages' => [
[
]
],
'valueType' => ''
]
],
'image' => [
'content' => '',
'height' => 0,
'mimeType' => '',
'width' => 0
],
'imageQualityScores' => [
'detectedDefects' => [
[
'confidence' => '',
'type' => ''
]
],
'qualityScore' => ''
],
'layout' => [
],
'lines' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'pageNumber' => 0,
'paragraphs' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'provenance' => [
],
'symbols' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
]
]
],
'tables' => [
[
'bodyRows' => [
[
'cells' => [
[
'colSpan' => 0,
'detectedLanguages' => [
[
]
],
'layout' => [
],
'rowSpan' => 0
]
]
]
],
'detectedLanguages' => [
[
]
],
'headerRows' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'tokens' => [
[
'detectedBreak' => [
'type' => ''
],
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'transforms' => [
[
'cols' => 0,
'data' => '',
'rows' => 0,
'type' => 0
]
],
'visualElements' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'type' => ''
]
]
]
],
'revisions' => [
[
'agent' => '',
'createTime' => '',
'humanReview' => [
'state' => '',
'stateMessage' => ''
],
'id' => '',
'parent' => [
],
'parentIds' => [
],
'processor' => ''
]
],
'shardInfo' => [
'shardCount' => '',
'shardIndex' => '',
'textOffset' => ''
],
'text' => '',
'textChanges' => [
[
'changedText' => '',
'provenance' => [
[
]
],
'textAnchor' => [
]
]
],
'textStyles' => [
[
'backgroundColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'color' => [
],
'fontFamily' => '',
'fontSize' => [
'size' => '',
'unit' => ''
],
'fontWeight' => '',
'textAnchor' => [
],
'textDecoration' => '',
'textStyle' => ''
]
],
'uri' => ''
],
'fieldMask' => '',
'inlineDocument' => [
],
'processOptions' => [
'ocrConfig' => [
'advancedOcrOptions' => [
],
'enableImageQualityScores' => null,
'enableNativePdfParsing' => null,
'enableSymbol' => null,
'hints' => [
'languageHints' => [
]
]
]
],
'rawDocument' => [
'content' => '',
'mimeType' => ''
],
'skipHumanReview' => null
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1beta3/:name:process', [
'body' => '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"fieldMask": "",
"inlineDocument": {},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"rawDocument": {
"content": "",
"mimeType": ""
},
"skipHumanReview": false
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name:process');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'document' => [
'content' => '',
'entities' => [
[
'confidence' => '',
'id' => '',
'mentionId' => '',
'mentionText' => '',
'normalizedValue' => [
'addressValue' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'booleanValue' => null,
'dateValue' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'datetimeValue' => [
'day' => 0,
'hours' => 0,
'minutes' => 0,
'month' => 0,
'nanos' => 0,
'seconds' => 0,
'timeZone' => [
'id' => '',
'version' => ''
],
'utcOffset' => '',
'year' => 0
],
'floatValue' => '',
'integerValue' => 0,
'moneyValue' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
],
'text' => ''
],
'pageAnchor' => [
'pageRefs' => [
[
'boundingPoly' => [
'normalizedVertices' => [
[
'x' => '',
'y' => ''
]
],
'vertices' => [
[
'x' => 0,
'y' => 0
]
]
],
'confidence' => '',
'layoutId' => '',
'layoutType' => '',
'page' => ''
]
]
],
'properties' => [
],
'provenance' => [
'id' => 0,
'parents' => [
[
'id' => 0,
'index' => 0,
'revision' => 0
]
],
'revision' => 0,
'type' => ''
],
'redacted' => null,
'textAnchor' => [
'content' => '',
'textSegments' => [
[
'endIndex' => '',
'startIndex' => ''
]
]
],
'type' => ''
]
],
'entityRelations' => [
[
'objectId' => '',
'relation' => '',
'subjectId' => ''
]
],
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'mimeType' => '',
'pages' => [
[
'blocks' => [
[
'detectedLanguages' => [
[
'confidence' => '',
'languageCode' => ''
]
],
'layout' => [
'boundingPoly' => [
],
'confidence' => '',
'orientation' => '',
'textAnchor' => [
]
],
'provenance' => [
]
]
],
'detectedBarcodes' => [
[
'barcode' => [
'format' => '',
'rawValue' => '',
'valueFormat' => ''
],
'layout' => [
]
]
],
'detectedLanguages' => [
[
]
],
'dimension' => [
'height' => '',
'unit' => '',
'width' => ''
],
'formFields' => [
[
'correctedKeyText' => '',
'correctedValueText' => '',
'fieldName' => [
],
'fieldValue' => [
],
'nameDetectedLanguages' => [
[
]
],
'provenance' => [
],
'valueDetectedLanguages' => [
[
]
],
'valueType' => ''
]
],
'image' => [
'content' => '',
'height' => 0,
'mimeType' => '',
'width' => 0
],
'imageQualityScores' => [
'detectedDefects' => [
[
'confidence' => '',
'type' => ''
]
],
'qualityScore' => ''
],
'layout' => [
],
'lines' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'pageNumber' => 0,
'paragraphs' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'provenance' => [
],
'symbols' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
]
]
],
'tables' => [
[
'bodyRows' => [
[
'cells' => [
[
'colSpan' => 0,
'detectedLanguages' => [
[
]
],
'layout' => [
],
'rowSpan' => 0
]
]
]
],
'detectedLanguages' => [
[
]
],
'headerRows' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'tokens' => [
[
'detectedBreak' => [
'type' => ''
],
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'transforms' => [
[
'cols' => 0,
'data' => '',
'rows' => 0,
'type' => 0
]
],
'visualElements' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'type' => ''
]
]
]
],
'revisions' => [
[
'agent' => '',
'createTime' => '',
'humanReview' => [
'state' => '',
'stateMessage' => ''
],
'id' => '',
'parent' => [
],
'parentIds' => [
],
'processor' => ''
]
],
'shardInfo' => [
'shardCount' => '',
'shardIndex' => '',
'textOffset' => ''
],
'text' => '',
'textChanges' => [
[
'changedText' => '',
'provenance' => [
[
]
],
'textAnchor' => [
]
]
],
'textStyles' => [
[
'backgroundColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'color' => [
],
'fontFamily' => '',
'fontSize' => [
'size' => '',
'unit' => ''
],
'fontWeight' => '',
'textAnchor' => [
],
'textDecoration' => '',
'textStyle' => ''
]
],
'uri' => ''
],
'fieldMask' => '',
'inlineDocument' => [
],
'processOptions' => [
'ocrConfig' => [
'advancedOcrOptions' => [
],
'enableImageQualityScores' => null,
'enableNativePdfParsing' => null,
'enableSymbol' => null,
'hints' => [
'languageHints' => [
]
]
]
],
'rawDocument' => [
'content' => '',
'mimeType' => ''
],
'skipHumanReview' => null
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'document' => [
'content' => '',
'entities' => [
[
'confidence' => '',
'id' => '',
'mentionId' => '',
'mentionText' => '',
'normalizedValue' => [
'addressValue' => [
'addressLines' => [
],
'administrativeArea' => '',
'languageCode' => '',
'locality' => '',
'organization' => '',
'postalCode' => '',
'recipients' => [
],
'regionCode' => '',
'revision' => 0,
'sortingCode' => '',
'sublocality' => ''
],
'booleanValue' => null,
'dateValue' => [
'day' => 0,
'month' => 0,
'year' => 0
],
'datetimeValue' => [
'day' => 0,
'hours' => 0,
'minutes' => 0,
'month' => 0,
'nanos' => 0,
'seconds' => 0,
'timeZone' => [
'id' => '',
'version' => ''
],
'utcOffset' => '',
'year' => 0
],
'floatValue' => '',
'integerValue' => 0,
'moneyValue' => [
'currencyCode' => '',
'nanos' => 0,
'units' => ''
],
'text' => ''
],
'pageAnchor' => [
'pageRefs' => [
[
'boundingPoly' => [
'normalizedVertices' => [
[
'x' => '',
'y' => ''
]
],
'vertices' => [
[
'x' => 0,
'y' => 0
]
]
],
'confidence' => '',
'layoutId' => '',
'layoutType' => '',
'page' => ''
]
]
],
'properties' => [
],
'provenance' => [
'id' => 0,
'parents' => [
[
'id' => 0,
'index' => 0,
'revision' => 0
]
],
'revision' => 0,
'type' => ''
],
'redacted' => null,
'textAnchor' => [
'content' => '',
'textSegments' => [
[
'endIndex' => '',
'startIndex' => ''
]
]
],
'type' => ''
]
],
'entityRelations' => [
[
'objectId' => '',
'relation' => '',
'subjectId' => ''
]
],
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'mimeType' => '',
'pages' => [
[
'blocks' => [
[
'detectedLanguages' => [
[
'confidence' => '',
'languageCode' => ''
]
],
'layout' => [
'boundingPoly' => [
],
'confidence' => '',
'orientation' => '',
'textAnchor' => [
]
],
'provenance' => [
]
]
],
'detectedBarcodes' => [
[
'barcode' => [
'format' => '',
'rawValue' => '',
'valueFormat' => ''
],
'layout' => [
]
]
],
'detectedLanguages' => [
[
]
],
'dimension' => [
'height' => '',
'unit' => '',
'width' => ''
],
'formFields' => [
[
'correctedKeyText' => '',
'correctedValueText' => '',
'fieldName' => [
],
'fieldValue' => [
],
'nameDetectedLanguages' => [
[
]
],
'provenance' => [
],
'valueDetectedLanguages' => [
[
]
],
'valueType' => ''
]
],
'image' => [
'content' => '',
'height' => 0,
'mimeType' => '',
'width' => 0
],
'imageQualityScores' => [
'detectedDefects' => [
[
'confidence' => '',
'type' => ''
]
],
'qualityScore' => ''
],
'layout' => [
],
'lines' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'pageNumber' => 0,
'paragraphs' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'provenance' => [
],
'symbols' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
]
]
],
'tables' => [
[
'bodyRows' => [
[
'cells' => [
[
'colSpan' => 0,
'detectedLanguages' => [
[
]
],
'layout' => [
],
'rowSpan' => 0
]
]
]
],
'detectedLanguages' => [
[
]
],
'headerRows' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'tokens' => [
[
'detectedBreak' => [
'type' => ''
],
'detectedLanguages' => [
[
]
],
'layout' => [
],
'provenance' => [
]
]
],
'transforms' => [
[
'cols' => 0,
'data' => '',
'rows' => 0,
'type' => 0
]
],
'visualElements' => [
[
'detectedLanguages' => [
[
]
],
'layout' => [
],
'type' => ''
]
]
]
],
'revisions' => [
[
'agent' => '',
'createTime' => '',
'humanReview' => [
'state' => '',
'stateMessage' => ''
],
'id' => '',
'parent' => [
],
'parentIds' => [
],
'processor' => ''
]
],
'shardInfo' => [
'shardCount' => '',
'shardIndex' => '',
'textOffset' => ''
],
'text' => '',
'textChanges' => [
[
'changedText' => '',
'provenance' => [
[
]
],
'textAnchor' => [
]
]
],
'textStyles' => [
[
'backgroundColor' => [
'alpha' => '',
'blue' => '',
'green' => '',
'red' => ''
],
'color' => [
],
'fontFamily' => '',
'fontSize' => [
'size' => '',
'unit' => ''
],
'fontWeight' => '',
'textAnchor' => [
],
'textDecoration' => '',
'textStyle' => ''
]
],
'uri' => ''
],
'fieldMask' => '',
'inlineDocument' => [
],
'processOptions' => [
'ocrConfig' => [
'advancedOcrOptions' => [
],
'enableImageQualityScores' => null,
'enableNativePdfParsing' => null,
'enableSymbol' => null,
'hints' => [
'languageHints' => [
]
]
]
],
'rawDocument' => [
'content' => '',
'mimeType' => ''
],
'skipHumanReview' => null
]));
$request->setRequestUrl('{{baseUrl}}/v1beta3/:name:process');
$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}}/v1beta3/:name:process' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"fieldMask": "",
"inlineDocument": {},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"rawDocument": {
"content": "",
"mimeType": ""
},
"skipHumanReview": false
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name:process' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"fieldMask": "",
"inlineDocument": {},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"rawDocument": {
"content": "",
"mimeType": ""
},
"skipHumanReview": false
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta3/:name:process", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name:process"
payload = {
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": False,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": { "pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
] },
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": False,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [{}],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [{}],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [{}],
"provenance": {},
"valueDetectedLanguages": [{}],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [{}],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [{}],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [{}],
"layout": {}
}
],
"tables": [
{
"bodyRows": [{ "cells": [
{
"colSpan": 0,
"detectedLanguages": [{}],
"layout": {},
"rowSpan": 0
}
] }],
"detectedLanguages": [{}],
"headerRows": [{}],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": { "type": "" },
"detectedLanguages": [{}],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [{}],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [{}],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"fieldMask": "",
"inlineDocument": {},
"processOptions": { "ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": False,
"enableNativePdfParsing": False,
"enableSymbol": False,
"hints": { "languageHints": [] }
} },
"rawDocument": {
"content": "",
"mimeType": ""
},
"skipHumanReview": False
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name:process"
payload <- "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1beta3/:name:process")
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 \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1beta3/:name:process') do |req|
req.body = "{\n \"document\": {\n \"content\": \"\",\n \"entities\": [\n {\n \"confidence\": \"\",\n \"id\": \"\",\n \"mentionId\": \"\",\n \"mentionText\": \"\",\n \"normalizedValue\": {\n \"addressValue\": {\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 \"booleanValue\": false,\n \"dateValue\": {\n \"day\": 0,\n \"month\": 0,\n \"year\": 0\n },\n \"datetimeValue\": {\n \"day\": 0,\n \"hours\": 0,\n \"minutes\": 0,\n \"month\": 0,\n \"nanos\": 0,\n \"seconds\": 0,\n \"timeZone\": {\n \"id\": \"\",\n \"version\": \"\"\n },\n \"utcOffset\": \"\",\n \"year\": 0\n },\n \"floatValue\": \"\",\n \"integerValue\": 0,\n \"moneyValue\": {\n \"currencyCode\": \"\",\n \"nanos\": 0,\n \"units\": \"\"\n },\n \"text\": \"\"\n },\n \"pageAnchor\": {\n \"pageRefs\": [\n {\n \"boundingPoly\": {\n \"normalizedVertices\": [\n {\n \"x\": \"\",\n \"y\": \"\"\n }\n ],\n \"vertices\": [\n {\n \"x\": 0,\n \"y\": 0\n }\n ]\n },\n \"confidence\": \"\",\n \"layoutId\": \"\",\n \"layoutType\": \"\",\n \"page\": \"\"\n }\n ]\n },\n \"properties\": [],\n \"provenance\": {\n \"id\": 0,\n \"parents\": [\n {\n \"id\": 0,\n \"index\": 0,\n \"revision\": 0\n }\n ],\n \"revision\": 0,\n \"type\": \"\"\n },\n \"redacted\": false,\n \"textAnchor\": {\n \"content\": \"\",\n \"textSegments\": [\n {\n \"endIndex\": \"\",\n \"startIndex\": \"\"\n }\n ]\n },\n \"type\": \"\"\n }\n ],\n \"entityRelations\": [\n {\n \"objectId\": \"\",\n \"relation\": \"\",\n \"subjectId\": \"\"\n }\n ],\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"mimeType\": \"\",\n \"pages\": [\n {\n \"blocks\": [\n {\n \"detectedLanguages\": [\n {\n \"confidence\": \"\",\n \"languageCode\": \"\"\n }\n ],\n \"layout\": {\n \"boundingPoly\": {},\n \"confidence\": \"\",\n \"orientation\": \"\",\n \"textAnchor\": {}\n },\n \"provenance\": {}\n }\n ],\n \"detectedBarcodes\": [\n {\n \"barcode\": {\n \"format\": \"\",\n \"rawValue\": \"\",\n \"valueFormat\": \"\"\n },\n \"layout\": {}\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"dimension\": {\n \"height\": \"\",\n \"unit\": \"\",\n \"width\": \"\"\n },\n \"formFields\": [\n {\n \"correctedKeyText\": \"\",\n \"correctedValueText\": \"\",\n \"fieldName\": {},\n \"fieldValue\": {},\n \"nameDetectedLanguages\": [\n {}\n ],\n \"provenance\": {},\n \"valueDetectedLanguages\": [\n {}\n ],\n \"valueType\": \"\"\n }\n ],\n \"image\": {\n \"content\": \"\",\n \"height\": 0,\n \"mimeType\": \"\",\n \"width\": 0\n },\n \"imageQualityScores\": {\n \"detectedDefects\": [\n {\n \"confidence\": \"\",\n \"type\": \"\"\n }\n ],\n \"qualityScore\": \"\"\n },\n \"layout\": {},\n \"lines\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"pageNumber\": 0,\n \"paragraphs\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"provenance\": {},\n \"symbols\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {}\n }\n ],\n \"tables\": [\n {\n \"bodyRows\": [\n {\n \"cells\": [\n {\n \"colSpan\": 0,\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"rowSpan\": 0\n }\n ]\n }\n ],\n \"detectedLanguages\": [\n {}\n ],\n \"headerRows\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"tokens\": [\n {\n \"detectedBreak\": {\n \"type\": \"\"\n },\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"provenance\": {}\n }\n ],\n \"transforms\": [\n {\n \"cols\": 0,\n \"data\": \"\",\n \"rows\": 0,\n \"type\": 0\n }\n ],\n \"visualElements\": [\n {\n \"detectedLanguages\": [\n {}\n ],\n \"layout\": {},\n \"type\": \"\"\n }\n ]\n }\n ],\n \"revisions\": [\n {\n \"agent\": \"\",\n \"createTime\": \"\",\n \"humanReview\": {\n \"state\": \"\",\n \"stateMessage\": \"\"\n },\n \"id\": \"\",\n \"parent\": [],\n \"parentIds\": [],\n \"processor\": \"\"\n }\n ],\n \"shardInfo\": {\n \"shardCount\": \"\",\n \"shardIndex\": \"\",\n \"textOffset\": \"\"\n },\n \"text\": \"\",\n \"textChanges\": [\n {\n \"changedText\": \"\",\n \"provenance\": [\n {}\n ],\n \"textAnchor\": {}\n }\n ],\n \"textStyles\": [\n {\n \"backgroundColor\": {\n \"alpha\": \"\",\n \"blue\": \"\",\n \"green\": \"\",\n \"red\": \"\"\n },\n \"color\": {},\n \"fontFamily\": \"\",\n \"fontSize\": {\n \"size\": \"\",\n \"unit\": \"\"\n },\n \"fontWeight\": \"\",\n \"textAnchor\": {},\n \"textDecoration\": \"\",\n \"textStyle\": \"\"\n }\n ],\n \"uri\": \"\"\n },\n \"fieldMask\": \"\",\n \"inlineDocument\": {},\n \"processOptions\": {\n \"ocrConfig\": {\n \"advancedOcrOptions\": [],\n \"enableImageQualityScores\": false,\n \"enableNativePdfParsing\": false,\n \"enableSymbol\": false,\n \"hints\": {\n \"languageHints\": []\n }\n }\n },\n \"rawDocument\": {\n \"content\": \"\",\n \"mimeType\": \"\"\n },\n \"skipHumanReview\": false\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:name:process";
let payload = json!({
"document": json!({
"content": "",
"entities": (
json!({
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": json!({
"addressValue": json!({
"addressLines": (),
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": (),
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
}),
"booleanValue": false,
"dateValue": json!({
"day": 0,
"month": 0,
"year": 0
}),
"datetimeValue": json!({
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": json!({
"id": "",
"version": ""
}),
"utcOffset": "",
"year": 0
}),
"floatValue": "",
"integerValue": 0,
"moneyValue": json!({
"currencyCode": "",
"nanos": 0,
"units": ""
}),
"text": ""
}),
"pageAnchor": json!({"pageRefs": (
json!({
"boundingPoly": json!({
"normalizedVertices": (
json!({
"x": "",
"y": ""
})
),
"vertices": (
json!({
"x": 0,
"y": 0
})
)
}),
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
})
)}),
"properties": (),
"provenance": json!({
"id": 0,
"parents": (
json!({
"id": 0,
"index": 0,
"revision": 0
})
),
"revision": 0,
"type": ""
}),
"redacted": false,
"textAnchor": json!({
"content": "",
"textSegments": (
json!({
"endIndex": "",
"startIndex": ""
})
)
}),
"type": ""
})
),
"entityRelations": (
json!({
"objectId": "",
"relation": "",
"subjectId": ""
})
),
"error": json!({
"code": 0,
"details": (json!({})),
"message": ""
}),
"mimeType": "",
"pages": (
json!({
"blocks": (
json!({
"detectedLanguages": (
json!({
"confidence": "",
"languageCode": ""
})
),
"layout": json!({
"boundingPoly": json!({}),
"confidence": "",
"orientation": "",
"textAnchor": json!({})
}),
"provenance": json!({})
})
),
"detectedBarcodes": (
json!({
"barcode": json!({
"format": "",
"rawValue": "",
"valueFormat": ""
}),
"layout": json!({})
})
),
"detectedLanguages": (json!({})),
"dimension": json!({
"height": "",
"unit": "",
"width": ""
}),
"formFields": (
json!({
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": json!({}),
"fieldValue": json!({}),
"nameDetectedLanguages": (json!({})),
"provenance": json!({}),
"valueDetectedLanguages": (json!({})),
"valueType": ""
})
),
"image": json!({
"content": "",
"height": 0,
"mimeType": "",
"width": 0
}),
"imageQualityScores": json!({
"detectedDefects": (
json!({
"confidence": "",
"type": ""
})
),
"qualityScore": ""
}),
"layout": json!({}),
"lines": (
json!({
"detectedLanguages": (json!({})),
"layout": json!({}),
"provenance": json!({})
})
),
"pageNumber": 0,
"paragraphs": (
json!({
"detectedLanguages": (json!({})),
"layout": json!({}),
"provenance": json!({})
})
),
"provenance": json!({}),
"symbols": (
json!({
"detectedLanguages": (json!({})),
"layout": json!({})
})
),
"tables": (
json!({
"bodyRows": (json!({"cells": (
json!({
"colSpan": 0,
"detectedLanguages": (json!({})),
"layout": json!({}),
"rowSpan": 0
})
)})),
"detectedLanguages": (json!({})),
"headerRows": (json!({})),
"layout": json!({}),
"provenance": json!({})
})
),
"tokens": (
json!({
"detectedBreak": json!({"type": ""}),
"detectedLanguages": (json!({})),
"layout": json!({}),
"provenance": json!({})
})
),
"transforms": (
json!({
"cols": 0,
"data": "",
"rows": 0,
"type": 0
})
),
"visualElements": (
json!({
"detectedLanguages": (json!({})),
"layout": json!({}),
"type": ""
})
)
})
),
"revisions": (
json!({
"agent": "",
"createTime": "",
"humanReview": json!({
"state": "",
"stateMessage": ""
}),
"id": "",
"parent": (),
"parentIds": (),
"processor": ""
})
),
"shardInfo": json!({
"shardCount": "",
"shardIndex": "",
"textOffset": ""
}),
"text": "",
"textChanges": (
json!({
"changedText": "",
"provenance": (json!({})),
"textAnchor": json!({})
})
),
"textStyles": (
json!({
"backgroundColor": json!({
"alpha": "",
"blue": "",
"green": "",
"red": ""
}),
"color": json!({}),
"fontFamily": "",
"fontSize": json!({
"size": "",
"unit": ""
}),
"fontWeight": "",
"textAnchor": json!({}),
"textDecoration": "",
"textStyle": ""
})
),
"uri": ""
}),
"fieldMask": "",
"inlineDocument": json!({}),
"processOptions": json!({"ocrConfig": json!({
"advancedOcrOptions": (),
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": json!({"languageHints": ()})
})}),
"rawDocument": json!({
"content": "",
"mimeType": ""
}),
"skipHumanReview": false
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1beta3/:name:process \
--header 'content-type: application/json' \
--data '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"fieldMask": "",
"inlineDocument": {},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"rawDocument": {
"content": "",
"mimeType": ""
},
"skipHumanReview": false
}'
echo '{
"document": {
"content": "",
"entities": [
{
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": {
"addressValue": {
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
},
"booleanValue": false,
"dateValue": {
"day": 0,
"month": 0,
"year": 0
},
"datetimeValue": {
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": {
"id": "",
"version": ""
},
"utcOffset": "",
"year": 0
},
"floatValue": "",
"integerValue": 0,
"moneyValue": {
"currencyCode": "",
"nanos": 0,
"units": ""
},
"text": ""
},
"pageAnchor": {
"pageRefs": [
{
"boundingPoly": {
"normalizedVertices": [
{
"x": "",
"y": ""
}
],
"vertices": [
{
"x": 0,
"y": 0
}
]
},
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
}
]
},
"properties": [],
"provenance": {
"id": 0,
"parents": [
{
"id": 0,
"index": 0,
"revision": 0
}
],
"revision": 0,
"type": ""
},
"redacted": false,
"textAnchor": {
"content": "",
"textSegments": [
{
"endIndex": "",
"startIndex": ""
}
]
},
"type": ""
}
],
"entityRelations": [
{
"objectId": "",
"relation": "",
"subjectId": ""
}
],
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"mimeType": "",
"pages": [
{
"blocks": [
{
"detectedLanguages": [
{
"confidence": "",
"languageCode": ""
}
],
"layout": {
"boundingPoly": {},
"confidence": "",
"orientation": "",
"textAnchor": {}
},
"provenance": {}
}
],
"detectedBarcodes": [
{
"barcode": {
"format": "",
"rawValue": "",
"valueFormat": ""
},
"layout": {}
}
],
"detectedLanguages": [
{}
],
"dimension": {
"height": "",
"unit": "",
"width": ""
},
"formFields": [
{
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": {},
"fieldValue": {},
"nameDetectedLanguages": [
{}
],
"provenance": {},
"valueDetectedLanguages": [
{}
],
"valueType": ""
}
],
"image": {
"content": "",
"height": 0,
"mimeType": "",
"width": 0
},
"imageQualityScores": {
"detectedDefects": [
{
"confidence": "",
"type": ""
}
],
"qualityScore": ""
},
"layout": {},
"lines": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"pageNumber": 0,
"paragraphs": [
{
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"provenance": {},
"symbols": [
{
"detectedLanguages": [
{}
],
"layout": {}
}
],
"tables": [
{
"bodyRows": [
{
"cells": [
{
"colSpan": 0,
"detectedLanguages": [
{}
],
"layout": {},
"rowSpan": 0
}
]
}
],
"detectedLanguages": [
{}
],
"headerRows": [
{}
],
"layout": {},
"provenance": {}
}
],
"tokens": [
{
"detectedBreak": {
"type": ""
},
"detectedLanguages": [
{}
],
"layout": {},
"provenance": {}
}
],
"transforms": [
{
"cols": 0,
"data": "",
"rows": 0,
"type": 0
}
],
"visualElements": [
{
"detectedLanguages": [
{}
],
"layout": {},
"type": ""
}
]
}
],
"revisions": [
{
"agent": "",
"createTime": "",
"humanReview": {
"state": "",
"stateMessage": ""
},
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
}
],
"shardInfo": {
"shardCount": "",
"shardIndex": "",
"textOffset": ""
},
"text": "",
"textChanges": [
{
"changedText": "",
"provenance": [
{}
],
"textAnchor": {}
}
],
"textStyles": [
{
"backgroundColor": {
"alpha": "",
"blue": "",
"green": "",
"red": ""
},
"color": {},
"fontFamily": "",
"fontSize": {
"size": "",
"unit": ""
},
"fontWeight": "",
"textAnchor": {},
"textDecoration": "",
"textStyle": ""
}
],
"uri": ""
},
"fieldMask": "",
"inlineDocument": {},
"processOptions": {
"ocrConfig": {
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": {
"languageHints": []
}
}
},
"rawDocument": {
"content": "",
"mimeType": ""
},
"skipHumanReview": false
}' | \
http POST {{baseUrl}}/v1beta3/:name:process \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "document": {\n "content": "",\n "entities": [\n {\n "confidence": "",\n "id": "",\n "mentionId": "",\n "mentionText": "",\n "normalizedValue": {\n "addressValue": {\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 "booleanValue": false,\n "dateValue": {\n "day": 0,\n "month": 0,\n "year": 0\n },\n "datetimeValue": {\n "day": 0,\n "hours": 0,\n "minutes": 0,\n "month": 0,\n "nanos": 0,\n "seconds": 0,\n "timeZone": {\n "id": "",\n "version": ""\n },\n "utcOffset": "",\n "year": 0\n },\n "floatValue": "",\n "integerValue": 0,\n "moneyValue": {\n "currencyCode": "",\n "nanos": 0,\n "units": ""\n },\n "text": ""\n },\n "pageAnchor": {\n "pageRefs": [\n {\n "boundingPoly": {\n "normalizedVertices": [\n {\n "x": "",\n "y": ""\n }\n ],\n "vertices": [\n {\n "x": 0,\n "y": 0\n }\n ]\n },\n "confidence": "",\n "layoutId": "",\n "layoutType": "",\n "page": ""\n }\n ]\n },\n "properties": [],\n "provenance": {\n "id": 0,\n "parents": [\n {\n "id": 0,\n "index": 0,\n "revision": 0\n }\n ],\n "revision": 0,\n "type": ""\n },\n "redacted": false,\n "textAnchor": {\n "content": "",\n "textSegments": [\n {\n "endIndex": "",\n "startIndex": ""\n }\n ]\n },\n "type": ""\n }\n ],\n "entityRelations": [\n {\n "objectId": "",\n "relation": "",\n "subjectId": ""\n }\n ],\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "mimeType": "",\n "pages": [\n {\n "blocks": [\n {\n "detectedLanguages": [\n {\n "confidence": "",\n "languageCode": ""\n }\n ],\n "layout": {\n "boundingPoly": {},\n "confidence": "",\n "orientation": "",\n "textAnchor": {}\n },\n "provenance": {}\n }\n ],\n "detectedBarcodes": [\n {\n "barcode": {\n "format": "",\n "rawValue": "",\n "valueFormat": ""\n },\n "layout": {}\n }\n ],\n "detectedLanguages": [\n {}\n ],\n "dimension": {\n "height": "",\n "unit": "",\n "width": ""\n },\n "formFields": [\n {\n "correctedKeyText": "",\n "correctedValueText": "",\n "fieldName": {},\n "fieldValue": {},\n "nameDetectedLanguages": [\n {}\n ],\n "provenance": {},\n "valueDetectedLanguages": [\n {}\n ],\n "valueType": ""\n }\n ],\n "image": {\n "content": "",\n "height": 0,\n "mimeType": "",\n "width": 0\n },\n "imageQualityScores": {\n "detectedDefects": [\n {\n "confidence": "",\n "type": ""\n }\n ],\n "qualityScore": ""\n },\n "layout": {},\n "lines": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "pageNumber": 0,\n "paragraphs": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "provenance": {},\n "symbols": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {}\n }\n ],\n "tables": [\n {\n "bodyRows": [\n {\n "cells": [\n {\n "colSpan": 0,\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "rowSpan": 0\n }\n ]\n }\n ],\n "detectedLanguages": [\n {}\n ],\n "headerRows": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "tokens": [\n {\n "detectedBreak": {\n "type": ""\n },\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "provenance": {}\n }\n ],\n "transforms": [\n {\n "cols": 0,\n "data": "",\n "rows": 0,\n "type": 0\n }\n ],\n "visualElements": [\n {\n "detectedLanguages": [\n {}\n ],\n "layout": {},\n "type": ""\n }\n ]\n }\n ],\n "revisions": [\n {\n "agent": "",\n "createTime": "",\n "humanReview": {\n "state": "",\n "stateMessage": ""\n },\n "id": "",\n "parent": [],\n "parentIds": [],\n "processor": ""\n }\n ],\n "shardInfo": {\n "shardCount": "",\n "shardIndex": "",\n "textOffset": ""\n },\n "text": "",\n "textChanges": [\n {\n "changedText": "",\n "provenance": [\n {}\n ],\n "textAnchor": {}\n }\n ],\n "textStyles": [\n {\n "backgroundColor": {\n "alpha": "",\n "blue": "",\n "green": "",\n "red": ""\n },\n "color": {},\n "fontFamily": "",\n "fontSize": {\n "size": "",\n "unit": ""\n },\n "fontWeight": "",\n "textAnchor": {},\n "textDecoration": "",\n "textStyle": ""\n }\n ],\n "uri": ""\n },\n "fieldMask": "",\n "inlineDocument": {},\n "processOptions": {\n "ocrConfig": {\n "advancedOcrOptions": [],\n "enableImageQualityScores": false,\n "enableNativePdfParsing": false,\n "enableSymbol": false,\n "hints": {\n "languageHints": []\n }\n }\n },\n "rawDocument": {\n "content": "",\n "mimeType": ""\n },\n "skipHumanReview": false\n}' \
--output-document \
- {{baseUrl}}/v1beta3/:name:process
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"document": [
"content": "",
"entities": [
[
"confidence": "",
"id": "",
"mentionId": "",
"mentionText": "",
"normalizedValue": [
"addressValue": [
"addressLines": [],
"administrativeArea": "",
"languageCode": "",
"locality": "",
"organization": "",
"postalCode": "",
"recipients": [],
"regionCode": "",
"revision": 0,
"sortingCode": "",
"sublocality": ""
],
"booleanValue": false,
"dateValue": [
"day": 0,
"month": 0,
"year": 0
],
"datetimeValue": [
"day": 0,
"hours": 0,
"minutes": 0,
"month": 0,
"nanos": 0,
"seconds": 0,
"timeZone": [
"id": "",
"version": ""
],
"utcOffset": "",
"year": 0
],
"floatValue": "",
"integerValue": 0,
"moneyValue": [
"currencyCode": "",
"nanos": 0,
"units": ""
],
"text": ""
],
"pageAnchor": ["pageRefs": [
[
"boundingPoly": [
"normalizedVertices": [
[
"x": "",
"y": ""
]
],
"vertices": [
[
"x": 0,
"y": 0
]
]
],
"confidence": "",
"layoutId": "",
"layoutType": "",
"page": ""
]
]],
"properties": [],
"provenance": [
"id": 0,
"parents": [
[
"id": 0,
"index": 0,
"revision": 0
]
],
"revision": 0,
"type": ""
],
"redacted": false,
"textAnchor": [
"content": "",
"textSegments": [
[
"endIndex": "",
"startIndex": ""
]
]
],
"type": ""
]
],
"entityRelations": [
[
"objectId": "",
"relation": "",
"subjectId": ""
]
],
"error": [
"code": 0,
"details": [[]],
"message": ""
],
"mimeType": "",
"pages": [
[
"blocks": [
[
"detectedLanguages": [
[
"confidence": "",
"languageCode": ""
]
],
"layout": [
"boundingPoly": [],
"confidence": "",
"orientation": "",
"textAnchor": []
],
"provenance": []
]
],
"detectedBarcodes": [
[
"barcode": [
"format": "",
"rawValue": "",
"valueFormat": ""
],
"layout": []
]
],
"detectedLanguages": [[]],
"dimension": [
"height": "",
"unit": "",
"width": ""
],
"formFields": [
[
"correctedKeyText": "",
"correctedValueText": "",
"fieldName": [],
"fieldValue": [],
"nameDetectedLanguages": [[]],
"provenance": [],
"valueDetectedLanguages": [[]],
"valueType": ""
]
],
"image": [
"content": "",
"height": 0,
"mimeType": "",
"width": 0
],
"imageQualityScores": [
"detectedDefects": [
[
"confidence": "",
"type": ""
]
],
"qualityScore": ""
],
"layout": [],
"lines": [
[
"detectedLanguages": [[]],
"layout": [],
"provenance": []
]
],
"pageNumber": 0,
"paragraphs": [
[
"detectedLanguages": [[]],
"layout": [],
"provenance": []
]
],
"provenance": [],
"symbols": [
[
"detectedLanguages": [[]],
"layout": []
]
],
"tables": [
[
"bodyRows": [["cells": [
[
"colSpan": 0,
"detectedLanguages": [[]],
"layout": [],
"rowSpan": 0
]
]]],
"detectedLanguages": [[]],
"headerRows": [[]],
"layout": [],
"provenance": []
]
],
"tokens": [
[
"detectedBreak": ["type": ""],
"detectedLanguages": [[]],
"layout": [],
"provenance": []
]
],
"transforms": [
[
"cols": 0,
"data": "",
"rows": 0,
"type": 0
]
],
"visualElements": [
[
"detectedLanguages": [[]],
"layout": [],
"type": ""
]
]
]
],
"revisions": [
[
"agent": "",
"createTime": "",
"humanReview": [
"state": "",
"stateMessage": ""
],
"id": "",
"parent": [],
"parentIds": [],
"processor": ""
]
],
"shardInfo": [
"shardCount": "",
"shardIndex": "",
"textOffset": ""
],
"text": "",
"textChanges": [
[
"changedText": "",
"provenance": [[]],
"textAnchor": []
]
],
"textStyles": [
[
"backgroundColor": [
"alpha": "",
"blue": "",
"green": "",
"red": ""
],
"color": [],
"fontFamily": "",
"fontSize": [
"size": "",
"unit": ""
],
"fontWeight": "",
"textAnchor": [],
"textDecoration": "",
"textStyle": ""
]
],
"uri": ""
],
"fieldMask": "",
"inlineDocument": [],
"processOptions": ["ocrConfig": [
"advancedOcrOptions": [],
"enableImageQualityScores": false,
"enableNativePdfParsing": false,
"enableSymbol": false,
"hints": ["languageHints": []]
]],
"rawDocument": [
"content": "",
"mimeType": ""
],
"skipHumanReview": false
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:name:process")! 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
documentai.projects.locations.processors.processorVersions.train
{{baseUrl}}/v1beta3/:parent/processorVersions:train
QUERY PARAMS
parent
BODY json
{
"baseProcessorVersion": "",
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"inputData": {
"testDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"trainingDocuments": {}
},
"processorVersion": {
"createTime": "",
"deprecationInfo": {
"deprecationTime": "",
"replacementProcessorVersion": ""
},
"displayName": "",
"documentSchema": {},
"googleManaged": false,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": {
"aggregateMetrics": {
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
},
"aggregateMetricsExact": {},
"evaluation": "",
"operation": ""
},
"name": "",
"state": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:parent/processorVersions:train");
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 \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:parent/processorVersions:train" {:content-type :json
:form-params {:baseProcessorVersion ""
:documentSchema {:description ""
:displayName ""
:entityTypes [{:baseTypes []
:displayName ""
:enumValues {:values []}
:name ""
:properties [{:name ""
:occurrenceType ""
:valueType ""}]}]
:metadata {:documentAllowMultipleLabels false
:documentSplitter false
:prefixedNamingOnProperties false
:skipNamingValidation false}}
:inputData {:testDocuments {:gcsDocuments {:documents [{:gcsUri ""
:mimeType ""}]}
:gcsPrefix {:gcsUriPrefix ""}}
:trainingDocuments {}}
:processorVersion {:createTime ""
:deprecationInfo {:deprecationTime ""
:replacementProcessorVersion ""}
:displayName ""
:documentSchema {}
:googleManaged false
:kmsKeyName ""
:kmsKeyVersionName ""
:latestEvaluation {:aggregateMetrics {:f1Score ""
:falseNegativesCount 0
:falsePositivesCount 0
:groundTruthDocumentCount 0
:groundTruthOccurrencesCount 0
:precision ""
:predictedDocumentCount 0
:predictedOccurrencesCount 0
:recall ""
:totalDocumentsCount 0
:truePositivesCount 0}
:aggregateMetricsExact {}
:evaluation ""
:operation ""}
:name ""
:state ""}}})
require "http/client"
url = "{{baseUrl}}/v1beta3/:parent/processorVersions:train"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\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}}/v1beta3/:parent/processorVersions:train"),
Content = new StringContent("{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\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}}/v1beta3/:parent/processorVersions:train");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:parent/processorVersions:train"
payload := strings.NewReader("{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\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/v1beta3/:parent/processorVersions:train HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1707
{
"baseProcessorVersion": "",
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"inputData": {
"testDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"trainingDocuments": {}
},
"processorVersion": {
"createTime": "",
"deprecationInfo": {
"deprecationTime": "",
"replacementProcessorVersion": ""
},
"displayName": "",
"documentSchema": {},
"googleManaged": false,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": {
"aggregateMetrics": {
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
},
"aggregateMetricsExact": {},
"evaluation": "",
"operation": ""
},
"name": "",
"state": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:parent/processorVersions:train")
.setHeader("content-type", "application/json")
.setBody("{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:parent/processorVersions:train"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\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 \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/processorVersions:train")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:parent/processorVersions:train")
.header("content-type", "application/json")
.body("{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
baseProcessorVersion: '',
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {
values: []
},
name: '',
properties: [
{
name: '',
occurrenceType: '',
valueType: ''
}
]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
inputData: {
testDocuments: {
gcsDocuments: {
documents: [
{
gcsUri: '',
mimeType: ''
}
]
},
gcsPrefix: {
gcsUriPrefix: ''
}
},
trainingDocuments: {}
},
processorVersion: {
createTime: '',
deprecationInfo: {
deprecationTime: '',
replacementProcessorVersion: ''
},
displayName: '',
documentSchema: {},
googleManaged: false,
kmsKeyName: '',
kmsKeyVersionName: '',
latestEvaluation: {
aggregateMetrics: {
f1Score: '',
falseNegativesCount: 0,
falsePositivesCount: 0,
groundTruthDocumentCount: 0,
groundTruthOccurrencesCount: 0,
precision: '',
predictedDocumentCount: 0,
predictedOccurrencesCount: 0,
recall: '',
totalDocumentsCount: 0,
truePositivesCount: 0
},
aggregateMetricsExact: {},
evaluation: '',
operation: ''
},
name: '',
state: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta3/:parent/processorVersions:train');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:parent/processorVersions:train',
headers: {'content-type': 'application/json'},
data: {
baseProcessorVersion: '',
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {values: []},
name: '',
properties: [{name: '', occurrenceType: '', valueType: ''}]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
inputData: {
testDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
},
trainingDocuments: {}
},
processorVersion: {
createTime: '',
deprecationInfo: {deprecationTime: '', replacementProcessorVersion: ''},
displayName: '',
documentSchema: {},
googleManaged: false,
kmsKeyName: '',
kmsKeyVersionName: '',
latestEvaluation: {
aggregateMetrics: {
f1Score: '',
falseNegativesCount: 0,
falsePositivesCount: 0,
groundTruthDocumentCount: 0,
groundTruthOccurrencesCount: 0,
precision: '',
predictedDocumentCount: 0,
predictedOccurrencesCount: 0,
recall: '',
totalDocumentsCount: 0,
truePositivesCount: 0
},
aggregateMetricsExact: {},
evaluation: '',
operation: ''
},
name: '',
state: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:parent/processorVersions:train';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"baseProcessorVersion":"","documentSchema":{"description":"","displayName":"","entityTypes":[{"baseTypes":[],"displayName":"","enumValues":{"values":[]},"name":"","properties":[{"name":"","occurrenceType":"","valueType":""}]}],"metadata":{"documentAllowMultipleLabels":false,"documentSplitter":false,"prefixedNamingOnProperties":false,"skipNamingValidation":false}},"inputData":{"testDocuments":{"gcsDocuments":{"documents":[{"gcsUri":"","mimeType":""}]},"gcsPrefix":{"gcsUriPrefix":""}},"trainingDocuments":{}},"processorVersion":{"createTime":"","deprecationInfo":{"deprecationTime":"","replacementProcessorVersion":""},"displayName":"","documentSchema":{},"googleManaged":false,"kmsKeyName":"","kmsKeyVersionName":"","latestEvaluation":{"aggregateMetrics":{"f1Score":"","falseNegativesCount":0,"falsePositivesCount":0,"groundTruthDocumentCount":0,"groundTruthOccurrencesCount":0,"precision":"","predictedDocumentCount":0,"predictedOccurrencesCount":0,"recall":"","totalDocumentsCount":0,"truePositivesCount":0},"aggregateMetricsExact":{},"evaluation":"","operation":""},"name":"","state":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/v1beta3/:parent/processorVersions:train',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "baseProcessorVersion": "",\n "documentSchema": {\n "description": "",\n "displayName": "",\n "entityTypes": [\n {\n "baseTypes": [],\n "displayName": "",\n "enumValues": {\n "values": []\n },\n "name": "",\n "properties": [\n {\n "name": "",\n "occurrenceType": "",\n "valueType": ""\n }\n ]\n }\n ],\n "metadata": {\n "documentAllowMultipleLabels": false,\n "documentSplitter": false,\n "prefixedNamingOnProperties": false,\n "skipNamingValidation": false\n }\n },\n "inputData": {\n "testDocuments": {\n "gcsDocuments": {\n "documents": [\n {\n "gcsUri": "",\n "mimeType": ""\n }\n ]\n },\n "gcsPrefix": {\n "gcsUriPrefix": ""\n }\n },\n "trainingDocuments": {}\n },\n "processorVersion": {\n "createTime": "",\n "deprecationInfo": {\n "deprecationTime": "",\n "replacementProcessorVersion": ""\n },\n "displayName": "",\n "documentSchema": {},\n "googleManaged": false,\n "kmsKeyName": "",\n "kmsKeyVersionName": "",\n "latestEvaluation": {\n "aggregateMetrics": {\n "f1Score": "",\n "falseNegativesCount": 0,\n "falsePositivesCount": 0,\n "groundTruthDocumentCount": 0,\n "groundTruthOccurrencesCount": 0,\n "precision": "",\n "predictedDocumentCount": 0,\n "predictedOccurrencesCount": 0,\n "recall": "",\n "totalDocumentsCount": 0,\n "truePositivesCount": 0\n },\n "aggregateMetricsExact": {},\n "evaluation": "",\n "operation": ""\n },\n "name": "",\n "state": ""\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 \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:parent/processorVersions:train")
.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/v1beta3/:parent/processorVersions:train',
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({
baseProcessorVersion: '',
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {values: []},
name: '',
properties: [{name: '', occurrenceType: '', valueType: ''}]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
inputData: {
testDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
},
trainingDocuments: {}
},
processorVersion: {
createTime: '',
deprecationInfo: {deprecationTime: '', replacementProcessorVersion: ''},
displayName: '',
documentSchema: {},
googleManaged: false,
kmsKeyName: '',
kmsKeyVersionName: '',
latestEvaluation: {
aggregateMetrics: {
f1Score: '',
falseNegativesCount: 0,
falsePositivesCount: 0,
groundTruthDocumentCount: 0,
groundTruthOccurrencesCount: 0,
precision: '',
predictedDocumentCount: 0,
predictedOccurrencesCount: 0,
recall: '',
totalDocumentsCount: 0,
truePositivesCount: 0
},
aggregateMetricsExact: {},
evaluation: '',
operation: ''
},
name: '',
state: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:parent/processorVersions:train',
headers: {'content-type': 'application/json'},
body: {
baseProcessorVersion: '',
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {values: []},
name: '',
properties: [{name: '', occurrenceType: '', valueType: ''}]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
inputData: {
testDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
},
trainingDocuments: {}
},
processorVersion: {
createTime: '',
deprecationInfo: {deprecationTime: '', replacementProcessorVersion: ''},
displayName: '',
documentSchema: {},
googleManaged: false,
kmsKeyName: '',
kmsKeyVersionName: '',
latestEvaluation: {
aggregateMetrics: {
f1Score: '',
falseNegativesCount: 0,
falsePositivesCount: 0,
groundTruthDocumentCount: 0,
groundTruthOccurrencesCount: 0,
precision: '',
predictedDocumentCount: 0,
predictedOccurrencesCount: 0,
recall: '',
totalDocumentsCount: 0,
truePositivesCount: 0
},
aggregateMetricsExact: {},
evaluation: '',
operation: ''
},
name: '',
state: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/v1beta3/:parent/processorVersions:train');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
baseProcessorVersion: '',
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {
values: []
},
name: '',
properties: [
{
name: '',
occurrenceType: '',
valueType: ''
}
]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
inputData: {
testDocuments: {
gcsDocuments: {
documents: [
{
gcsUri: '',
mimeType: ''
}
]
},
gcsPrefix: {
gcsUriPrefix: ''
}
},
trainingDocuments: {}
},
processorVersion: {
createTime: '',
deprecationInfo: {
deprecationTime: '',
replacementProcessorVersion: ''
},
displayName: '',
documentSchema: {},
googleManaged: false,
kmsKeyName: '',
kmsKeyVersionName: '',
latestEvaluation: {
aggregateMetrics: {
f1Score: '',
falseNegativesCount: 0,
falsePositivesCount: 0,
groundTruthDocumentCount: 0,
groundTruthOccurrencesCount: 0,
precision: '',
predictedDocumentCount: 0,
predictedOccurrencesCount: 0,
recall: '',
totalDocumentsCount: 0,
truePositivesCount: 0
},
aggregateMetricsExact: {},
evaluation: '',
operation: ''
},
name: '',
state: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:parent/processorVersions:train',
headers: {'content-type': 'application/json'},
data: {
baseProcessorVersion: '',
documentSchema: {
description: '',
displayName: '',
entityTypes: [
{
baseTypes: [],
displayName: '',
enumValues: {values: []},
name: '',
properties: [{name: '', occurrenceType: '', valueType: ''}]
}
],
metadata: {
documentAllowMultipleLabels: false,
documentSplitter: false,
prefixedNamingOnProperties: false,
skipNamingValidation: false
}
},
inputData: {
testDocuments: {
gcsDocuments: {documents: [{gcsUri: '', mimeType: ''}]},
gcsPrefix: {gcsUriPrefix: ''}
},
trainingDocuments: {}
},
processorVersion: {
createTime: '',
deprecationInfo: {deprecationTime: '', replacementProcessorVersion: ''},
displayName: '',
documentSchema: {},
googleManaged: false,
kmsKeyName: '',
kmsKeyVersionName: '',
latestEvaluation: {
aggregateMetrics: {
f1Score: '',
falseNegativesCount: 0,
falsePositivesCount: 0,
groundTruthDocumentCount: 0,
groundTruthOccurrencesCount: 0,
precision: '',
predictedDocumentCount: 0,
predictedOccurrencesCount: 0,
recall: '',
totalDocumentsCount: 0,
truePositivesCount: 0
},
aggregateMetricsExact: {},
evaluation: '',
operation: ''
},
name: '',
state: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:parent/processorVersions:train';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"baseProcessorVersion":"","documentSchema":{"description":"","displayName":"","entityTypes":[{"baseTypes":[],"displayName":"","enumValues":{"values":[]},"name":"","properties":[{"name":"","occurrenceType":"","valueType":""}]}],"metadata":{"documentAllowMultipleLabels":false,"documentSplitter":false,"prefixedNamingOnProperties":false,"skipNamingValidation":false}},"inputData":{"testDocuments":{"gcsDocuments":{"documents":[{"gcsUri":"","mimeType":""}]},"gcsPrefix":{"gcsUriPrefix":""}},"trainingDocuments":{}},"processorVersion":{"createTime":"","deprecationInfo":{"deprecationTime":"","replacementProcessorVersion":""},"displayName":"","documentSchema":{},"googleManaged":false,"kmsKeyName":"","kmsKeyVersionName":"","latestEvaluation":{"aggregateMetrics":{"f1Score":"","falseNegativesCount":0,"falsePositivesCount":0,"groundTruthDocumentCount":0,"groundTruthOccurrencesCount":0,"precision":"","predictedDocumentCount":0,"predictedOccurrencesCount":0,"recall":"","totalDocumentsCount":0,"truePositivesCount":0},"aggregateMetricsExact":{},"evaluation":"","operation":""},"name":"","state":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"baseProcessorVersion": @"",
@"documentSchema": @{ @"description": @"", @"displayName": @"", @"entityTypes": @[ @{ @"baseTypes": @[ ], @"displayName": @"", @"enumValues": @{ @"values": @[ ] }, @"name": @"", @"properties": @[ @{ @"name": @"", @"occurrenceType": @"", @"valueType": @"" } ] } ], @"metadata": @{ @"documentAllowMultipleLabels": @NO, @"documentSplitter": @NO, @"prefixedNamingOnProperties": @NO, @"skipNamingValidation": @NO } },
@"inputData": @{ @"testDocuments": @{ @"gcsDocuments": @{ @"documents": @[ @{ @"gcsUri": @"", @"mimeType": @"" } ] }, @"gcsPrefix": @{ @"gcsUriPrefix": @"" } }, @"trainingDocuments": @{ } },
@"processorVersion": @{ @"createTime": @"", @"deprecationInfo": @{ @"deprecationTime": @"", @"replacementProcessorVersion": @"" }, @"displayName": @"", @"documentSchema": @{ }, @"googleManaged": @NO, @"kmsKeyName": @"", @"kmsKeyVersionName": @"", @"latestEvaluation": @{ @"aggregateMetrics": @{ @"f1Score": @"", @"falseNegativesCount": @0, @"falsePositivesCount": @0, @"groundTruthDocumentCount": @0, @"groundTruthOccurrencesCount": @0, @"precision": @"", @"predictedDocumentCount": @0, @"predictedOccurrencesCount": @0, @"recall": @"", @"totalDocumentsCount": @0, @"truePositivesCount": @0 }, @"aggregateMetricsExact": @{ }, @"evaluation": @"", @"operation": @"" }, @"name": @"", @"state": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta3/:parent/processorVersions:train"]
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}}/v1beta3/:parent/processorVersions:train" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:parent/processorVersions:train",
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([
'baseProcessorVersion' => '',
'documentSchema' => [
'description' => '',
'displayName' => '',
'entityTypes' => [
[
'baseTypes' => [
],
'displayName' => '',
'enumValues' => [
'values' => [
]
],
'name' => '',
'properties' => [
[
'name' => '',
'occurrenceType' => '',
'valueType' => ''
]
]
]
],
'metadata' => [
'documentAllowMultipleLabels' => null,
'documentSplitter' => null,
'prefixedNamingOnProperties' => null,
'skipNamingValidation' => null
]
],
'inputData' => [
'testDocuments' => [
'gcsDocuments' => [
'documents' => [
[
'gcsUri' => '',
'mimeType' => ''
]
]
],
'gcsPrefix' => [
'gcsUriPrefix' => ''
]
],
'trainingDocuments' => [
]
],
'processorVersion' => [
'createTime' => '',
'deprecationInfo' => [
'deprecationTime' => '',
'replacementProcessorVersion' => ''
],
'displayName' => '',
'documentSchema' => [
],
'googleManaged' => null,
'kmsKeyName' => '',
'kmsKeyVersionName' => '',
'latestEvaluation' => [
'aggregateMetrics' => [
'f1Score' => '',
'falseNegativesCount' => 0,
'falsePositivesCount' => 0,
'groundTruthDocumentCount' => 0,
'groundTruthOccurrencesCount' => 0,
'precision' => '',
'predictedDocumentCount' => 0,
'predictedOccurrencesCount' => 0,
'recall' => '',
'totalDocumentsCount' => 0,
'truePositivesCount' => 0
],
'aggregateMetricsExact' => [
],
'evaluation' => '',
'operation' => ''
],
'name' => '',
'state' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/v1beta3/:parent/processorVersions:train', [
'body' => '{
"baseProcessorVersion": "",
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"inputData": {
"testDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"trainingDocuments": {}
},
"processorVersion": {
"createTime": "",
"deprecationInfo": {
"deprecationTime": "",
"replacementProcessorVersion": ""
},
"displayName": "",
"documentSchema": {},
"googleManaged": false,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": {
"aggregateMetrics": {
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
},
"aggregateMetricsExact": {},
"evaluation": "",
"operation": ""
},
"name": "",
"state": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:parent/processorVersions:train');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'baseProcessorVersion' => '',
'documentSchema' => [
'description' => '',
'displayName' => '',
'entityTypes' => [
[
'baseTypes' => [
],
'displayName' => '',
'enumValues' => [
'values' => [
]
],
'name' => '',
'properties' => [
[
'name' => '',
'occurrenceType' => '',
'valueType' => ''
]
]
]
],
'metadata' => [
'documentAllowMultipleLabels' => null,
'documentSplitter' => null,
'prefixedNamingOnProperties' => null,
'skipNamingValidation' => null
]
],
'inputData' => [
'testDocuments' => [
'gcsDocuments' => [
'documents' => [
[
'gcsUri' => '',
'mimeType' => ''
]
]
],
'gcsPrefix' => [
'gcsUriPrefix' => ''
]
],
'trainingDocuments' => [
]
],
'processorVersion' => [
'createTime' => '',
'deprecationInfo' => [
'deprecationTime' => '',
'replacementProcessorVersion' => ''
],
'displayName' => '',
'documentSchema' => [
],
'googleManaged' => null,
'kmsKeyName' => '',
'kmsKeyVersionName' => '',
'latestEvaluation' => [
'aggregateMetrics' => [
'f1Score' => '',
'falseNegativesCount' => 0,
'falsePositivesCount' => 0,
'groundTruthDocumentCount' => 0,
'groundTruthOccurrencesCount' => 0,
'precision' => '',
'predictedDocumentCount' => 0,
'predictedOccurrencesCount' => 0,
'recall' => '',
'totalDocumentsCount' => 0,
'truePositivesCount' => 0
],
'aggregateMetricsExact' => [
],
'evaluation' => '',
'operation' => ''
],
'name' => '',
'state' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'baseProcessorVersion' => '',
'documentSchema' => [
'description' => '',
'displayName' => '',
'entityTypes' => [
[
'baseTypes' => [
],
'displayName' => '',
'enumValues' => [
'values' => [
]
],
'name' => '',
'properties' => [
[
'name' => '',
'occurrenceType' => '',
'valueType' => ''
]
]
]
],
'metadata' => [
'documentAllowMultipleLabels' => null,
'documentSplitter' => null,
'prefixedNamingOnProperties' => null,
'skipNamingValidation' => null
]
],
'inputData' => [
'testDocuments' => [
'gcsDocuments' => [
'documents' => [
[
'gcsUri' => '',
'mimeType' => ''
]
]
],
'gcsPrefix' => [
'gcsUriPrefix' => ''
]
],
'trainingDocuments' => [
]
],
'processorVersion' => [
'createTime' => '',
'deprecationInfo' => [
'deprecationTime' => '',
'replacementProcessorVersion' => ''
],
'displayName' => '',
'documentSchema' => [
],
'googleManaged' => null,
'kmsKeyName' => '',
'kmsKeyVersionName' => '',
'latestEvaluation' => [
'aggregateMetrics' => [
'f1Score' => '',
'falseNegativesCount' => 0,
'falsePositivesCount' => 0,
'groundTruthDocumentCount' => 0,
'groundTruthOccurrencesCount' => 0,
'precision' => '',
'predictedDocumentCount' => 0,
'predictedOccurrencesCount' => 0,
'recall' => '',
'totalDocumentsCount' => 0,
'truePositivesCount' => 0
],
'aggregateMetricsExact' => [
],
'evaluation' => '',
'operation' => ''
],
'name' => '',
'state' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1beta3/:parent/processorVersions:train');
$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}}/v1beta3/:parent/processorVersions:train' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"baseProcessorVersion": "",
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"inputData": {
"testDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"trainingDocuments": {}
},
"processorVersion": {
"createTime": "",
"deprecationInfo": {
"deprecationTime": "",
"replacementProcessorVersion": ""
},
"displayName": "",
"documentSchema": {},
"googleManaged": false,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": {
"aggregateMetrics": {
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
},
"aggregateMetricsExact": {},
"evaluation": "",
"operation": ""
},
"name": "",
"state": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:parent/processorVersions:train' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"baseProcessorVersion": "",
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"inputData": {
"testDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"trainingDocuments": {}
},
"processorVersion": {
"createTime": "",
"deprecationInfo": {
"deprecationTime": "",
"replacementProcessorVersion": ""
},
"displayName": "",
"documentSchema": {},
"googleManaged": false,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": {
"aggregateMetrics": {
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
},
"aggregateMetricsExact": {},
"evaluation": "",
"operation": ""
},
"name": "",
"state": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta3/:parent/processorVersions:train", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:parent/processorVersions:train"
payload = {
"baseProcessorVersion": "",
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": { "values": [] },
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": False,
"documentSplitter": False,
"prefixedNamingOnProperties": False,
"skipNamingValidation": False
}
},
"inputData": {
"testDocuments": {
"gcsDocuments": { "documents": [
{
"gcsUri": "",
"mimeType": ""
}
] },
"gcsPrefix": { "gcsUriPrefix": "" }
},
"trainingDocuments": {}
},
"processorVersion": {
"createTime": "",
"deprecationInfo": {
"deprecationTime": "",
"replacementProcessorVersion": ""
},
"displayName": "",
"documentSchema": {},
"googleManaged": False,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": {
"aggregateMetrics": {
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
},
"aggregateMetricsExact": {},
"evaluation": "",
"operation": ""
},
"name": "",
"state": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:parent/processorVersions:train"
payload <- "{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\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}}/v1beta3/:parent/processorVersions:train")
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 \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\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/v1beta3/:parent/processorVersions:train') do |req|
req.body = "{\n \"baseProcessorVersion\": \"\",\n \"documentSchema\": {\n \"description\": \"\",\n \"displayName\": \"\",\n \"entityTypes\": [\n {\n \"baseTypes\": [],\n \"displayName\": \"\",\n \"enumValues\": {\n \"values\": []\n },\n \"name\": \"\",\n \"properties\": [\n {\n \"name\": \"\",\n \"occurrenceType\": \"\",\n \"valueType\": \"\"\n }\n ]\n }\n ],\n \"metadata\": {\n \"documentAllowMultipleLabels\": false,\n \"documentSplitter\": false,\n \"prefixedNamingOnProperties\": false,\n \"skipNamingValidation\": false\n }\n },\n \"inputData\": {\n \"testDocuments\": {\n \"gcsDocuments\": {\n \"documents\": [\n {\n \"gcsUri\": \"\",\n \"mimeType\": \"\"\n }\n ]\n },\n \"gcsPrefix\": {\n \"gcsUriPrefix\": \"\"\n }\n },\n \"trainingDocuments\": {}\n },\n \"processorVersion\": {\n \"createTime\": \"\",\n \"deprecationInfo\": {\n \"deprecationTime\": \"\",\n \"replacementProcessorVersion\": \"\"\n },\n \"displayName\": \"\",\n \"documentSchema\": {},\n \"googleManaged\": false,\n \"kmsKeyName\": \"\",\n \"kmsKeyVersionName\": \"\",\n \"latestEvaluation\": {\n \"aggregateMetrics\": {\n \"f1Score\": \"\",\n \"falseNegativesCount\": 0,\n \"falsePositivesCount\": 0,\n \"groundTruthDocumentCount\": 0,\n \"groundTruthOccurrencesCount\": 0,\n \"precision\": \"\",\n \"predictedDocumentCount\": 0,\n \"predictedOccurrencesCount\": 0,\n \"recall\": \"\",\n \"totalDocumentsCount\": 0,\n \"truePositivesCount\": 0\n },\n \"aggregateMetricsExact\": {},\n \"evaluation\": \"\",\n \"operation\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:parent/processorVersions:train";
let payload = json!({
"baseProcessorVersion": "",
"documentSchema": json!({
"description": "",
"displayName": "",
"entityTypes": (
json!({
"baseTypes": (),
"displayName": "",
"enumValues": json!({"values": ()}),
"name": "",
"properties": (
json!({
"name": "",
"occurrenceType": "",
"valueType": ""
})
)
})
),
"metadata": json!({
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
})
}),
"inputData": json!({
"testDocuments": json!({
"gcsDocuments": json!({"documents": (
json!({
"gcsUri": "",
"mimeType": ""
})
)}),
"gcsPrefix": json!({"gcsUriPrefix": ""})
}),
"trainingDocuments": json!({})
}),
"processorVersion": json!({
"createTime": "",
"deprecationInfo": json!({
"deprecationTime": "",
"replacementProcessorVersion": ""
}),
"displayName": "",
"documentSchema": json!({}),
"googleManaged": false,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": json!({
"aggregateMetrics": json!({
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
}),
"aggregateMetricsExact": json!({}),
"evaluation": "",
"operation": ""
}),
"name": "",
"state": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1beta3/:parent/processorVersions:train \
--header 'content-type: application/json' \
--data '{
"baseProcessorVersion": "",
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"inputData": {
"testDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"trainingDocuments": {}
},
"processorVersion": {
"createTime": "",
"deprecationInfo": {
"deprecationTime": "",
"replacementProcessorVersion": ""
},
"displayName": "",
"documentSchema": {},
"googleManaged": false,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": {
"aggregateMetrics": {
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
},
"aggregateMetricsExact": {},
"evaluation": "",
"operation": ""
},
"name": "",
"state": ""
}
}'
echo '{
"baseProcessorVersion": "",
"documentSchema": {
"description": "",
"displayName": "",
"entityTypes": [
{
"baseTypes": [],
"displayName": "",
"enumValues": {
"values": []
},
"name": "",
"properties": [
{
"name": "",
"occurrenceType": "",
"valueType": ""
}
]
}
],
"metadata": {
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
}
},
"inputData": {
"testDocuments": {
"gcsDocuments": {
"documents": [
{
"gcsUri": "",
"mimeType": ""
}
]
},
"gcsPrefix": {
"gcsUriPrefix": ""
}
},
"trainingDocuments": {}
},
"processorVersion": {
"createTime": "",
"deprecationInfo": {
"deprecationTime": "",
"replacementProcessorVersion": ""
},
"displayName": "",
"documentSchema": {},
"googleManaged": false,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": {
"aggregateMetrics": {
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
},
"aggregateMetricsExact": {},
"evaluation": "",
"operation": ""
},
"name": "",
"state": ""
}
}' | \
http POST {{baseUrl}}/v1beta3/:parent/processorVersions:train \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "baseProcessorVersion": "",\n "documentSchema": {\n "description": "",\n "displayName": "",\n "entityTypes": [\n {\n "baseTypes": [],\n "displayName": "",\n "enumValues": {\n "values": []\n },\n "name": "",\n "properties": [\n {\n "name": "",\n "occurrenceType": "",\n "valueType": ""\n }\n ]\n }\n ],\n "metadata": {\n "documentAllowMultipleLabels": false,\n "documentSplitter": false,\n "prefixedNamingOnProperties": false,\n "skipNamingValidation": false\n }\n },\n "inputData": {\n "testDocuments": {\n "gcsDocuments": {\n "documents": [\n {\n "gcsUri": "",\n "mimeType": ""\n }\n ]\n },\n "gcsPrefix": {\n "gcsUriPrefix": ""\n }\n },\n "trainingDocuments": {}\n },\n "processorVersion": {\n "createTime": "",\n "deprecationInfo": {\n "deprecationTime": "",\n "replacementProcessorVersion": ""\n },\n "displayName": "",\n "documentSchema": {},\n "googleManaged": false,\n "kmsKeyName": "",\n "kmsKeyVersionName": "",\n "latestEvaluation": {\n "aggregateMetrics": {\n "f1Score": "",\n "falseNegativesCount": 0,\n "falsePositivesCount": 0,\n "groundTruthDocumentCount": 0,\n "groundTruthOccurrencesCount": 0,\n "precision": "",\n "predictedDocumentCount": 0,\n "predictedOccurrencesCount": 0,\n "recall": "",\n "totalDocumentsCount": 0,\n "truePositivesCount": 0\n },\n "aggregateMetricsExact": {},\n "evaluation": "",\n "operation": ""\n },\n "name": "",\n "state": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v1beta3/:parent/processorVersions:train
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"baseProcessorVersion": "",
"documentSchema": [
"description": "",
"displayName": "",
"entityTypes": [
[
"baseTypes": [],
"displayName": "",
"enumValues": ["values": []],
"name": "",
"properties": [
[
"name": "",
"occurrenceType": "",
"valueType": ""
]
]
]
],
"metadata": [
"documentAllowMultipleLabels": false,
"documentSplitter": false,
"prefixedNamingOnProperties": false,
"skipNamingValidation": false
]
],
"inputData": [
"testDocuments": [
"gcsDocuments": ["documents": [
[
"gcsUri": "",
"mimeType": ""
]
]],
"gcsPrefix": ["gcsUriPrefix": ""]
],
"trainingDocuments": []
],
"processorVersion": [
"createTime": "",
"deprecationInfo": [
"deprecationTime": "",
"replacementProcessorVersion": ""
],
"displayName": "",
"documentSchema": [],
"googleManaged": false,
"kmsKeyName": "",
"kmsKeyVersionName": "",
"latestEvaluation": [
"aggregateMetrics": [
"f1Score": "",
"falseNegativesCount": 0,
"falsePositivesCount": 0,
"groundTruthDocumentCount": 0,
"groundTruthOccurrencesCount": 0,
"precision": "",
"predictedDocumentCount": 0,
"predictedOccurrencesCount": 0,
"recall": "",
"totalDocumentsCount": 0,
"truePositivesCount": 0
],
"aggregateMetricsExact": [],
"evaluation": "",
"operation": ""
],
"name": "",
"state": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:parent/processorVersions:train")! 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
documentai.projects.locations.processors.processorVersions.undeploy
{{baseUrl}}/v1beta3/:name:undeploy
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}}/v1beta3/:name:undeploy");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:name:undeploy" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v1beta3/:name:undeploy"
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}}/v1beta3/:name:undeploy"),
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}}/v1beta3/:name:undeploy");
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}}/v1beta3/:name:undeploy"
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/v1beta3/:name:undeploy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:name:undeploy")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:name:undeploy"))
.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}}/v1beta3/:name:undeploy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:name:undeploy")
.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}}/v1beta3/:name:undeploy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:undeploy',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:name:undeploy';
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}}/v1beta3/:name:undeploy',
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}}/v1beta3/:name:undeploy")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1beta3/:name:undeploy',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:name:undeploy',
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}}/v1beta3/:name:undeploy');
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}}/v1beta3/:name:undeploy',
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}}/v1beta3/:name:undeploy';
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}}/v1beta3/:name:undeploy"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/v1beta3/:name:undeploy" 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}}/v1beta3/:name:undeploy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
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}}/v1beta3/:name:undeploy', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:name:undeploy');
$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}}/v1beta3/:name:undeploy');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1beta3/:name:undeploy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:name:undeploy' -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/v1beta3/:name:undeploy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:name:undeploy"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:name:undeploy"
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}}/v1beta3/:name:undeploy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{}"
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/v1beta3/:name:undeploy') 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}}/v1beta3/:name:undeploy";
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}}/v1beta3/:name:undeploy \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v1beta3/:name:undeploy \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v1beta3/:name:undeploy
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}}/v1beta3/:name:undeploy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
documentai.projects.locations.processors.setDefaultProcessorVersion
{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion
QUERY PARAMS
processor
BODY json
{
"defaultProcessorVersion": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion");
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 \"defaultProcessorVersion\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion" {:content-type :json
:form-params {:defaultProcessorVersion ""}})
require "http/client"
url = "{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"defaultProcessorVersion\": \"\"\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}}/v1beta3/:processor:setDefaultProcessorVersion"),
Content = new StringContent("{\n \"defaultProcessorVersion\": \"\"\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}}/v1beta3/:processor:setDefaultProcessorVersion");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"defaultProcessorVersion\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion"
payload := strings.NewReader("{\n \"defaultProcessorVersion\": \"\"\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/v1beta3/:processor:setDefaultProcessorVersion HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 35
{
"defaultProcessorVersion": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion")
.setHeader("content-type", "application/json")
.setBody("{\n \"defaultProcessorVersion\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"defaultProcessorVersion\": \"\"\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 \"defaultProcessorVersion\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion")
.header("content-type", "application/json")
.body("{\n \"defaultProcessorVersion\": \"\"\n}")
.asString();
const data = JSON.stringify({
defaultProcessorVersion: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion',
headers: {'content-type': 'application/json'},
data: {defaultProcessorVersion: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"defaultProcessorVersion":""}'
};
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}}/v1beta3/:processor:setDefaultProcessorVersion',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "defaultProcessorVersion": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"defaultProcessorVersion\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion")
.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/v1beta3/:processor:setDefaultProcessorVersion',
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({defaultProcessorVersion: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion',
headers: {'content-type': 'application/json'},
body: {defaultProcessorVersion: ''},
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}}/v1beta3/:processor:setDefaultProcessorVersion');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
defaultProcessorVersion: ''
});
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}}/v1beta3/:processor:setDefaultProcessorVersion',
headers: {'content-type': 'application/json'},
data: {defaultProcessorVersion: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"defaultProcessorVersion":""}'
};
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 = @{ @"defaultProcessorVersion": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion"]
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}}/v1beta3/:processor:setDefaultProcessorVersion" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"defaultProcessorVersion\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion",
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([
'defaultProcessorVersion' => ''
]),
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}}/v1beta3/:processor:setDefaultProcessorVersion', [
'body' => '{
"defaultProcessorVersion": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'defaultProcessorVersion' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'defaultProcessorVersion' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion');
$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}}/v1beta3/:processor:setDefaultProcessorVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"defaultProcessorVersion": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"defaultProcessorVersion": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"defaultProcessorVersion\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1beta3/:processor:setDefaultProcessorVersion", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion"
payload = { "defaultProcessorVersion": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion"
payload <- "{\n \"defaultProcessorVersion\": \"\"\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}}/v1beta3/:processor:setDefaultProcessorVersion")
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 \"defaultProcessorVersion\": \"\"\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/v1beta3/:processor:setDefaultProcessorVersion') do |req|
req.body = "{\n \"defaultProcessorVersion\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion";
let payload = json!({"defaultProcessorVersion": ""});
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}}/v1beta3/:processor:setDefaultProcessorVersion \
--header 'content-type: application/json' \
--data '{
"defaultProcessorVersion": ""
}'
echo '{
"defaultProcessorVersion": ""
}' | \
http POST {{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "defaultProcessorVersion": ""\n}' \
--output-document \
- {{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["defaultProcessorVersion": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1beta3/:processor:setDefaultProcessorVersion")! 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()