Update an Existing Schema
PATCH
https://api.monetate.net/api/data/v1/{retailerShortname}/production/schema/{schema-name}/
Path Parameters
- schema-namestringrequiredDescription
Header Parameters
- acceptstringDescriptionDefaultapplication/jsonAllowedapplication/jsonmetadata
Body Parameters
- bodySchemaPatchExample
{ "name": "catalog", "type": "event", "fields": { "new_field": { "data_type": "STRING" } } }Description- fieldsmap<string, Field>requiredDescription
Responses
200
- SchemaPatchResponse
- metaResponseMetarequired
- codeintegerrequiredExampleDescription
- warningsobject[]Description
- errorsobject[]Description
- dataSchemaPatchrequiredExample
{ "name": "catalog", "type": "event", "fields": { "new_field": { "data_type": "STRING" } } }Description- fieldsmap<string, Field>requiredDescription
400
- Response
- metaResponseMetarequired
- codeintegerrequiredExampleDescription
- warningsobject[]Description
- errorsobject[]Description
- dataResponseAnyDatarequired
401
- Response
- metaResponseMetarequired
- codeintegerrequiredExampleDescription
- warningsobject[]Description
- errorsobject[]Description
- dataResponseAnyDatarequired
403
- Response
- metaResponseMetarequired
- codeintegerrequiredExampleDescription
- warningsobject[]Description
- errorsobject[]Description
- dataResponseAnyDatarequired
500
- Response
- metaResponseMetarequired
- codeintegerrequiredExampleDescription
- warningsobject[]Description
- errorsobject[]Description
- dataResponseAnyDatarequired
curl
curl --request PATCH \
--url https://api.monetate.net/api/data/v1/{retailerShortname}/production/schema/{schema-name}/ \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"fields": ""
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"fields": ""
});
var requestOptions = {
method: 'PATCH',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.monetate.net/api/data/v1/{retailerShortname}/production/schema/{schema-name}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.monetate.net/api/data/v1/{retailerShortname}/production/schema/{schema-name}/")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request.body = JSON.dump({
"fields": ""
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.monetate.net/api/data/v1/{retailerShortname}/production/schema/{schema-name}/"
payload = json.dumps({
"fields": ""
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PATCH", url, headers=headers, data=payload)
print(response.text)
200
// Schema patched. Content is the definition of the modified Schema.
{
"meta": {
"code": 200,
"warnings": [
{}
],
"errors": [
{}
]
},
"data": {
"fields": ""
}
}400
// Validation error.
One or more values being sent was not in the correct format, or a required value was missing.
{
"meta": {
"code": 200,
"warnings": [
{}
],
"errors": [
{}
]
},
"data": {}
}401
// Unauthorized.
The request did not include a token, or the token provided was invalid. Please ensure that your token is correct and that the Authorization header is properly formatted.
{
"meta": {
"code": 200,
"warnings": [
{}
],
"errors": [
{}
]
},
"data": {}
}403
// Forbidden.
The request included a token that has been revoked. Please contact your account administrator to generate a new token.
{
"meta": {
"code": 200,
"warnings": [
{}
],
"errors": [
{}
]
},
"data": {}
}500
// Unknown error.
Please try again or contact your account manager for more information.
{
"meta": {
"code": 200,
"warnings": [
{}
],
"errors": [
{}
]
},
"data": {}
}