Get contract types creation form
curl --request GET \
--url https://api.tomorro.com/v2/contract-types/{id}/creation-form \
--header 'x-api-key: <api-key>'import requests
url = "https://api.tomorro.com/v2/contract-types/{id}/creation-form"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.tomorro.com/v2/contract-types/{id}/creation-form', 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://api.tomorro.com/v2/contract-types/{id}/creation-form",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tomorro.com/v2/contract-types/{id}/creation-form"
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))
}HttpResponse<String> response = Unirest.get("https://api.tomorro.com/v2/contract-types/{id}/creation-form")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tomorro.com/v2/contract-types/{id}/creation-form")
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{
"fields": [
{
"smartFieldId": "550e8400-e29b-41d4-a716-446655440000",
"typeAttributeId": "650e8400-e29b-41d4-a716-446655440001",
"reasons": [
"explicitMandatory"
],
"required": true
}
],
"fieldsCount": 3,
"rules": [
{
"conditions": {
"all": []
},
"event": {
"type": "noop"
}
}
]
}Contract Types
Get contract types creation form
Returns the smart-fields and json-rules-engine rules used when creating a contract for this type, optionally scoped to a template.
GET
/
contract-types
/
{id}
/
creation-form
Get contract types creation form
curl --request GET \
--url https://api.tomorro.com/v2/contract-types/{id}/creation-form \
--header 'x-api-key: <api-key>'import requests
url = "https://api.tomorro.com/v2/contract-types/{id}/creation-form"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.tomorro.com/v2/contract-types/{id}/creation-form', 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://api.tomorro.com/v2/contract-types/{id}/creation-form",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.tomorro.com/v2/contract-types/{id}/creation-form"
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))
}HttpResponse<String> response = Unirest.get("https://api.tomorro.com/v2/contract-types/{id}/creation-form")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tomorro.com/v2/contract-types/{id}/creation-form")
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{
"fields": [
{
"smartFieldId": "550e8400-e29b-41d4-a716-446655440000",
"typeAttributeId": "650e8400-e29b-41d4-a716-446655440001",
"reasons": [
"explicitMandatory"
],
"required": true
}
],
"fieldsCount": 3,
"rules": [
{
"conditions": {
"all": []
},
"event": {
"type": "noop"
}
}
]
}Authorizations
API key for authentication. Get your key at https://app.tomorro.com/settings/integrations?integration=api-key
Path Parameters
The unique identifier (UUID) of the contract type
Example:
"550e8400-e29b-41d4-a716-446655440000"
Query Parameters
Optional template id to scope conditions (e.g. template-based mandatory fields).
Example:
"550e8400-e29b-41d4-a716-446655440000"
Response
Creation form fields and rules
Fields to collect when creating a contract of this type (and optional template).
Show child attributes
Show child attributes
Example:
[ { "smartFieldId": "550e8400-e29b-41d4-a716-446655440000", "typeAttributeId": "650e8400-e29b-41d4-a716-446655440001", "reasons": ["explicitMandatory"], "required": true } ]
Number of fields (same as fields.length).
Example:
3
Json-rules-engine rule definitions applied to the creation form.
Example:
[ { "conditions": { "all": [] }, "event": { "type": "noop" } } ]