POST /v2/events/events-by-contract-id
curl --request POST \
--url https://api.example.com/v2/events/events-by-contract-id \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contractId": "<string>",
"eventFormat": {
"filtersByParty": {},
"filtersForAnyParty": {
"cumulative": [
{
"identifierFilter": {
"Empty": {}
}
}
]
},
"verbose": true
}
}
'import requests
url = "https://api.example.com/v2/events/events-by-contract-id"
payload = {
"contractId": "<string>",
"eventFormat": {
"filtersByParty": {},
"filtersForAnyParty": { "cumulative": [{ "identifierFilter": { "Empty": {} } }] },
"verbose": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contractId: '<string>',
eventFormat: {
filtersByParty: {},
filtersForAnyParty: {cumulative: [{identifierFilter: {Empty: {}}}]},
verbose: true
}
})
};
fetch('https://api.example.com/v2/events/events-by-contract-id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v2/events/events-by-contract-id",
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([
'contractId' => '<string>',
'eventFormat' => [
'filtersByParty' => [
],
'filtersForAnyParty' => [
'cumulative' => [
[
'identifierFilter' => [
'Empty' => [
]
]
]
]
],
'verbose' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v2/events/events-by-contract-id"
payload := strings.NewReader("{\n \"contractId\": \"<string>\",\n \"eventFormat\": {\n \"filtersByParty\": {},\n \"filtersForAnyParty\": {\n \"cumulative\": [\n {\n \"identifierFilter\": {\n \"Empty\": {}\n }\n }\n ]\n },\n \"verbose\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v2/events/events-by-contract-id")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contractId\": \"<string>\",\n \"eventFormat\": {\n \"filtersByParty\": {},\n \"filtersForAnyParty\": {\n \"cumulative\": [\n {\n \"identifierFilter\": {\n \"Empty\": {}\n }\n }\n ]\n },\n \"verbose\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/events/events-by-contract-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contractId\": \"<string>\",\n \"eventFormat\": {\n \"filtersByParty\": {},\n \"filtersForAnyParty\": {\n \"cumulative\": [\n {\n \"identifierFilter\": {\n \"Empty\": {}\n }\n }\n ]\n },\n \"verbose\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"created": {
"createdEvent": {
"offset": 123,
"nodeId": 123,
"contractId": "<string>",
"templateId": "<string>",
"createArgument": "<unknown>",
"witnessParties": [
"<string>"
],
"signatories": [
"<string>"
],
"createdAt": "<string>",
"packageName": "<string>",
"representativePackageId": "<string>",
"acsDelta": true,
"contractKey": "<unknown>",
"contractKeyHash": "<string>",
"createdEventBlob": "<string>",
"interfaceViews": [
{
"interfaceId": "<string>",
"viewStatus": {
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "<string>",
"unknownFields": {
"fields": {}
},
"valueDecoded": "<string>"
}
]
},
"viewValue": "<unknown>",
"implementationPackageId": "<string>"
}
],
"observers": [
"<string>"
]
},
"synchronizerId": "<string>"
},
"archived": {
"archivedEvent": {
"offset": 123,
"nodeId": 123,
"contractId": "<string>",
"templateId": "<string>",
"witnessParties": [
"<string>"
],
"packageName": "<string>",
"implementedInterfaces": [
"<string>"
]
},
"synchronizerId": "<string>"
}
}"<string>"{
"code": "<string>",
"cause": "<string>",
"context": {},
"errorCategory": 123,
"correlationId": "<string>",
"traceId": "<string>",
"resources": [
[
"<string>"
]
],
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": true
}POST /v2/events/events-by-contract-id
Get the create and the consuming exercise event for the contract with the provided ID. No events will be returned for contracts that have been pruned because they have already been archived before the latest pruning offset. If the contract cannot be found for the request, or all the contract-events are filtered, a CONTRACT_EVENTS_NOT_FOUND error will be raised.
POST
/
v2
/
events
/
events-by-contract-id
POST /v2/events/events-by-contract-id
curl --request POST \
--url https://api.example.com/v2/events/events-by-contract-id \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contractId": "<string>",
"eventFormat": {
"filtersByParty": {},
"filtersForAnyParty": {
"cumulative": [
{
"identifierFilter": {
"Empty": {}
}
}
]
},
"verbose": true
}
}
'import requests
url = "https://api.example.com/v2/events/events-by-contract-id"
payload = {
"contractId": "<string>",
"eventFormat": {
"filtersByParty": {},
"filtersForAnyParty": { "cumulative": [{ "identifierFilter": { "Empty": {} } }] },
"verbose": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contractId: '<string>',
eventFormat: {
filtersByParty: {},
filtersForAnyParty: {cumulative: [{identifierFilter: {Empty: {}}}]},
verbose: true
}
})
};
fetch('https://api.example.com/v2/events/events-by-contract-id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v2/events/events-by-contract-id",
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([
'contractId' => '<string>',
'eventFormat' => [
'filtersByParty' => [
],
'filtersForAnyParty' => [
'cumulative' => [
[
'identifierFilter' => [
'Empty' => [
]
]
]
]
],
'verbose' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v2/events/events-by-contract-id"
payload := strings.NewReader("{\n \"contractId\": \"<string>\",\n \"eventFormat\": {\n \"filtersByParty\": {},\n \"filtersForAnyParty\": {\n \"cumulative\": [\n {\n \"identifierFilter\": {\n \"Empty\": {}\n }\n }\n ]\n },\n \"verbose\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v2/events/events-by-contract-id")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contractId\": \"<string>\",\n \"eventFormat\": {\n \"filtersByParty\": {},\n \"filtersForAnyParty\": {\n \"cumulative\": [\n {\n \"identifierFilter\": {\n \"Empty\": {}\n }\n }\n ]\n },\n \"verbose\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v2/events/events-by-contract-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contractId\": \"<string>\",\n \"eventFormat\": {\n \"filtersByParty\": {},\n \"filtersForAnyParty\": {\n \"cumulative\": [\n {\n \"identifierFilter\": {\n \"Empty\": {}\n }\n }\n ]\n },\n \"verbose\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"created": {
"createdEvent": {
"offset": 123,
"nodeId": 123,
"contractId": "<string>",
"templateId": "<string>",
"createArgument": "<unknown>",
"witnessParties": [
"<string>"
],
"signatories": [
"<string>"
],
"createdAt": "<string>",
"packageName": "<string>",
"representativePackageId": "<string>",
"acsDelta": true,
"contractKey": "<unknown>",
"contractKeyHash": "<string>",
"createdEventBlob": "<string>",
"interfaceViews": [
{
"interfaceId": "<string>",
"viewStatus": {
"code": 123,
"message": "<string>",
"details": [
{
"typeUrl": "<string>",
"value": "<string>",
"unknownFields": {
"fields": {}
},
"valueDecoded": "<string>"
}
]
},
"viewValue": "<unknown>",
"implementationPackageId": "<string>"
}
],
"observers": [
"<string>"
]
},
"synchronizerId": "<string>"
},
"archived": {
"archivedEvent": {
"offset": 123,
"nodeId": 123,
"contractId": "<string>",
"templateId": "<string>",
"witnessParties": [
"<string>"
],
"packageName": "<string>",
"implementedInterfaces": [
"<string>"
]
},
"synchronizerId": "<string>"
}
}"<string>"{
"code": "<string>",
"cause": "<string>",
"context": {},
"errorCategory": 123,
"correlationId": "<string>",
"traceId": "<string>",
"resources": [
[
"<string>"
]
],
"grpcCodeValue": 123,
"retryInfo": "<string>",
"definiteAnswer": true
}Authorizations
httpAuthapiKeyAuth
Ledger API standard JWT token
Body
application/json
Response
The create event for the contract with the contract_id given in the request
provided it exists and has not yet been pruned.
Optional
Show child attributes
Show child attributes
The archive event for the contract with the contract_id given in the request
provided such an archive event exists and it has not yet been pruned.
Optional
Show child attributes
Show child attributes
Was this page helpful?
⌘I