Read Deltas of One Snapshot
GET {{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas
The GET /version-control/snapshots/{{snapshotId}}/deltas operation returns the deltas of the snapshot specified by the ID in the request URL.
Query parameters
| Query parameter | Description |
|---|---|
|
ID of Policy Editor entity to filter by |
|
Specifies the page number of results to return. |
|
Specifies the number of results to return per page. |
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff '{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas' \
--header 'x-user-id: {{userId}}'
var options = new RestClientOptions("{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Get);
request.AddHeader("x-user-id", "{{userId}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("x-user-id", "{{userId}}")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
GET /version-control/snapshots/{{snapshotId}}/deltas HTTP/1.1
Host: {{apiPath}}
x-user-id: {{userId}}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas")
.method("GET", body)
.addHeader("x-user-id", "{{userId}}")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas",
"method": "GET",
"timeout": 0,
"headers": {
"x-user-id": "{{userId}}"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'GET',
'url': '{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas',
'headers': {
'x-user-id': '{{userId}}'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
url = "{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas"
payload = {}
headers = {
'x-user-id': '{{userId}}'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'x-user-id' => '{{userId}}'
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
require "uri"
require "net/http"
url = URI("{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["x-user-id"] = "{{userId}}"
response = http.request(request)
puts response.read_body
var request = URLRequest(url: URL(string: "{{apiPath}}/version-control/snapshots/{{snapshotId}}/deltas")!,timeoutInterval: Double.infinity)
request.addValue("{{userId}}", forHTTPHeaderField: "x-user-id")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Example Response
200 OK
{
"pagination": {
"page": 1,
"pageSize": 100,
"totalItems": 1,
"totalPages": 1
},
"data": [
{
"id": "b8d8f248-18c6-4d38-b966-27f62da88443",
"transactionId": "5f9fde9e-e7ad-4e78-ae7c-5e822e4923cb",
"dateTime": "2025-03-06T01:02:40.641879Z",
"entityChange": {
"entitySummary": {
"id": "94e99240-6b3f-4952-b8db-db6a7b0636a7",
"name": "Example policy",
"type": "Policy"
},
"changeType": "CREATE",
"beforeVersion": null,
"afterVersion": "79d9de6a-d192-4f49-8e7f-659432e8eb4b",
"beforeHashCode": 0,
"afterHashCode": 1195240035,
"entityReference": {
"id": "94e99240-6b3f-4952-b8db-db6a7b0636a7",
"type": "Policy"
}
},
"userId": "selfgovernanceadmin",
"snapshotId": "7dc5dbe8-39f7-41b3-a093-2a0d8c71c1a3",
"branchId": "cece1543-5b71-48b0-83b5-b5f2712c1227",
"entityId": "94e99240-6b3f-4952-b8db-db6a7b0636a7"
}
]
}