import-schemas
Update an import schema
Replaces the fields, settings, and hooks of an existing saved import schema identified by ID.
PUT
/
schemas
/
{id}
/
Update an import schema
curl --request PUT \
--url https://app.dromo.io/api/v1/schemas/{id}/ \
--header 'Content-Type: application/json' \
--header 'X-Dromo-License-Key: <api-key>' \
--data '
{
"id": "0631f213-ca91-41e0-9a88-7430c7d0ca28",
"name": "last - email",
"fields": [
{
"key": "lastName",
"type": "string",
"label": "last",
"validators": [
{
"validate": "required"
}
]
},
{
"key": "email",
"type": "email",
"label": "email",
"validators": [
{
"validate": "required"
}
]
}
],
"settings": {
"type": "object",
"properties": {
"importIdentifier": {
"type": "string"
},
"title": {
"type": "string"
},
"allowInvalidSubmit": {
"type": "boolean"
},
"invalidDataBehavior": {
"type": "string",
"enum": [
"BLOCK_SUBMIT",
"INCLUDE_INVALID_ROWS",
"REMOVE_INVALID_ROWS",
"INCLUDE_INVALID_ROWS_AND_VALUES"
]
},
"backendSync": {
"type": "boolean"
},
"backendSyncMode": {
"type": "string",
"enum": [
"DISABLED",
"FULL_DATA",
"MAPPINGS_ONLY"
]
},
"manualInputDisabled": {
"type": "boolean"
},
"manualInputOnly": {
"type": "boolean"
},
"allowCustomFields": {
"type": "boolean"
},
"passThroughUnmappedColumns": {
"type": "boolean"
},
"maxRecords": {
"oneOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"developmentMode": {
"type": "boolean"
},
"displayEncoding": {
"type": "boolean"
},
"styleOverrides": {
"type": "object"
},
"maxFileSize": {
"type": "integer"
},
"webhookUrl": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"needsReviewWebhookUrl": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"initialData": {
"oneOf": [
{
"type": "array"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
"hooks": {
"type": "object",
"properties": {
"rowHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"bulkRowHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"rowDeleteHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"beforeFinishCallback": {
"type": "string"
},
"columnHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fieldName": {
"type": "string"
},
"callback": {
"type": "string"
}
},
"required": [
"fieldName",
"callback"
],
"additionalProperties": false
}
},
"stepHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPLOAD_STEP",
"REVIEW_STEP",
"REVIEW_STEP_POST_HOOKS"
]
},
"callback": {
"type": "string"
}
},
"required": [
"type",
"callback"
],
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
'import requests
url = "https://app.dromo.io/api/v1/schemas/{id}/"
payload = {
"id": "0631f213-ca91-41e0-9a88-7430c7d0ca28",
"name": "last - email",
"fields": [
{
"key": "lastName",
"type": "string",
"label": "last",
"validators": [{ "validate": "required" }]
},
{
"key": "email",
"type": "email",
"label": "email",
"validators": [{ "validate": "required" }]
}
],
"settings": {
"type": "object",
"properties": {
"importIdentifier": { "type": "string" },
"title": { "type": "string" },
"allowInvalidSubmit": { "type": "boolean" },
"invalidDataBehavior": {
"type": "string",
"enum": ["BLOCK_SUBMIT", "INCLUDE_INVALID_ROWS", "REMOVE_INVALID_ROWS", "INCLUDE_INVALID_ROWS_AND_VALUES"]
},
"backendSync": { "type": "boolean" },
"backendSyncMode": {
"type": "string",
"enum": ["DISABLED", "FULL_DATA", "MAPPINGS_ONLY"]
},
"manualInputDisabled": { "type": "boolean" },
"manualInputOnly": { "type": "boolean" },
"allowCustomFields": { "type": "boolean" },
"passThroughUnmappedColumns": { "type": "boolean" },
"maxRecords": { "oneOf": [{ "type": "integer" }, { "type": "null" }] },
"developmentMode": { "type": "boolean" },
"displayEncoding": { "type": "boolean" },
"styleOverrides": { "type": "object" },
"maxFileSize": { "type": "integer" },
"webhookUrl": { "oneOf": [{ "type": "string" }, { "type": "null" }] },
"needsReviewWebhookUrl": { "oneOf": [{ "type": "string" }, { "type": "null" }] },
"initialData": { "oneOf": [{ "type": "array" }, { "type": "null" }] }
},
"additionalProperties": False
},
"hooks": {
"type": "object",
"properties": {
"rowHooks": {
"type": "array",
"items": { "type": "string" }
},
"bulkRowHooks": {
"type": "array",
"items": { "type": "string" }
},
"rowDeleteHooks": {
"type": "array",
"items": { "type": "string" }
},
"beforeFinishCallback": { "type": "string" },
"columnHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fieldName": { "type": "string" },
"callback": { "type": "string" }
},
"required": ["fieldName", "callback"],
"additionalProperties": False
}
},
"stepHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["UPLOAD_STEP", "REVIEW_STEP", "REVIEW_STEP_POST_HOOKS"]
},
"callback": { "type": "string" }
},
"required": ["type", "callback"],
"additionalProperties": False
}
}
},
"additionalProperties": False
}
}
headers = {
"X-Dromo-License-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Dromo-License-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '0631f213-ca91-41e0-9a88-7430c7d0ca28',
name: 'last - email',
fields: [
{
key: 'lastName',
type: 'string',
label: 'last',
validators: [{validate: 'required'}]
},
{
key: 'email',
type: 'email',
label: 'email',
validators: [{validate: 'required'}]
}
],
settings: {
type: 'object',
properties: {
importIdentifier: {type: 'string'},
title: {type: 'string'},
allowInvalidSubmit: {type: 'boolean'},
invalidDataBehavior: {
type: 'string',
enum: [
'BLOCK_SUBMIT',
'INCLUDE_INVALID_ROWS',
'REMOVE_INVALID_ROWS',
'INCLUDE_INVALID_ROWS_AND_VALUES'
]
},
backendSync: {type: 'boolean'},
backendSyncMode: {type: 'string', enum: ['DISABLED', 'FULL_DATA', 'MAPPINGS_ONLY']},
manualInputDisabled: {type: 'boolean'},
manualInputOnly: {type: 'boolean'},
allowCustomFields: {type: 'boolean'},
passThroughUnmappedColumns: {type: 'boolean'},
maxRecords: {oneOf: [{type: 'integer'}, {type: 'null'}]},
developmentMode: {type: 'boolean'},
displayEncoding: {type: 'boolean'},
styleOverrides: {type: 'object'},
maxFileSize: {type: 'integer'},
webhookUrl: {oneOf: [{type: 'string'}, {type: 'null'}]},
needsReviewWebhookUrl: {oneOf: [{type: 'string'}, {type: 'null'}]},
initialData: {oneOf: [{type: 'array'}, {type: 'null'}]}
},
additionalProperties: false
},
hooks: {
type: 'object',
properties: {
rowHooks: {type: 'array', items: {type: 'string'}},
bulkRowHooks: {type: 'array', items: {type: 'string'}},
rowDeleteHooks: {type: 'array', items: {type: 'string'}},
beforeFinishCallback: {type: 'string'},
columnHooks: {
type: 'array',
items: {
type: 'object',
properties: {fieldName: {type: 'string'}, callback: {type: 'string'}},
required: ['fieldName', 'callback'],
additionalProperties: false
}
},
stepHooks: {
type: 'array',
items: {
type: 'object',
properties: {
type: {type: 'string', enum: ['UPLOAD_STEP', 'REVIEW_STEP', 'REVIEW_STEP_POST_HOOKS']},
callback: {type: 'string'}
},
required: ['type', 'callback'],
additionalProperties: false
}
}
},
additionalProperties: false
}
})
};
fetch('https://app.dromo.io/api/v1/schemas/{id}/', 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://app.dromo.io/api/v1/schemas/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => '0631f213-ca91-41e0-9a88-7430c7d0ca28',
'name' => 'last - email',
'fields' => [
[
'key' => 'lastName',
'type' => 'string',
'label' => 'last',
'validators' => [
[
'validate' => 'required'
]
]
],
[
'key' => 'email',
'type' => 'email',
'label' => 'email',
'validators' => [
[
'validate' => 'required'
]
]
]
],
'settings' => [
'type' => 'object',
'properties' => [
'importIdentifier' => [
'type' => 'string'
],
'title' => [
'type' => 'string'
],
'allowInvalidSubmit' => [
'type' => 'boolean'
],
'invalidDataBehavior' => [
'type' => 'string',
'enum' => [
'BLOCK_SUBMIT',
'INCLUDE_INVALID_ROWS',
'REMOVE_INVALID_ROWS',
'INCLUDE_INVALID_ROWS_AND_VALUES'
]
],
'backendSync' => [
'type' => 'boolean'
],
'backendSyncMode' => [
'type' => 'string',
'enum' => [
'DISABLED',
'FULL_DATA',
'MAPPINGS_ONLY'
]
],
'manualInputDisabled' => [
'type' => 'boolean'
],
'manualInputOnly' => [
'type' => 'boolean'
],
'allowCustomFields' => [
'type' => 'boolean'
],
'passThroughUnmappedColumns' => [
'type' => 'boolean'
],
'maxRecords' => [
'oneOf' => [
[
'type' => 'integer'
],
[
'type' => 'null'
]
]
],
'developmentMode' => [
'type' => 'boolean'
],
'displayEncoding' => [
'type' => 'boolean'
],
'styleOverrides' => [
'type' => 'object'
],
'maxFileSize' => [
'type' => 'integer'
],
'webhookUrl' => [
'oneOf' => [
[
'type' => 'string'
],
[
'type' => 'null'
]
]
],
'needsReviewWebhookUrl' => [
'oneOf' => [
[
'type' => 'string'
],
[
'type' => 'null'
]
]
],
'initialData' => [
'oneOf' => [
[
'type' => 'array'
],
[
'type' => 'null'
]
]
]
],
'additionalProperties' => false
],
'hooks' => [
'type' => 'object',
'properties' => [
'rowHooks' => [
'type' => 'array',
'items' => [
'type' => 'string'
]
],
'bulkRowHooks' => [
'type' => 'array',
'items' => [
'type' => 'string'
]
],
'rowDeleteHooks' => [
'type' => 'array',
'items' => [
'type' => 'string'
]
],
'beforeFinishCallback' => [
'type' => 'string'
],
'columnHooks' => [
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'fieldName' => [
'type' => 'string'
],
'callback' => [
'type' => 'string'
]
],
'required' => [
'fieldName',
'callback'
],
'additionalProperties' => false
]
],
'stepHooks' => [
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'type' => [
'type' => 'string',
'enum' => [
'UPLOAD_STEP',
'REVIEW_STEP',
'REVIEW_STEP_POST_HOOKS'
]
],
'callback' => [
'type' => 'string'
]
],
'required' => [
'type',
'callback'
],
'additionalProperties' => false
]
]
],
'additionalProperties' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Dromo-License-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://app.dromo.io/api/v1/schemas/{id}/"
payload := strings.NewReader("{\n \"id\": \"0631f213-ca91-41e0-9a88-7430c7d0ca28\",\n \"name\": \"last - email\",\n \"fields\": [\n {\n \"key\": \"lastName\",\n \"type\": \"string\",\n \"label\": \"last\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n },\n {\n \"key\": \"email\",\n \"type\": \"email\",\n \"label\": \"email\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n }\n ],\n \"settings\": {\n \"type\": \"object\",\n \"properties\": {\n \"importIdentifier\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"allowInvalidSubmit\": {\n \"type\": \"boolean\"\n },\n \"invalidDataBehavior\": {\n \"type\": \"string\",\n \"enum\": [\n \"BLOCK_SUBMIT\",\n \"INCLUDE_INVALID_ROWS\",\n \"REMOVE_INVALID_ROWS\",\n \"INCLUDE_INVALID_ROWS_AND_VALUES\"\n ]\n },\n \"backendSync\": {\n \"type\": \"boolean\"\n },\n \"backendSyncMode\": {\n \"type\": \"string\",\n \"enum\": [\n \"DISABLED\",\n \"FULL_DATA\",\n \"MAPPINGS_ONLY\"\n ]\n },\n \"manualInputDisabled\": {\n \"type\": \"boolean\"\n },\n \"manualInputOnly\": {\n \"type\": \"boolean\"\n },\n \"allowCustomFields\": {\n \"type\": \"boolean\"\n },\n \"passThroughUnmappedColumns\": {\n \"type\": \"boolean\"\n },\n \"maxRecords\": {\n \"oneOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"developmentMode\": {\n \"type\": \"boolean\"\n },\n \"displayEncoding\": {\n \"type\": \"boolean\"\n },\n \"styleOverrides\": {\n \"type\": \"object\"\n },\n \"maxFileSize\": {\n \"type\": \"integer\"\n },\n \"webhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"needsReviewWebhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"initialData\": {\n \"oneOf\": [\n {\n \"type\": \"array\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"hooks\": {\n \"type\": \"object\",\n \"properties\": {\n \"rowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"bulkRowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"rowDeleteHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"beforeFinishCallback\": {\n \"type\": \"string\"\n },\n \"columnHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"fieldName\": {\n \"type\": \"string\"\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldName\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n },\n \"stepHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"UPLOAD_STEP\",\n \"REVIEW_STEP\",\n \"REVIEW_STEP_POST_HOOKS\"\n ]\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"additionalProperties\": false\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Dromo-License-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.put("https://app.dromo.io/api/v1/schemas/{id}/")
.header("X-Dromo-License-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"0631f213-ca91-41e0-9a88-7430c7d0ca28\",\n \"name\": \"last - email\",\n \"fields\": [\n {\n \"key\": \"lastName\",\n \"type\": \"string\",\n \"label\": \"last\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n },\n {\n \"key\": \"email\",\n \"type\": \"email\",\n \"label\": \"email\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n }\n ],\n \"settings\": {\n \"type\": \"object\",\n \"properties\": {\n \"importIdentifier\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"allowInvalidSubmit\": {\n \"type\": \"boolean\"\n },\n \"invalidDataBehavior\": {\n \"type\": \"string\",\n \"enum\": [\n \"BLOCK_SUBMIT\",\n \"INCLUDE_INVALID_ROWS\",\n \"REMOVE_INVALID_ROWS\",\n \"INCLUDE_INVALID_ROWS_AND_VALUES\"\n ]\n },\n \"backendSync\": {\n \"type\": \"boolean\"\n },\n \"backendSyncMode\": {\n \"type\": \"string\",\n \"enum\": [\n \"DISABLED\",\n \"FULL_DATA\",\n \"MAPPINGS_ONLY\"\n ]\n },\n \"manualInputDisabled\": {\n \"type\": \"boolean\"\n },\n \"manualInputOnly\": {\n \"type\": \"boolean\"\n },\n \"allowCustomFields\": {\n \"type\": \"boolean\"\n },\n \"passThroughUnmappedColumns\": {\n \"type\": \"boolean\"\n },\n \"maxRecords\": {\n \"oneOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"developmentMode\": {\n \"type\": \"boolean\"\n },\n \"displayEncoding\": {\n \"type\": \"boolean\"\n },\n \"styleOverrides\": {\n \"type\": \"object\"\n },\n \"maxFileSize\": {\n \"type\": \"integer\"\n },\n \"webhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"needsReviewWebhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"initialData\": {\n \"oneOf\": [\n {\n \"type\": \"array\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"hooks\": {\n \"type\": \"object\",\n \"properties\": {\n \"rowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"bulkRowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"rowDeleteHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"beforeFinishCallback\": {\n \"type\": \"string\"\n },\n \"columnHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"fieldName\": {\n \"type\": \"string\"\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldName\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n },\n \"stepHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"UPLOAD_STEP\",\n \"REVIEW_STEP\",\n \"REVIEW_STEP_POST_HOOKS\"\n ]\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"additionalProperties\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dromo.io/api/v1/schemas/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Dromo-License-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"0631f213-ca91-41e0-9a88-7430c7d0ca28\",\n \"name\": \"last - email\",\n \"fields\": [\n {\n \"key\": \"lastName\",\n \"type\": \"string\",\n \"label\": \"last\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n },\n {\n \"key\": \"email\",\n \"type\": \"email\",\n \"label\": \"email\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n }\n ],\n \"settings\": {\n \"type\": \"object\",\n \"properties\": {\n \"importIdentifier\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"allowInvalidSubmit\": {\n \"type\": \"boolean\"\n },\n \"invalidDataBehavior\": {\n \"type\": \"string\",\n \"enum\": [\n \"BLOCK_SUBMIT\",\n \"INCLUDE_INVALID_ROWS\",\n \"REMOVE_INVALID_ROWS\",\n \"INCLUDE_INVALID_ROWS_AND_VALUES\"\n ]\n },\n \"backendSync\": {\n \"type\": \"boolean\"\n },\n \"backendSyncMode\": {\n \"type\": \"string\",\n \"enum\": [\n \"DISABLED\",\n \"FULL_DATA\",\n \"MAPPINGS_ONLY\"\n ]\n },\n \"manualInputDisabled\": {\n \"type\": \"boolean\"\n },\n \"manualInputOnly\": {\n \"type\": \"boolean\"\n },\n \"allowCustomFields\": {\n \"type\": \"boolean\"\n },\n \"passThroughUnmappedColumns\": {\n \"type\": \"boolean\"\n },\n \"maxRecords\": {\n \"oneOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"developmentMode\": {\n \"type\": \"boolean\"\n },\n \"displayEncoding\": {\n \"type\": \"boolean\"\n },\n \"styleOverrides\": {\n \"type\": \"object\"\n },\n \"maxFileSize\": {\n \"type\": \"integer\"\n },\n \"webhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"needsReviewWebhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"initialData\": {\n \"oneOf\": [\n {\n \"type\": \"array\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"hooks\": {\n \"type\": \"object\",\n \"properties\": {\n \"rowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"bulkRowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"rowDeleteHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"beforeFinishCallback\": {\n \"type\": \"string\"\n },\n \"columnHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"fieldName\": {\n \"type\": \"string\"\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldName\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n },\n \"stepHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"UPLOAD_STEP\",\n \"REVIEW_STEP\",\n \"REVIEW_STEP_POST_HOOKS\"\n ]\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"additionalProperties\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "0631f213-ca91-41e0-9a88-7430c7d0ca28",
"name": "last - email",
"fields": [
{
"key": "lastName",
"type": "string",
"label": "last",
"validators": [
{
"validate": "required"
}
]
},
{
"key": "email",
"type": "email",
"label": "email",
"validators": [
{
"validate": "required"
}
]
}
],
"settings": {
"type": "object",
"properties": {
"importIdentifier": {
"type": "string"
},
"title": {
"type": "string"
},
"allowInvalidSubmit": {
"type": "boolean"
},
"invalidDataBehavior": {
"type": "string",
"enum": [
"BLOCK_SUBMIT",
"INCLUDE_INVALID_ROWS",
"REMOVE_INVALID_ROWS",
"INCLUDE_INVALID_ROWS_AND_VALUES"
]
},
"backendSync": {
"type": "boolean"
},
"backendSyncMode": {
"type": "string",
"enum": [
"DISABLED",
"FULL_DATA",
"MAPPINGS_ONLY"
]
},
"manualInputDisabled": {
"type": "boolean"
},
"manualInputOnly": {
"type": "boolean"
},
"allowCustomFields": {
"type": "boolean"
},
"passThroughUnmappedColumns": {
"type": "boolean"
},
"maxRecords": {
"oneOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"developmentMode": {
"type": "boolean"
},
"displayEncoding": {
"type": "boolean"
},
"styleOverrides": {
"type": "object"
},
"maxFileSize": {
"type": "integer"
},
"webhookUrl": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"needsReviewWebhookUrl": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"initialData": {
"oneOf": [
{
"type": "array"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
"hooks": {
"type": "object",
"properties": {
"rowHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"bulkRowHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"rowDeleteHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"beforeFinishCallback": {
"type": "string"
},
"columnHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fieldName": {
"type": "string"
},
"callback": {
"type": "string"
}
},
"required": [
"fieldName",
"callback"
],
"additionalProperties": false
}
},
"stepHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPLOAD_STEP",
"REVIEW_STEP",
"REVIEW_STEP_POST_HOOKS"
]
},
"callback": {
"type": "string"
}
},
"required": [
"type",
"callback"
],
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}Authorizations
This backend API key is different than your frontend license key. Please use the "Backend" license key from your Dromo Dashboard.
Path Parameters
Headless import ID
Example:
"66d6300d-1414-4655-83b4-8c80fc527315"
Body
application/json
⌘I
Update an import schema
curl --request PUT \
--url https://app.dromo.io/api/v1/schemas/{id}/ \
--header 'Content-Type: application/json' \
--header 'X-Dromo-License-Key: <api-key>' \
--data '
{
"id": "0631f213-ca91-41e0-9a88-7430c7d0ca28",
"name": "last - email",
"fields": [
{
"key": "lastName",
"type": "string",
"label": "last",
"validators": [
{
"validate": "required"
}
]
},
{
"key": "email",
"type": "email",
"label": "email",
"validators": [
{
"validate": "required"
}
]
}
],
"settings": {
"type": "object",
"properties": {
"importIdentifier": {
"type": "string"
},
"title": {
"type": "string"
},
"allowInvalidSubmit": {
"type": "boolean"
},
"invalidDataBehavior": {
"type": "string",
"enum": [
"BLOCK_SUBMIT",
"INCLUDE_INVALID_ROWS",
"REMOVE_INVALID_ROWS",
"INCLUDE_INVALID_ROWS_AND_VALUES"
]
},
"backendSync": {
"type": "boolean"
},
"backendSyncMode": {
"type": "string",
"enum": [
"DISABLED",
"FULL_DATA",
"MAPPINGS_ONLY"
]
},
"manualInputDisabled": {
"type": "boolean"
},
"manualInputOnly": {
"type": "boolean"
},
"allowCustomFields": {
"type": "boolean"
},
"passThroughUnmappedColumns": {
"type": "boolean"
},
"maxRecords": {
"oneOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"developmentMode": {
"type": "boolean"
},
"displayEncoding": {
"type": "boolean"
},
"styleOverrides": {
"type": "object"
},
"maxFileSize": {
"type": "integer"
},
"webhookUrl": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"needsReviewWebhookUrl": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"initialData": {
"oneOf": [
{
"type": "array"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
"hooks": {
"type": "object",
"properties": {
"rowHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"bulkRowHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"rowDeleteHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"beforeFinishCallback": {
"type": "string"
},
"columnHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fieldName": {
"type": "string"
},
"callback": {
"type": "string"
}
},
"required": [
"fieldName",
"callback"
],
"additionalProperties": false
}
},
"stepHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPLOAD_STEP",
"REVIEW_STEP",
"REVIEW_STEP_POST_HOOKS"
]
},
"callback": {
"type": "string"
}
},
"required": [
"type",
"callback"
],
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
'import requests
url = "https://app.dromo.io/api/v1/schemas/{id}/"
payload = {
"id": "0631f213-ca91-41e0-9a88-7430c7d0ca28",
"name": "last - email",
"fields": [
{
"key": "lastName",
"type": "string",
"label": "last",
"validators": [{ "validate": "required" }]
},
{
"key": "email",
"type": "email",
"label": "email",
"validators": [{ "validate": "required" }]
}
],
"settings": {
"type": "object",
"properties": {
"importIdentifier": { "type": "string" },
"title": { "type": "string" },
"allowInvalidSubmit": { "type": "boolean" },
"invalidDataBehavior": {
"type": "string",
"enum": ["BLOCK_SUBMIT", "INCLUDE_INVALID_ROWS", "REMOVE_INVALID_ROWS", "INCLUDE_INVALID_ROWS_AND_VALUES"]
},
"backendSync": { "type": "boolean" },
"backendSyncMode": {
"type": "string",
"enum": ["DISABLED", "FULL_DATA", "MAPPINGS_ONLY"]
},
"manualInputDisabled": { "type": "boolean" },
"manualInputOnly": { "type": "boolean" },
"allowCustomFields": { "type": "boolean" },
"passThroughUnmappedColumns": { "type": "boolean" },
"maxRecords": { "oneOf": [{ "type": "integer" }, { "type": "null" }] },
"developmentMode": { "type": "boolean" },
"displayEncoding": { "type": "boolean" },
"styleOverrides": { "type": "object" },
"maxFileSize": { "type": "integer" },
"webhookUrl": { "oneOf": [{ "type": "string" }, { "type": "null" }] },
"needsReviewWebhookUrl": { "oneOf": [{ "type": "string" }, { "type": "null" }] },
"initialData": { "oneOf": [{ "type": "array" }, { "type": "null" }] }
},
"additionalProperties": False
},
"hooks": {
"type": "object",
"properties": {
"rowHooks": {
"type": "array",
"items": { "type": "string" }
},
"bulkRowHooks": {
"type": "array",
"items": { "type": "string" }
},
"rowDeleteHooks": {
"type": "array",
"items": { "type": "string" }
},
"beforeFinishCallback": { "type": "string" },
"columnHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fieldName": { "type": "string" },
"callback": { "type": "string" }
},
"required": ["fieldName", "callback"],
"additionalProperties": False
}
},
"stepHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": ["UPLOAD_STEP", "REVIEW_STEP", "REVIEW_STEP_POST_HOOKS"]
},
"callback": { "type": "string" }
},
"required": ["type", "callback"],
"additionalProperties": False
}
}
},
"additionalProperties": False
}
}
headers = {
"X-Dromo-License-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Dromo-License-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '0631f213-ca91-41e0-9a88-7430c7d0ca28',
name: 'last - email',
fields: [
{
key: 'lastName',
type: 'string',
label: 'last',
validators: [{validate: 'required'}]
},
{
key: 'email',
type: 'email',
label: 'email',
validators: [{validate: 'required'}]
}
],
settings: {
type: 'object',
properties: {
importIdentifier: {type: 'string'},
title: {type: 'string'},
allowInvalidSubmit: {type: 'boolean'},
invalidDataBehavior: {
type: 'string',
enum: [
'BLOCK_SUBMIT',
'INCLUDE_INVALID_ROWS',
'REMOVE_INVALID_ROWS',
'INCLUDE_INVALID_ROWS_AND_VALUES'
]
},
backendSync: {type: 'boolean'},
backendSyncMode: {type: 'string', enum: ['DISABLED', 'FULL_DATA', 'MAPPINGS_ONLY']},
manualInputDisabled: {type: 'boolean'},
manualInputOnly: {type: 'boolean'},
allowCustomFields: {type: 'boolean'},
passThroughUnmappedColumns: {type: 'boolean'},
maxRecords: {oneOf: [{type: 'integer'}, {type: 'null'}]},
developmentMode: {type: 'boolean'},
displayEncoding: {type: 'boolean'},
styleOverrides: {type: 'object'},
maxFileSize: {type: 'integer'},
webhookUrl: {oneOf: [{type: 'string'}, {type: 'null'}]},
needsReviewWebhookUrl: {oneOf: [{type: 'string'}, {type: 'null'}]},
initialData: {oneOf: [{type: 'array'}, {type: 'null'}]}
},
additionalProperties: false
},
hooks: {
type: 'object',
properties: {
rowHooks: {type: 'array', items: {type: 'string'}},
bulkRowHooks: {type: 'array', items: {type: 'string'}},
rowDeleteHooks: {type: 'array', items: {type: 'string'}},
beforeFinishCallback: {type: 'string'},
columnHooks: {
type: 'array',
items: {
type: 'object',
properties: {fieldName: {type: 'string'}, callback: {type: 'string'}},
required: ['fieldName', 'callback'],
additionalProperties: false
}
},
stepHooks: {
type: 'array',
items: {
type: 'object',
properties: {
type: {type: 'string', enum: ['UPLOAD_STEP', 'REVIEW_STEP', 'REVIEW_STEP_POST_HOOKS']},
callback: {type: 'string'}
},
required: ['type', 'callback'],
additionalProperties: false
}
}
},
additionalProperties: false
}
})
};
fetch('https://app.dromo.io/api/v1/schemas/{id}/', 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://app.dromo.io/api/v1/schemas/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'id' => '0631f213-ca91-41e0-9a88-7430c7d0ca28',
'name' => 'last - email',
'fields' => [
[
'key' => 'lastName',
'type' => 'string',
'label' => 'last',
'validators' => [
[
'validate' => 'required'
]
]
],
[
'key' => 'email',
'type' => 'email',
'label' => 'email',
'validators' => [
[
'validate' => 'required'
]
]
]
],
'settings' => [
'type' => 'object',
'properties' => [
'importIdentifier' => [
'type' => 'string'
],
'title' => [
'type' => 'string'
],
'allowInvalidSubmit' => [
'type' => 'boolean'
],
'invalidDataBehavior' => [
'type' => 'string',
'enum' => [
'BLOCK_SUBMIT',
'INCLUDE_INVALID_ROWS',
'REMOVE_INVALID_ROWS',
'INCLUDE_INVALID_ROWS_AND_VALUES'
]
],
'backendSync' => [
'type' => 'boolean'
],
'backendSyncMode' => [
'type' => 'string',
'enum' => [
'DISABLED',
'FULL_DATA',
'MAPPINGS_ONLY'
]
],
'manualInputDisabled' => [
'type' => 'boolean'
],
'manualInputOnly' => [
'type' => 'boolean'
],
'allowCustomFields' => [
'type' => 'boolean'
],
'passThroughUnmappedColumns' => [
'type' => 'boolean'
],
'maxRecords' => [
'oneOf' => [
[
'type' => 'integer'
],
[
'type' => 'null'
]
]
],
'developmentMode' => [
'type' => 'boolean'
],
'displayEncoding' => [
'type' => 'boolean'
],
'styleOverrides' => [
'type' => 'object'
],
'maxFileSize' => [
'type' => 'integer'
],
'webhookUrl' => [
'oneOf' => [
[
'type' => 'string'
],
[
'type' => 'null'
]
]
],
'needsReviewWebhookUrl' => [
'oneOf' => [
[
'type' => 'string'
],
[
'type' => 'null'
]
]
],
'initialData' => [
'oneOf' => [
[
'type' => 'array'
],
[
'type' => 'null'
]
]
]
],
'additionalProperties' => false
],
'hooks' => [
'type' => 'object',
'properties' => [
'rowHooks' => [
'type' => 'array',
'items' => [
'type' => 'string'
]
],
'bulkRowHooks' => [
'type' => 'array',
'items' => [
'type' => 'string'
]
],
'rowDeleteHooks' => [
'type' => 'array',
'items' => [
'type' => 'string'
]
],
'beforeFinishCallback' => [
'type' => 'string'
],
'columnHooks' => [
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'fieldName' => [
'type' => 'string'
],
'callback' => [
'type' => 'string'
]
],
'required' => [
'fieldName',
'callback'
],
'additionalProperties' => false
]
],
'stepHooks' => [
'type' => 'array',
'items' => [
'type' => 'object',
'properties' => [
'type' => [
'type' => 'string',
'enum' => [
'UPLOAD_STEP',
'REVIEW_STEP',
'REVIEW_STEP_POST_HOOKS'
]
],
'callback' => [
'type' => 'string'
]
],
'required' => [
'type',
'callback'
],
'additionalProperties' => false
]
]
],
'additionalProperties' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Dromo-License-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://app.dromo.io/api/v1/schemas/{id}/"
payload := strings.NewReader("{\n \"id\": \"0631f213-ca91-41e0-9a88-7430c7d0ca28\",\n \"name\": \"last - email\",\n \"fields\": [\n {\n \"key\": \"lastName\",\n \"type\": \"string\",\n \"label\": \"last\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n },\n {\n \"key\": \"email\",\n \"type\": \"email\",\n \"label\": \"email\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n }\n ],\n \"settings\": {\n \"type\": \"object\",\n \"properties\": {\n \"importIdentifier\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"allowInvalidSubmit\": {\n \"type\": \"boolean\"\n },\n \"invalidDataBehavior\": {\n \"type\": \"string\",\n \"enum\": [\n \"BLOCK_SUBMIT\",\n \"INCLUDE_INVALID_ROWS\",\n \"REMOVE_INVALID_ROWS\",\n \"INCLUDE_INVALID_ROWS_AND_VALUES\"\n ]\n },\n \"backendSync\": {\n \"type\": \"boolean\"\n },\n \"backendSyncMode\": {\n \"type\": \"string\",\n \"enum\": [\n \"DISABLED\",\n \"FULL_DATA\",\n \"MAPPINGS_ONLY\"\n ]\n },\n \"manualInputDisabled\": {\n \"type\": \"boolean\"\n },\n \"manualInputOnly\": {\n \"type\": \"boolean\"\n },\n \"allowCustomFields\": {\n \"type\": \"boolean\"\n },\n \"passThroughUnmappedColumns\": {\n \"type\": \"boolean\"\n },\n \"maxRecords\": {\n \"oneOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"developmentMode\": {\n \"type\": \"boolean\"\n },\n \"displayEncoding\": {\n \"type\": \"boolean\"\n },\n \"styleOverrides\": {\n \"type\": \"object\"\n },\n \"maxFileSize\": {\n \"type\": \"integer\"\n },\n \"webhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"needsReviewWebhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"initialData\": {\n \"oneOf\": [\n {\n \"type\": \"array\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"hooks\": {\n \"type\": \"object\",\n \"properties\": {\n \"rowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"bulkRowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"rowDeleteHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"beforeFinishCallback\": {\n \"type\": \"string\"\n },\n \"columnHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"fieldName\": {\n \"type\": \"string\"\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldName\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n },\n \"stepHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"UPLOAD_STEP\",\n \"REVIEW_STEP\",\n \"REVIEW_STEP_POST_HOOKS\"\n ]\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"additionalProperties\": false\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Dromo-License-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.put("https://app.dromo.io/api/v1/schemas/{id}/")
.header("X-Dromo-License-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"0631f213-ca91-41e0-9a88-7430c7d0ca28\",\n \"name\": \"last - email\",\n \"fields\": [\n {\n \"key\": \"lastName\",\n \"type\": \"string\",\n \"label\": \"last\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n },\n {\n \"key\": \"email\",\n \"type\": \"email\",\n \"label\": \"email\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n }\n ],\n \"settings\": {\n \"type\": \"object\",\n \"properties\": {\n \"importIdentifier\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"allowInvalidSubmit\": {\n \"type\": \"boolean\"\n },\n \"invalidDataBehavior\": {\n \"type\": \"string\",\n \"enum\": [\n \"BLOCK_SUBMIT\",\n \"INCLUDE_INVALID_ROWS\",\n \"REMOVE_INVALID_ROWS\",\n \"INCLUDE_INVALID_ROWS_AND_VALUES\"\n ]\n },\n \"backendSync\": {\n \"type\": \"boolean\"\n },\n \"backendSyncMode\": {\n \"type\": \"string\",\n \"enum\": [\n \"DISABLED\",\n \"FULL_DATA\",\n \"MAPPINGS_ONLY\"\n ]\n },\n \"manualInputDisabled\": {\n \"type\": \"boolean\"\n },\n \"manualInputOnly\": {\n \"type\": \"boolean\"\n },\n \"allowCustomFields\": {\n \"type\": \"boolean\"\n },\n \"passThroughUnmappedColumns\": {\n \"type\": \"boolean\"\n },\n \"maxRecords\": {\n \"oneOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"developmentMode\": {\n \"type\": \"boolean\"\n },\n \"displayEncoding\": {\n \"type\": \"boolean\"\n },\n \"styleOverrides\": {\n \"type\": \"object\"\n },\n \"maxFileSize\": {\n \"type\": \"integer\"\n },\n \"webhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"needsReviewWebhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"initialData\": {\n \"oneOf\": [\n {\n \"type\": \"array\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"hooks\": {\n \"type\": \"object\",\n \"properties\": {\n \"rowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"bulkRowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"rowDeleteHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"beforeFinishCallback\": {\n \"type\": \"string\"\n },\n \"columnHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"fieldName\": {\n \"type\": \"string\"\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldName\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n },\n \"stepHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"UPLOAD_STEP\",\n \"REVIEW_STEP\",\n \"REVIEW_STEP_POST_HOOKS\"\n ]\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"additionalProperties\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.dromo.io/api/v1/schemas/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Dromo-License-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"0631f213-ca91-41e0-9a88-7430c7d0ca28\",\n \"name\": \"last - email\",\n \"fields\": [\n {\n \"key\": \"lastName\",\n \"type\": \"string\",\n \"label\": \"last\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n },\n {\n \"key\": \"email\",\n \"type\": \"email\",\n \"label\": \"email\",\n \"validators\": [\n {\n \"validate\": \"required\"\n }\n ]\n }\n ],\n \"settings\": {\n \"type\": \"object\",\n \"properties\": {\n \"importIdentifier\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"allowInvalidSubmit\": {\n \"type\": \"boolean\"\n },\n \"invalidDataBehavior\": {\n \"type\": \"string\",\n \"enum\": [\n \"BLOCK_SUBMIT\",\n \"INCLUDE_INVALID_ROWS\",\n \"REMOVE_INVALID_ROWS\",\n \"INCLUDE_INVALID_ROWS_AND_VALUES\"\n ]\n },\n \"backendSync\": {\n \"type\": \"boolean\"\n },\n \"backendSyncMode\": {\n \"type\": \"string\",\n \"enum\": [\n \"DISABLED\",\n \"FULL_DATA\",\n \"MAPPINGS_ONLY\"\n ]\n },\n \"manualInputDisabled\": {\n \"type\": \"boolean\"\n },\n \"manualInputOnly\": {\n \"type\": \"boolean\"\n },\n \"allowCustomFields\": {\n \"type\": \"boolean\"\n },\n \"passThroughUnmappedColumns\": {\n \"type\": \"boolean\"\n },\n \"maxRecords\": {\n \"oneOf\": [\n {\n \"type\": \"integer\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"developmentMode\": {\n \"type\": \"boolean\"\n },\n \"displayEncoding\": {\n \"type\": \"boolean\"\n },\n \"styleOverrides\": {\n \"type\": \"object\"\n },\n \"maxFileSize\": {\n \"type\": \"integer\"\n },\n \"webhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"needsReviewWebhookUrl\": {\n \"oneOf\": [\n {\n \"type\": \"string\"\n },\n {\n \"type\": \"null\"\n }\n ]\n },\n \"initialData\": {\n \"oneOf\": [\n {\n \"type\": \"array\"\n },\n {\n \"type\": \"null\"\n }\n ]\n }\n },\n \"additionalProperties\": false\n },\n \"hooks\": {\n \"type\": \"object\",\n \"properties\": {\n \"rowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"bulkRowHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"rowDeleteHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"beforeFinishCallback\": {\n \"type\": \"string\"\n },\n \"columnHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"fieldName\": {\n \"type\": \"string\"\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"fieldName\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n },\n \"stepHooks\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"type\": {\n \"type\": \"string\",\n \"enum\": [\n \"UPLOAD_STEP\",\n \"REVIEW_STEP\",\n \"REVIEW_STEP_POST_HOOKS\"\n ]\n },\n \"callback\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"type\",\n \"callback\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"additionalProperties\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "0631f213-ca91-41e0-9a88-7430c7d0ca28",
"name": "last - email",
"fields": [
{
"key": "lastName",
"type": "string",
"label": "last",
"validators": [
{
"validate": "required"
}
]
},
{
"key": "email",
"type": "email",
"label": "email",
"validators": [
{
"validate": "required"
}
]
}
],
"settings": {
"type": "object",
"properties": {
"importIdentifier": {
"type": "string"
},
"title": {
"type": "string"
},
"allowInvalidSubmit": {
"type": "boolean"
},
"invalidDataBehavior": {
"type": "string",
"enum": [
"BLOCK_SUBMIT",
"INCLUDE_INVALID_ROWS",
"REMOVE_INVALID_ROWS",
"INCLUDE_INVALID_ROWS_AND_VALUES"
]
},
"backendSync": {
"type": "boolean"
},
"backendSyncMode": {
"type": "string",
"enum": [
"DISABLED",
"FULL_DATA",
"MAPPINGS_ONLY"
]
},
"manualInputDisabled": {
"type": "boolean"
},
"manualInputOnly": {
"type": "boolean"
},
"allowCustomFields": {
"type": "boolean"
},
"passThroughUnmappedColumns": {
"type": "boolean"
},
"maxRecords": {
"oneOf": [
{
"type": "integer"
},
{
"type": "null"
}
]
},
"developmentMode": {
"type": "boolean"
},
"displayEncoding": {
"type": "boolean"
},
"styleOverrides": {
"type": "object"
},
"maxFileSize": {
"type": "integer"
},
"webhookUrl": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"needsReviewWebhookUrl": {
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"initialData": {
"oneOf": [
{
"type": "array"
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
"hooks": {
"type": "object",
"properties": {
"rowHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"bulkRowHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"rowDeleteHooks": {
"type": "array",
"items": {
"type": "string"
}
},
"beforeFinishCallback": {
"type": "string"
},
"columnHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fieldName": {
"type": "string"
},
"callback": {
"type": "string"
}
},
"required": [
"fieldName",
"callback"
],
"additionalProperties": false
}
},
"stepHooks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"UPLOAD_STEP",
"REVIEW_STEP",
"REVIEW_STEP_POST_HOOKS"
]
},
"callback": {
"type": "string"
}
},
"required": [
"type",
"callback"
],
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}