Check if the asset associated with the contract is compliant - Gable Docs

Documentation Index

Fetch the complete documentation index at: /llms.txt

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


POST /v0/contract/check-compliance

Check if the asset associated with the contract is compliant.

Example cURL Request

curl --request POST \
  --url https://demo-api.gable.ai/v0/contract/check-compliance \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "contract": {
    "contractSchema": [
      {
        "type": "struct",
        "name": "<string>",
        "fields": [
          {
            "type": "struct",
            "name": "<string>",
            "fields": "<array>",
            "alias": "<string>",
            "doc": "<string>",
            "logical": "<string>",
            "optional": true
          }
        ],
        "alias": "<string>",
        "doc": "<string>",
        "logical": "<string>",
        "optional": true,
        "constraints": {}
      }
    ],
    "dataAssetResourceName": "<string>"
  }
}
'```

### Example Python Request

```python
import requests

url = "https://demo-api.gable.ai/v0/contract/check-compliance"

payload = { "contract": {
        "contractSchema": [
            {
                "type": "struct",
                "name": "<string>",
                "fields": [
                    {
                        "type": "struct",
                        "name": "<string>",
                        "fields": "<array>",
                        "alias": "<string>",
                        "doc": "<string>",
                        "logical": "<string>",
                        "optional": True
                    }
                ],
                "alias": "<string>",
                "doc": "<string>",
                "logical": "<string>",
                "optional": True,
                "constraints": {}
            }
        ],
        "dataAssetResourceName": "<string>"
    } }
headers = {
    "X-API-KEY": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)

Example JavaScript Request

const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    contract: {
      contractSchema: [
        {
          type: 'struct',
          name: '<string>',
          fields: [
            {
              type: 'struct',
              name: '<string>',
              fields: '<array>',
              alias: '<string>',
              doc: '<string>',
              logical: '<string>',
              optional: true
            }
          ],
          alias: '<string>',
          doc: '<string>',
          logical: '<string>',
          optional: true,
          constraints: {}
        }
      ],
      dataAssetResourceName: '<string>'
    }
  })
};

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

Response Format

Successful Response (200)

{
  "violations": [
    {
      "message": "<string>",
      "field": "<string>",
      "fieldType": "<string>",
      "expected": "<string>",
      "actual": "<string>"
    }
  ]
}

Error Response (400, 404, 500)

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