Validate a contract - 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

validate Try it

Validate a contract

cURL

curl --request POST \
  --url https://demo-api.gable.ai/v0/contract/validate \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '\n{\n  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\n  "contractSpec": {\n    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\n    "doc": "<string>",\n    "name": "<string>",\n    "namespace": "<string>",\n    "owner": "jsmith@example.com",\n    "schema": [\
      {\
        "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>",\
    "dataAssetResourceNameList": [\
      "<string>"\
    ],\
    "restrictPii": true\
  },\n  "parentRowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\n  "version": "<string>",\
  "gitHash": "<string>",\
  "gitRepo": "<string>",\
  "gitUser": "<string>",\
  "reviewers": [\
    "<string>"\
  ],\
  "filePath": "<string>",\
  "mergedAt": "2023-11-07T05:31:56Z",\
  "lastEditorUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",\n  "lastEditorEmail": "<string>",\
  "lastEditorFirstName": "<string>",\
  "lastEditorLastName": "<string>",\
  "lastEditorGithubHandle": "<string>"\
}\\n'
import requests

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

payload = {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "contractSpec": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "doc": "<string>",
        "name": "<string>",
        "namespace": "<string>",
        "owner": "jsmith@example.com",
        "schema": [\
            {\
                "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>",\
        "dataAssetResourceNameList": ["<string>"],\
        "restrictPii": True
    },
    "parentRowId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "version": "<string>",
    "gitHash": "<string>",
    "gitRepo": "<string>",
    "gitUser": "<string>",
    "reviewers": ["<string>"],
    "filePath": "<string>",
    "mergedAt": "2023-11-07T05:31:56Z",
    "lastEditorUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "lastEditorEmail": "<string>",
    "lastEditorFirstName": "<string>",
    "lastEditorLastName": "<string>",
    "lastEditorGithubHandle": "<string>"
}
headers = {
    "X-API-KEY": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
const options = {
  method: 'POST',
  headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    contractSpec: {
      id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
      doc: '<string>',
      name: '<string>',
      namespace: '<string>',
      owner: 'jsmith@example.com',
      schema: [{
        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>',
      dataAssetResourceNameList: ['<string>'],
      restrictPii: true
    },
    parentRowId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    version: '<string>',
    gitHash: '<string>',
    gitRepo: '<string>',
    gitUser: '<string>',
    reviewers: ['<string>'],
    filePath: '<string>',
    mergedAt: '2023-11-07T05:31:56Z',
    lastEditorUserId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    lastEditorEmail: '<string>',
    lastEditorFirstName: '<string>',
    lastEditorLastName: '<string>',
    lastEditorGithubHandle: '<string>'
  })
};

fetch('https://demo-api.gable.ai/v0/contract/validate', 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://demo-api.gable.ai/v0/contract/validate",
  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([
    'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'contractSpec' => [
        'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
        'doc' => '<string>',
        'name' => '<string>',
        'namespace' => '<string>',
        'owner' => 'jsmith@example.com',
        'schema' => [[
            '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>',
        'dataAssetResourceNameList' => ['<string>'],
        'restrictPii' => true
    ],
    'parentRowId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'version' => '<string>',
    'gitHash' => '<string>',
    'gitRepo' => '<string>',
    'gitUser' => '<string>',
    'reviewers' => ['<string>'],
    'filePath' => '<string>',
    'mergedAt' => '2023-11-07T05:31:56Z',
    'lastEditorUserId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    'lastEditorEmail' => '<string>',
    'lastEditorFirstName' => '<string>',
    'lastEditorLastName' => '<string>',
    'lastEditorGithubHandle' => '<string>'
  ]),
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "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;
}
package main

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

func main() {

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

payload := strings.NewReader("{\n  \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"contractSpec\": {\n    \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n    \"doc\": \"<string>\",\n    \"name\": \"<string>\",\n    \"namespace\": \"<string>\",\n    \"owner\": \"jsmith@example.com\",\n    \"schema\": [\n      {\n        \"type\": \"struct\",\n        \"name\": \"<string>\",\n        \"fields\": [\n          {\n            \"type\": \"struct\",\n            \"name\": \"<string>\",\n            \"fields\": \"<array>\",\n            \"alias\": \"<string>\",\n            \"doc\": \"<string>\",\n            \"logical\": \"<string>\",\n            \"optional\": true\n          }\n        ],\n        \"alias\": \"<string>\",\n        \"doc\": \"<string>\",\n        \"logical\": \"<string>\",\n        \"optional\": true,\n        \"constraints\": {}\n      }\n    ],\n    \"dataAssetResourceName\": \"<string>\",\n    \"dataAssetResourceNameList\": [\n      \"<string>\"\n    ],\n    \"restrictPii\": true\n  },\n  \"parentRowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"version\": \"<string>\",\n  \"gitHash\": \"<string>\",\n  \"gitRepo\": \"<string>\",\n  \"gitUser\": \"<string>\",\n  \"reviewers\": [\n    \"<string>\"\n  ],\n  \"filePath\": \"<string>\",\n  \"mergedAt\": \"2023-11-07T05:31:56Z\",\n  \"lastEditorUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"lastEditorEmail\": \"<string>\",\n  \"lastEditorFirstName\": \"<string>\",\n  \"lastEditorLastName\": \"<string>\",\n  \"lastEditorGithubHandle\": \"<string>\"}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("X-API-KEY", "<api-key>")
    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://demo-api.gable.ai/v0/contract/validate")
  .header("X-API-KEY", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"contractSpec\": {\n    \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n    \"doc\": \"<string>\",\n    \"name\": \"<string>\",\n    \"namespace\": \"<string>\",\n    \"owner\": \"jsmith@example.com\",\n    \"schema\": [\n      {\n        \"type\": \"struct\",\n        \"name\": \"<string>\",\n        \"fields\": [\n          {\n            \"type\": \"struct\",\n            \"name\": \"<string>\",\n            \"fields\": \"<array>\",\n            \"alias\": \"<string>\",\n            \"doc\": \"<string>\",\n            \"logical\": \"<string>\",\n            \"optional\": true\n          }\n        ],\n        \"alias\": \"<string>\",\n        \"doc\": \"<string>\",\n        \"logical\": \"<string>\",\n        \"optional\": true,\n        \"constraints\": {}\n      }\n    ],\n    \"dataAssetResourceName\": \"<string>\",\n    \"dataAssetResourceNameList\": [\n      \"<string>\"\n    ],\n    \"restrictPii\": true\n  },\n  \"parentRowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"version\": \"<string>\",\n  \"gitHash\": \"<string>\",\n  \"gitRepo\": \"<string>\",\n  \"gitUser\": \"<string>\",\n  \"reviewers\": [\n    \"<string>\"\n  ],\n  \"filePath\": \"<string>\",\n  \"mergedAt\": \"2023-11-07T05:31:56Z\",\n  \"lastEditorUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"lastEditorEmail\": \"<string>\",\n  \"lastEditorFirstName\": \"<string>\",\n  \"lastEditorLastName\": \"<string>\",\n  \"lastEditorGithubHandle\": \"<string>\"}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://demo-api.gable.ai/v0/contract/validate")

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

request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"contractSpec\": {\n    \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n    \"doc\": \"<string>\",\n    \"name\": \"<string>\",\n    \"namespace\": \"<string>\",\n    \"owner\": \"jsmith@example.com\",\n    \"schema\": [\n      {\n        \"type\": \"struct\",\n        \"name\": \"<string>\",\n        \"fields\": [\n          {\n            \"type\": \"struct\",\n            \"name\": \"<string>\",\n            \"fields\": \"<array>\",\n            \"alias\": \"<string>\",\n            \"doc\": \"<string>\",\n            \"logical\": \"<string>\",\n            \"optional\": true\n          }\n        ],\n        \"alias\": \"<string>\",\n        \"doc\": \"<string>\",\n        \"logical\": \"<string>\",\n        \"optional\": true,\n        \"constraints\": {}\n      }\n    ],\n    \"dataAssetResourceName\": \"<string>\",\n    \"dataAssetResourceNameList\": [\n      \"<string>\"\n    ],\n    \"restrictPii\": true\n  },\n  \"parentRowId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"version\": \"<string>\",\n  \"gitHash\": \"<string>\",\n  \"gitRepo\": \"<string>\",\n  \"gitUser\": \"<string>\",\n  \"reviewers\": [\n    \"<string>\"\n  ],\n  \"filePath\": \"<string>\",\n  \"mergedAt\": \"2023-11-07T05:31:56Z\",\n  \"lastEditorUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n  \"lastEditorEmail\": \"<string>\",\n  \"lastEditorFirstName\": \"<string>\",\n  \"lastEditorLastName\": \"<string>\",\n  \"lastEditorGithubHandle\": \"<string>\"}"

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

200

{
  "message": "<string>",
  "success": true
}