Skip to main content
POST
/
v1
/
contracts
/
getSubscriptionSeatsHistory
Get subscription seats history
curl --request POST \
  --url https://api.metronome.com/v1/contracts/getSubscriptionSeatsHistory \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",
  "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
  "subscription_id": "1a824d53-bde6-4d82-96d7-6347ff227d5c",
  "covering_date": "2024-01-15T00:00:00.000Z",
  "limit": 10
}
'
import requests

url = "https://api.metronome.com/v1/contracts/getSubscriptionSeatsHistory"

payload = {
    "customer_id": "13117714-3f05-48e5-a6e9-a66093f13b4d",
    "contract_id": "d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc",
    "subscription_id": "1a824d53-bde6-4d82-96d7-6347ff227d5c",
    "covering_date": "2024-01-15T00:00:00.000Z",
    "limit": 10
}
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({
    customer_id: '13117714-3f05-48e5-a6e9-a66093f13b4d',
    contract_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
    subscription_id: '1a824d53-bde6-4d82-96d7-6347ff227d5c',
    covering_date: '2024-01-15T00:00:00.000Z',
    limit: 10
  })
};

fetch('https://api.metronome.com/v1/contracts/getSubscriptionSeatsHistory', 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.metronome.com/v1/contracts/getSubscriptionSeatsHistory",
  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([
    'customer_id' => '13117714-3f05-48e5-a6e9-a66093f13b4d',
    'contract_id' => 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
    'subscription_id' => '1a824d53-bde6-4d82-96d7-6347ff227d5c',
    'covering_date' => '2024-01-15T00:00:00.000Z',
    'limit' => 10
  ]),
  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.metronome.com/v1/contracts/getSubscriptionSeatsHistory"

	payload := strings.NewReader("{\n  \"customer_id\": \"13117714-3f05-48e5-a6e9-a66093f13b4d\",\n  \"contract_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\",\n  \"subscription_id\": \"1a824d53-bde6-4d82-96d7-6347ff227d5c\",\n  \"covering_date\": \"2024-01-15T00:00:00.000Z\",\n  \"limit\": 10\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.metronome.com/v1/contracts/getSubscriptionSeatsHistory")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": \"13117714-3f05-48e5-a6e9-a66093f13b4d\",\n  \"contract_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\",\n  \"subscription_id\": \"1a824d53-bde6-4d82-96d7-6347ff227d5c\",\n  \"covering_date\": \"2024-01-15T00:00:00.000Z\",\n  \"limit\": 10\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.metronome.com/v1/contracts/getSubscriptionSeatsHistory")

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  \"customer_id\": \"13117714-3f05-48e5-a6e9-a66093f13b4d\",\n  \"contract_id\": \"d7abd0cd-4ae9-4db7-8676-e986a4ebd8dc\",\n  \"subscription_id\": \"1a824d53-bde6-4d82-96d7-6347ff227d5c\",\n  \"covering_date\": \"2024-01-15T00:00:00.000Z\",\n  \"limit\": 10\n}"

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "starting_at": "2024-01-01T00:00:00.000Z",
      "ending_before": "2024-01-15T00:00:00.000Z",
      "total_quantity": 5,
      "assigned_seat_ids": [
        "seat-1",
        "seat-2",
        "seat-3",
        "seat-4",
        "seat-5"
      ]
    },
    {
      "starting_at": "2024-01-15T00:00:00.000Z",
      "ending_before": null,
      "total_quantity": 3,
      "assigned_seat_ids": [
        "seat-1",
        "seat-2",
        "seat-3"
      ]
    }
  ],
  "next_page": "eyJzdGFydGluZ19hdCI6IjIwMjQtMDEtMTVUMDA6MDA6MDAuMDAwWiJ9"
}
{
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
customer_id
string<uuid>
required
contract_id
string<uuid>
required
subscription_id
string<uuid>
required
limit
integer | null
default:10

Maximum number of seat schedule entries to return. Defaults to 10. Required range: 1 <= x <= 10.

cursor
string | null

Cursor for pagination. Use the value from the next_page field of the previous response to retrieve the next page of results.

covering_date
string<date-time> | null

Get the seats history segment for the covering date. Cannot be used with starting_at or ending_before.

starting_at
string<date-time> | null

Include seats history segments that are active at or after this timestamp. Use with ending_before to get a specific time range. If not set, there's no lower bound.

ending_before
string<date-time> | null

Include seats history segments that are active at or before this timestamp. Use with starting_at to get a specific time range. If not set, there's no upper bound.

Response

Success

data
object[]
required
next_page
string | null
required

Cursor for the next page of results