Skip to main content
POST
/
v1
/
holdings
/
summary
POST /v1/holdings/summary
curl --request POST \
  --url https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/holdings/summary \
  --header 'Content-Type: application/json' \
  --data '
{
  "migration_id": 123,
  "record_time": "2023-11-07T05:31:56Z",
  "owner_party_ids": [
    "<string>"
  ],
  "record_time_match": "exact"
}
'
import requests

url = "https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/holdings/summary"

payload = {
    "migration_id": 123,
    "record_time": "2023-11-07T05:31:56Z",
    "owner_party_ids": ["<string>"],
    "record_time_match": "exact"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    migration_id: 123,
    record_time: '2023-11-07T05:31:56Z',
    owner_party_ids: ['<string>'],
    record_time_match: 'exact'
  })
};

fetch('https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/holdings/summary', 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://scan.sv-1.global.canton.network.sync.global/api/scan/v1/holdings/summary",
  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([
    'migration_id' => 123,
    'record_time' => '2023-11-07T05:31:56Z',
    'owner_party_ids' => [
        '<string>'
    ],
    'record_time_match' => 'exact'
  ]),
  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;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/holdings/summary"

	payload := strings.NewReader("{\n  \"migration_id\": 123,\n  \"record_time\": \"2023-11-07T05:31:56Z\",\n  \"owner_party_ids\": [\n    \"<string>\"\n  ],\n  \"record_time_match\": \"exact\"\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(string(body))

}
HttpResponse<String> response = Unirest.post("https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/holdings/summary")
  .header("Content-Type", "application/json")
  .body("{\n  \"migration_id\": 123,\n  \"record_time\": \"2023-11-07T05:31:56Z\",\n  \"owner_party_ids\": [\n    \"<string>\"\n  ],\n  \"record_time_match\": \"exact\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://scan.sv-1.global.canton.network.sync.global/api/scan/v1/holdings/summary")

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  \"migration_id\": 123,\n  \"record_time\": \"2023-11-07T05:31:56Z\",\n  \"owner_party_ids\": [\n    \"<string>\"\n  ],\n  \"record_time_match\": \"exact\"\n}"

response = http.request(request)
puts response.read_body
{
  "record_time": "2023-11-07T05:31:56Z",
  "migration_id": 123,
  "summaries": [
    {
      "party_id": "<string>",
      "total_unlocked_coin": "<string>",
      "total_locked_coin": "<string>",
      "total_coin_holdings": "<string>"
    }
  ]
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}
{
  "error": "<string>"
}

Body

application/json
migration_id
integer<int64>
required

The migration id for which to return the summary.

record_time
string<date-time>
required

The timestamp at which the contract set was active. This needs to be an exact timestamp, i.e., needs to correspond to a timestamp reported by /v0/state/acs/snapshot-timestamp if record_time_match is set to exact (which is the default). If record_time_match is set to at_or_before, this can be any timestamp, and the most recent snapshot at or before the given record_time will be returned.

owner_party_ids
string[]
required

The owners for which to compute the summary.

Minimum array length: 1
record_time_match
enum<string>
default:exact

How to match the record_time. "exact" requires the record_time to match exactly. "at_or_before" finds the most recent snapshot at or before the given record_time.

Available options:
exact,
at_or_before

Response

ok

record_time
string<date-time>
required

The same record_time as in the request.

migration_id
integer<int64>
required

The same migration_id as in the request.

summaries
object[]
required