## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://docs.gable.ai/llms.txt)

Use this file to discover all available pages before exploring further.

GET

/v0/contract/{id}/activity

Try it
Get the activity events for a contract

### cURL

```
curl --request GET \
  --url https://demo-api.gable.ai/v0/contract/{id}/activity \
  --header 'X-API-KEY: <api-key>'
```

### Python

```
import requests

url = "https://demo-api.gable.ai/v0/contract/{id}/activity"

headers = {"X-API-KEY": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
```

### JavaScript (Fetch)

```
const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};

fetch('https://demo-api.gable.ai/v0/contract/{id}/activity', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### PHP

```
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://demo-api.gable.ai/v0/contract/{id}/activity",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "X-API-KEY: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
?>
```

### Go

```
package main

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

func main() {

url := "https://demo-api.gable.ai/v0/contract/{id}/activity"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("X-API-KEY", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))
}
```

### Unirest (Java)

```
HttpResponse<String> response = Unirest.get("https://demo-api.gable.ai/v0/contract/{id}/activity")
  .header("X-API-KEY", "<api-key>")
  .asString();
```

### Ruby

```
require 'uri'
require 'net/http'

url = URI("https://demo-api.gable.ai/v0/contract/{id}/activity")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'

response = http.request(request)
puts response.read_body
```

### Response Codes

| Code | Description |
|------|-------------|
| 200  | Successful response containing the activity events for the contract |
| 400  | Bad Request |
| 404  | Not Found |

### Response Format

```json
[
  {
    "type": "CONTRACT_UPDATED",
    "datetime": "2023-11-07T05:31:56Z",
    "fileUri": "<string>",
    "gitUser": "<string>"
  }
]
```

```json
{
  "message": "<string>",
  "id": 123,
  "title": "<string>"
}
```

### Authorizations

- **X-API-KEY**: string, header, required

### Path Parameters

- **id**: string<uuid>, required, UUID of the contract

### Response Details

- **type**: enum<string>, required, type of the event (e.g., `CONTRACT_UPDATED`)
- **datetime**: string<date-time>, required, date time at which the contract was updated
- **fileUri**: string<uri>, full link to the file and commit in the repo that contains this updated contract
- **gitUser**: string, the git user who edited the contract.
