curl --request POST \
--url 'http://localhost:7575/v2/commands/command-completions' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"parties": [
"<string>"
],
"beginExclusive": 123
}'
import json
import requests
url = "http://localhost:7575/v2/commands/command-completions"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"parties": [
"<string>"
],
"beginExclusive": 123
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('http://localhost:7575/v2/commands/command-completions', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"parties": [
"<string>"
],
"beginExclusive": 123
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://localhost:7575/v2/commands/command-completions',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:7575/v2/commands/command-completions", bytes.NewBufferString(`{
"parties": [
"<string>"
],
"beginExclusive": 123
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:7575/v2/commands/command-completions"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('http://localhost:7575/v2/commands/command-completions')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
[
{
"completionResponse": {
"Completion": {
"value": {
"commandId": "<string>",
"status": {
"code": 123,
"message": "<string>",
"details": [
"<object>"
]
},
"updateId": "<string>",
"userId": "<string>",
"actAs": [
"<string>"
],
"submissionId": "<string>",
"deduplicationPeriod": "<object>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"offset": 123,
"synchronizerTime": {
"synchronizerId": "<string>",
"recordTime": "<string>"
},
"paidTrafficCost": 123
}
}
}
}
]
<string>
{
"code": "<string>",
"cause": "<string>",
"correlationId": "<string>",
"traceId": "<string>",
"context": {},
"resources": [
[
"<string>"
]
],
"errorCategory": 123,
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": false
}
POST /v2/commands/command-completions
Query completions list (blocking call) Subscribe to command completion events. This streaming endpoint provides more flexibility in filtering than the predecessor CompletionStream. Notice: This endpoint should be used for small results set. When number of results exceeded node configuration limit (http-list-max-elements-limit) there will be an error (413 Content Too Large) returned.
curl --request POST \
--url 'http://localhost:7575/v2/commands/command-completions' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"parties": [
"<string>"
],
"beginExclusive": 123
}'
import json
import requests
url = "http://localhost:7575/v2/commands/command-completions"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"parties": [
"<string>"
],
"beginExclusive": 123
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('http://localhost:7575/v2/commands/command-completions', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"parties": [
"<string>"
],
"beginExclusive": 123
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://localhost:7575/v2/commands/command-completions',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:7575/v2/commands/command-completions", bytes.NewBufferString(`{
"parties": [
"<string>"
],
"beginExclusive": 123
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:7575/v2/commands/command-completions"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('http://localhost:7575/v2/commands/command-completions')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
[
{
"completionResponse": {
"Completion": {
"value": {
"commandId": "<string>",
"status": {
"code": 123,
"message": "<string>",
"details": [
"<object>"
]
},
"updateId": "<string>",
"userId": "<string>",
"actAs": [
"<string>"
],
"submissionId": "<string>",
"deduplicationPeriod": "<object>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"offset": 123,
"synchronizerTime": {
"synchronizerId": "<string>",
"recordTime": "<string>"
},
"paidTrafficCost": 123
}
}
}
}
]
<string>
{
"code": "<string>",
"cause": "<string>",
"correlationId": "<string>",
"traceId": "<string>",
"context": {},
"resources": [
[
"<string>"
]
],
"errorCategory": 123,
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": false
}
Query completions list (blocking call) Subscribe to command completion events. This streaming endpoint provides more flexibility in filtering than the predecessor CompletionStream. Notice: This endpoint should be used for small results set. When number of results exceeded node configuration limit (http-list-max-elements-limit) there will be an error (413 Content Too Large) returned.
curl --request POST \
--url 'http://localhost:7575/v2/commands/command-completions' \
--header 'Authorization: Bearer $TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"parties": [
"<string>"
],
"beginExclusive": 123
}'
import json
import requests
url = "http://localhost:7575/v2/commands/command-completions"
headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}
payload = json.loads(r'''{
"parties": [
"<string>"
],
"beginExclusive": 123
}''')
response = requests.request(
"POST", url, headers=headers, json=payload
)
print(response.text)
const response = await fetch('http://localhost:7575/v2/commands/command-completions', {
method: 'POST',
headers: {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
},
body: JSON.stringify({
"parties": [
"<string>"
],
"beginExclusive": 123
}),
});
console.log(await response.text());
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'http://localhost:7575/v2/commands/command-completions',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => <<<'JSON'
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
echo $response;
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "http://localhost:7575/v2/commands/command-completions", bytes.NewBufferString(`{
"parties": [
"<string>"
],
"beginExclusive": 123
}`))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
response, _ := http.DefaultClient.Do(req)
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
var request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:7575/v2/commands/command-completions"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
"""))
.build();
var response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
require 'net/http'
require 'uri'
uri = URI('http://localhost:7575/v2/commands/command-completions')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer <token>'
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"parties": [
"<string>"
],
"beginExclusive": 123
}
JSON
response = Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(request)
end
puts response.body
[
{
"completionResponse": {
"Completion": {
"value": {
"commandId": "<string>",
"status": {
"code": 123,
"message": "<string>",
"details": [
"<object>"
]
},
"updateId": "<string>",
"userId": "<string>",
"actAs": [
"<string>"
],
"submissionId": "<string>",
"deduplicationPeriod": "<object>",
"traceContext": {
"traceparent": "<string>",
"tracestate": "<string>"
},
"offset": 123,
"synchronizerTime": {
"synchronizerId": "<string>",
"recordTime": "<string>"
},
"paidTrafficCost": 123
}
}
}
}
]
<string>
{
"code": "<string>",
"cause": "<string>",
"correlationId": "<string>",
"traceId": "<string>",
"context": {},
"resources": [
[
"<string>"
]
],
"errorCategory": 123,
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": false
}
Authorizations
httpAuth
Authorization: Bearer <token>. Ledger API standard JWT tokenapiKeyAuth
Query parameters
integer (int64).maximum number of elements to return, this param is ignored if is bigger than server settinginteger (int64).timeout to complete and send result if no new elements are received (for open ended streams)Body
act_as parties in the given set of parties. Only Ledger API users with CanReadAsAnyParty permission allowed to provide no parties. Must be a valid PartyIdString (as described in value.proto). Optional: can be emptyinteger (int64).This optional field indicates the minimum offset for completions. This can be used to resume an earlier completion stream. If not set the ledger uses the ledger begin offset instead. If specified, it must be a valid absolute offset (positive integer) or zero (ledger begin offset). If the ledger has been pruned, this parameter must be specified and greater than the pruning offset. (the pruning offset is accessible on the StateService.GetLatestPrunedOffsets endpoint) OptionalResponses
200
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
value.proto). Requiredvalue.proto). Optionalcommands.proto. Must be a valid UserIdString (as described in value.proto). Requiredact_as parties from commands.proto filtered to the requesting parties in CompletionStreamRequest. The order of the parties need not be the same as in the submission. Each element must be a valid PartyIdString (as described in value.proto). Required: must be non-emptycommands.proto. Must be a valid LedgerString (as described in value.proto). OptionalCommands.deduplication_period. The ledger may convert the deduplication period into other descriptions and extend the period in implementation-specified ways. Used to audit the deduplication guarantee described in commands.proto. The deduplication guarantee applies even if the completion omits this field. OptionalShow child attributes
Show child attributes
Show child attributes
Show child attributes
offset field to retrieve the transaction using UpdateService.GetUpdateByOffset on the same participant node; or alternatively use the update_id field to retrieve the transaction using UpdateService.GetUpdateById on any participant node that sees the transaction. Note: for completions processed before the participant started serving traffic cost on the Ledger API, this field will be set to zero. Additionally, the total cost incurred by the submitting node for the submission of the transaction may be greater than the reported cost, for example if retries were issued due to failed submissions to the synchronizer. The cost reported here is the one paid for ordering the confirmation request. OptionalShow child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
community/ledger-api/README.md. Must be a valid absolute offset (positive integer). Required400
Invalid value, Invalid value for: body, Invalid value for: query parameter limit, Invalid value for: query parameter stream_idle_timeout_msdefault
History
3.5