PingAuthorize API Reference

Read Uncommitted Changes

GET {{apiPath}}/version-control/branches/{{branchId}}/changes

The GET /version-control/branches/{{branchId}}/changes operation returns all uncommitted changes on the branch identified by {{branchId}}.

Query parameters
Query parameter Description

page

Specifies the page number of results to return.

page-size

Specifies the number of results to return per page.

Headers

x-user-id      {{userId}}

Example Request

  • cURL

  • C#

  • Go

  • HTTP

  • Java

  • jQuery

  • NodeJS

  • Python

  • PHP

  • Ruby

  • Swift

curl --location --globoff '{{apiPath}}/version-control/branches/{{branchId}}/changes' \
--header 'x-user-id: {{userId}}'
var options = new RestClientOptions("{{apiPath}}/version-control/branches/{{branchId}}/changes")
{
  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/branches/{{branchId}}/changes"
  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/branches/{{branchId}}/changes 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/branches/{{branchId}}/changes")
  .method("GET", body)
  .addHeader("x-user-id", "{{userId}}")
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "{{apiPath}}/version-control/branches/{{branchId}}/changes",
  "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/branches/{{branchId}}/changes',
  '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/branches/{{branchId}}/changes"

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/branches/{{branchId}}/changes');
$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/branches/{{branchId}}/changes")

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/branches/{{branchId}}/changes")!,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": 9,
        "totalPages": 1
    },
    "data": [
        {
            "id": "99791c2b-80c9-4b2b-aae3-92eecd510f90",
            "transactionId": "5e53d8c9-9817-474b-861c-8f2f958e472a",
            "dateTime": "2025-03-10T00:00:23.603844Z",
            "entityChange": {
                "entitySummary": {
                    "id": "db705639-d55f-46f8-8840-be0115a88376",
                    "name": "example-target",
                    "type": "Target"
                },
                "changeType": "CREATE",
                "beforeVersion": null,
                "afterVersion": "af675008-d33b-4077-9bad-18524885e6ac",
                "beforeHashCode": 0,
                "afterHashCode": -1493983697,
                "entityReference": {
                    "id": "db705639-d55f-46f8-8840-be0115a88376",
                    "type": "Target"
                }
            },
            "userId": "selfgovernanceadmin",
            "snapshotId": "e948b62c-2111-4fc5-9d7f-9ac58bda2e23",
            "branchId": "bc61eedf-a9c1-4aae-b35f-7df637c403ed",
            "entityId": "db705639-d55f-46f8-8840-be0115a88376"
        },
        {
            "id": "425ad6f5-709d-41a3-9f65-1c41f2da3a8c",
            "transactionId": "3bc40c00-d8d4-41d0-9d70-d7df12da3b43",
            "dateTime": "2025-03-10T00:00:06.040787Z",
            "entityChange": {
                "entitySummary": {
                    "id": "9efc3a6a-6ece-42de-9d39-1ceb0f1000c3",
                    "name": "example-target",
                    "type": "Target"
                },
                "changeType": "CREATE",
                "beforeVersion": null,
                "afterVersion": "8a09391e-addc-46a4-a809-00027851fec3",
                "beforeHashCode": 0,
                "afterHashCode": -1493983697,
                "entityReference": {
                    "id": "9efc3a6a-6ece-42de-9d39-1ceb0f1000c3",
                    "type": "Target"
                }
            },
            "userId": "selfgovernanceadmin",
            "snapshotId": "e948b62c-2111-4fc5-9d7f-9ac58bda2e23",
            "branchId": "bc61eedf-a9c1-4aae-b35f-7df637c403ed",
            "entityId": "9efc3a6a-6ece-42de-9d39-1ceb0f1000c3"
        },
        {
            "id": "31de395f-4ba1-4d33-9237-3b861c875e09",
            "transactionId": "2b4b8f49-c162-4aa0-aeed-4cbbf14c92ba",
            "dateTime": "2025-03-10T00:00:03.466561Z",
            "entityChange": {
                "entitySummary": {
                    "id": "78a6277b-adbf-4692-a390-0ace4b1c6bce",
                    "name": "example-target",
                    "type": "Target"
                },
                "changeType": "CREATE",
                "beforeVersion": null,
                "afterVersion": "f6da86d7-94c7-4ede-aabd-265869619946",
                "beforeHashCode": 0,
                "afterHashCode": -1493983697,
                "entityReference": {
                    "id": "78a6277b-adbf-4692-a390-0ace4b1c6bce",
                    "type": "Target"
                }
            },
            "userId": "selfgovernanceadmin",
            "snapshotId": "e948b62c-2111-4fc5-9d7f-9ac58bda2e23",
            "branchId": "bc61eedf-a9c1-4aae-b35f-7df637c403ed",
            "entityId": "78a6277b-adbf-4692-a390-0ace4b1c6bce"
        },
        {
            "id": "f0a0e942-c59c-4b90-aa83-09cbcce425ee",
            "transactionId": "647f79a1-2e04-4681-91f5-946ddad671e4",
            "dateTime": "2025-03-09T23:59:39.336224Z",
            "entityChange": {
                "entitySummary": {
                    "id": "825e44ef-475c-4085-8fc5-e6c27b95fe8a",
                    "name": "example-target",
                    "type": "Target"
                },
                "changeType": "CREATE",
                "beforeVersion": null,
                "afterVersion": "ea795869-ea60-4f65-b3a7-121c5aafbfe1",
                "beforeHashCode": 0,
                "afterHashCode": -1493804951,
                "entityReference": {
                    "id": "825e44ef-475c-4085-8fc5-e6c27b95fe8a",
                    "type": "Target"
                }
            },
            "userId": "selfgovernanceadmin",
            "snapshotId": "e948b62c-2111-4fc5-9d7f-9ac58bda2e23",
            "branchId": "bc61eedf-a9c1-4aae-b35f-7df637c403ed",
            "entityId": "825e44ef-475c-4085-8fc5-e6c27b95fe8a"
        },
        {
            "id": "e092bdf5-f63b-4837-a7d6-eab239a73711",
            "transactionId": "ed34d749-1ff7-48bd-8bf9-c409986f662e",
            "dateTime": "2025-03-09T23:58:09.915208Z",
            "entityChange": {
                "entitySummary": {
                    "id": "2e27dcfc-c5c0-4760-b46a-b6c40b153964",
                    "name": "example-target",
                    "type": "Target"
                },
                "changeType": "CREATE",
                "beforeVersion": null,
                "afterVersion": "728f1658-7d82-46df-840e-609b893225c3",
                "beforeHashCode": 0,
                "afterHashCode": -1493983697,
                "entityReference": {
                    "id": "2e27dcfc-c5c0-4760-b46a-b6c40b153964",
                    "type": "Target"
                }
            },
            "userId": "selfgovernanceadmin",
            "snapshotId": "e948b62c-2111-4fc5-9d7f-9ac58bda2e23",
            "branchId": "bc61eedf-a9c1-4aae-b35f-7df637c403ed",
            "entityId": "2e27dcfc-c5c0-4760-b46a-b6c40b153964"
        },
        {
            "id": "2b6ab6e0-0e0c-421b-a389-1db9c7e8f3c4",
            "transactionId": "c21b2908-dbc4-477b-b4bd-920dfccb29f5",
            "dateTime": "2025-03-09T23:52:05.356025Z",
            "entityChange": {
                "entitySummary": {
                    "id": "3a594902-3d53-474f-9eef-af49492b43cc",
                    "name": "example-target",
                    "type": "Target"
                },
                "changeType": "DELETE",
                "beforeVersion": "a4e2f4d0-5b61-4d53-b2b0-bdc954e24031",
                "afterVersion": null,
                "beforeHashCode": -1493983697,
                "afterHashCode": 0,
                "entityReference": {
                    "id": "3a594902-3d53-474f-9eef-af49492b43cc",
                    "type": "Target"
                }
            },
            "userId": "selfgovernanceadmin",
            "snapshotId": "e948b62c-2111-4fc5-9d7f-9ac58bda2e23",
            "branchId": "bc61eedf-a9c1-4aae-b35f-7df637c403ed",
            "entityId": "3a594902-3d53-474f-9eef-af49492b43cc"
        },
        {
            "id": "ca59573b-4f6b-4d56-aff6-93ebb7dfc796",
            "transactionId": "26d70d0d-e918-4587-8900-f5647c3886f2",
            "dateTime": "2025-03-09T23:51:38.680450Z",
            "entityChange": {
                "entitySummary": {
                    "id": "3a594902-3d53-474f-9eef-af49492b43cc",
                    "name": "example-target",
                    "type": "Target"
                },
                "changeType": "CREATE",
                "beforeVersion": null,
                "afterVersion": "a4e2f4d0-5b61-4d53-b2b0-bdc954e24031",
                "beforeHashCode": 0,
                "afterHashCode": -1493983697,
                "entityReference": {
                    "id": "3a594902-3d53-474f-9eef-af49492b43cc",
                    "type": "Target"
                }
            },
            "userId": "selfgovernanceadmin",
            "snapshotId": "e948b62c-2111-4fc5-9d7f-9ac58bda2e23",
            "branchId": "bc61eedf-a9c1-4aae-b35f-7df637c403ed",
            "entityId": "3a594902-3d53-474f-9eef-af49492b43cc"
        },
        {
            "id": "552cf1d3-63d1-442a-bbf4-b61ef5884d74",
            "transactionId": "3947d270-0f9a-4792-b2a8-1f39f5f6787b",
            "dateTime": "2025-03-09T23:51:19.559274Z",
            "entityChange": {
                "entitySummary": {
                    "id": "ff7c4314-51a9-4384-b565-c4fdafe34f69",
                    "name": "example-target",
                    "type": "Target"
                },
                "changeType": "DELETE",
                "beforeVersion": "3eda70b1-a8c6-4a8e-9baa-9af8b2215644",
                "afterVersion": null,
                "beforeHashCode": -1493983697,
                "afterHashCode": 0,
                "entityReference": {
                    "id": "ff7c4314-51a9-4384-b565-c4fdafe34f69",
                    "type": "Target"
                }
            },
            "userId": "selfgovernanceadmin",
            "snapshotId": "e948b62c-2111-4fc5-9d7f-9ac58bda2e23",
            "branchId": "bc61eedf-a9c1-4aae-b35f-7df637c403ed",
            "entityId": "ff7c4314-51a9-4384-b565-c4fdafe34f69"
        },
        {
            "id": "c2d1a50f-7a7d-4355-83b0-8560b9e1764a",
            "transactionId": "577eb58e-1a8e-4a05-a59a-8678158b568b",
            "dateTime": "2025-03-09T23:51:16.212890Z",
            "entityChange": {
                "entitySummary": {
                    "id": "082e0afb-df8b-4a46-9db2-46e1f14a597a",
                    "name": "Example policy",
                    "type": "Policy"
                },
                "changeType": "UPDATE",
                "beforeVersion": "f1075b9c-3b66-4bd0-b11c-f5e58fcaa8b9",
                "afterVersion": "ae27d743-ea0e-4317-aa94-70add7a8497b",
                "beforeHashCode": -1518336309,
                "afterHashCode": 1195240035,
                "entityReference": {
                    "id": "082e0afb-df8b-4a46-9db2-46e1f14a597a",
                    "type": "Policy"
                }
            },
            "userId": "selfgovernanceadmin",
            "snapshotId": "e948b62c-2111-4fc5-9d7f-9ac58bda2e23",
            "branchId": "bc61eedf-a9c1-4aae-b35f-7df637c403ed",
            "entityId": "082e0afb-df8b-4a46-9db2-46e1f14a597a"
        }
    ]
}