Create a Custom Field
POST/v2/settings/extensions/custom-apis/:custom_api_id/fields
Create a Custom Field
Request
Path Parameters
The id of the Custom API.
- application/json
Body
- BooleanCustomFieldAttributes
- StringCustomFieldAttributes
- IntegerCustomFieldAttributes
- FloatCustomFieldAttributes
data object required
Specifies the type of the resource object, use custom_field
for Custom Field.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom Field.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: non-empty
and <= 63 characters
Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.
Possible values: [string
, integer
, boolean
, float
]
Specifies the type of the field. This field cannot be updated.
links object
meta object
timestamps objectrequired
validation object
boolean object
Default value: true
When set to true
, this allows null
values for that field on Custom API Entries. When set to false
, storing null
values is not permitted.
When set to true
, prevents changing the field.
Specifies the type of the resource object, use custom_field
for Custom Field.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom Field.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: non-empty
and <= 63 characters
Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.
Possible values: [string
, integer
, boolean
, float
]
Specifies the type of the field. This field cannot be updated.
links object
meta object
timestamps objectrequired
validation object
string object
Possible values: <= 65535
Specifies the minimum number of characters that can be stored.
Possible values: <= 65535
Specifies the minimum number of characters that can be stored.
Possible values: <= 1024 characters
RE2 regular expression that used to restrict the specific characters that can be stored.
Default value: true
When set to true
, this allows null
values for that field on Custom API Entries. When set to false
, storing null
values is not permitted.
nullable: false
Possible values: [yes
, no
]
Default value: no
If yes
, this prevents two Custom API entries from having the same value for this field within the Custom API. When set to no
(the default),
multiple Custom API entries may have the same value
Controls case-insensitive uniqueness for this field. Can only be set to true
if unique
is set to yes
.
If true
, prevents two Custom API entries from having the same value for this field within the Custom API, ignoring case differences.
When set to false
(the default), case is considered when checking for uniqueness.
This value can only be set during field creation and cannot be modified afterwards.
When set to true, the value of this field can be specified only during POST requests and cannot be modified during PUT requests.
Specifies the type of the resource object, use custom_field
for Custom Field.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom Field.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: non-empty
and <= 63 characters
Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.
Possible values: [string
, integer
, boolean
, float
]
Specifies the type of the field. This field cannot be updated.
links object
meta object
timestamps objectrequired
validation object
integer object
Specifies the minimum whole number that can be stored.
Specifies the maximum whole number that can be stored.
Default value: true
When set to true
, this allows null
values for that field on Custom API Entries. When set to false
, storing null
values is not permitted.
When set to true
, prevents changing the field.
Specifies the type of the resource object, use custom_field
for Custom Field.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom Field.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: non-empty
and <= 63 characters
Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.
Possible values: [string
, integer
, boolean
, float
]
Specifies the type of the field. This field cannot be updated.
links object
meta object
timestamps objectrequired
validation object
float object
Specifies the minimum whole number that can be stored.
Specifies the maximum whole number that can be stored.
Default value: true
When set to true
, this allows null
values for that field on Custom API Entries. When set to false
, storing null
values is not permitted.
When set to true
, prevents changing the field.
Responses
- 201
- 400
- 404
- 409
- 500
Created
- application/json
- Schema
- Example (from schema)
- string_field
- integer_field
- boolean_field
- float_field
Schema
- BooleanCustomFieldAttributes
- StringCustomFieldAttributes
- IntegerCustomFieldAttributes
- FloatCustomFieldAttributes
data object required
The unique identifier of the Custom Field.
Specifies the type of the resource object, use custom_field
for Custom Field.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom Field.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: non-empty
and <= 63 characters
Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.
Possible values: [string
, integer
, boolean
, float
]
Specifies the type of the field. This field cannot be updated.
links object
meta object
timestamps objectrequired
Specifies the date the entity is created.
Specifies the date the entity is last updated.
validation object
boolean object
Default value: true
When set to true
, this allows null
values for that field on Custom API Entries. When set to false
, storing null
values is not permitted.
When set to true
, prevents changing the field.
The unique identifier of the Custom Field.
Specifies the type of the resource object, use custom_field
for Custom Field.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom Field.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: non-empty
and <= 63 characters
Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.
Possible values: [string
, integer
, boolean
, float
]
Specifies the type of the field. This field cannot be updated.
links object
meta object
timestamps objectrequired
Specifies the date the entity is created.
Specifies the date the entity is last updated.
validation object
string object
Possible values: <= 65535
Specifies the minimum number of characters that can be stored.
Possible values: <= 65535
Specifies the minimum number of characters that can be stored.
Possible values: <= 1024 characters
RE2 regular expression that used to restrict the specific characters that can be stored.
Default value: true
When set to true
, this allows null
values for that field on Custom API Entries. When set to false
, storing null
values is not permitted.
nullable: false
Possible values: [yes
, no
]
Default value: no
If yes
, this prevents two Custom API entries from having the same value for this field within the Custom API. When set to no
(the default),
multiple Custom API entries may have the same value
Controls case-insensitive uniqueness for this field. Can only be set to true
if unique
is set to yes
.
If true
, prevents two Custom API entries from having the same value for this field within the Custom API, ignoring case differences.
When set to false
(the default), case is considered when checking for uniqueness.
This value can only be set during field creation and cannot be modified afterwards.
When set to true, the value of this field can be specified only during POST requests and cannot be modified during PUT requests.
The unique identifier of the Custom Field.
Specifies the type of the resource object, use custom_field
for Custom Field.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom Field.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: non-empty
and <= 63 characters
Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.
Possible values: [string
, integer
, boolean
, float
]
Specifies the type of the field. This field cannot be updated.
links object
meta object
timestamps objectrequired
Specifies the date the entity is created.
Specifies the date the entity is last updated.
validation object
integer object
Specifies the minimum whole number that can be stored.
Specifies the maximum whole number that can be stored.
Default value: true
When set to true
, this allows null
values for that field on Custom API Entries. When set to false
, storing null
values is not permitted.
When set to true
, prevents changing the field.
The unique identifier of the Custom Field.
Specifies the type of the resource object, use custom_field
for Custom Field.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom Field.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: non-empty
and <= 63 characters
Specifies a slug that must be unique within the scope of the Custom API. This slug will be value as the key in the JSON Object in all entries.
Possible values: [string
, integer
, boolean
, float
]
Specifies the type of the field. This field cannot be updated.
links object
meta object
timestamps objectrequired
Specifies the date the entity is created.
Specifies the date the entity is last updated.
validation object
float object
Specifies the minimum whole number that can be stored.
Specifies the maximum whole number that can be stored.
Default value: true
When set to true
, this allows null
values for that field on Custom API Entries. When set to false
, storing null
values is not permitted.
When set to true
, prevents changing the field.
{}
String field example
{
"data": {
"type": "custom_field",
"name": "Name",
"description": "This field stores the name of the wishlist.",
"slug": "name",
"field_type": "string",
"validation": {
"string": {
"min_length": 3,
"max_length": 128,
"regex": null,
"allow_null_values": true,
"immutable": false,
"unique": "no",
"unique_case_insensitivity": false
}
},
"id": "859aeba1-03c2-4822-bd4c-89afce93d7eb",
"links": {
"self": "/settings/extensions/custom-apis/3fa85f64-5717-4562-b3fc-2c963f66afa6/fields/859aeba1-03c2-4822-bd4c-89afce93d7eb"
},
"meta": {
"timestamps": {
"created_at": "2017-01-10T11:41:19.244Z",
"updated_at": "2017-01-10T11:41:19.244Z"
}
}
}
}
Integer field example
{
"data": {
"type": "custom_field",
"name": "Items Count",
"description": "This field stores the total count of items in the wishlist.",
"slug": "items_count",
"field_type": "integer",
"validation": {
"integer": {
"min_value": null,
"max_value": null,
"allow_null_values": true,
"immutable": false
}
},
"id": "859aeba1-03c2-4822-bd4c-89afce93d7eb",
"links": {
"self": "/settings/extensions/custom-apis/3fa85f64-5717-4562-b3fc-2c963f66afa6/fields/859aeba1-03c2-4822-bd4c-89afce93d7eb"
},
"meta": {
"timestamps": {
"created_at": "2017-01-10T11:41:19.244Z",
"updated_at": "2017-01-10T11:41:19.244Z"
}
}
}
}
Boolean field example
{
"data": {
"type": "custom_field",
"name": "Keep Purchased Items",
"description": "This field stores whether or not to keep purchased items on the wishlist.",
"slug": "keep_purchased",
"field_type": "boolean",
"validation": {
"boolean": {
"allow_null_values": true,
"immutable": false
}
},
"id": "859aeba1-03c2-4822-bd4c-89afce93d7eb",
"links": {
"self": "/settings/extensions/custom-apis/3fa85f64-5717-4562-b3fc-2c963f66afa6/fields/859aeba1-03c2-4822-bd4c-89afce93d7eb"
},
"meta": {
"timestamps": {
"created_at": "2017-01-10T11:41:19.244Z",
"updated_at": "2017-01-10T11:41:19.244Z"
}
}
}
}
Float field example
{
"data": {
"type": "custom_field",
"name": "Items Weight",
"description": "This field stores the total weight (in kilograms) of the items in the wishlist.",
"slug": "items_weight",
"field_type": "float",
"validation": {
"float": {
"min_value": 0,
"max_value": null,
"allow_null_values": true,
"immutable": false
}
},
"id": "859aeba1-03c2-4822-bd4c-89afce93d7eb",
"links": {
"self": "/settings/extensions/custom-apis/3fa85f64-5717-4562-b3fc-2c963f66afa6/fields/859aeba1-03c2-4822-bd4c-89afce93d7eb"
},
"meta": {
"timestamps": {
"created_at": "2017-01-10T11:41:19.244Z",
"updated_at": "2017-01-10T11:41:19.244Z"
}
}
}
}
Bad request. The request failed validation.
- application/json
- Schema
- Example (from schema)
- missing-name
Schema
- Array [
- ]
errors Error[]required
A brief summary of the error.
The HTTP response code of the error.
Optional additional detail about the error.
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
Required field missing
{
"errors": [
{
"title": "Bad Request",
"status": "400",
"detail": "The field 'name' is required."
}
]
}
Not found. The requested entity does not exist.
- application/json
- Schema
- Example (from schema)
- not-found
Schema
- Array [
- ]
errors Error[]required
A brief summary of the error.
The HTTP response code of the error.
Optional additional detail about the error.
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
Requested entity not found
{
"errors": [
{
"title": "Not Found",
"status": "404",
"detail": "Not found"
}
]
}
Unable to perform the operation at this time.
- application/json
- Schema
- Example (from schema)
- duplicate-custom-api
- duplicate-custom-field
Schema
- Array [
- ]
errors Error[]required
A brief summary of the error.
The HTTP response code of the error.
Optional additional detail about the error.
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
Duplicate Custom API
{
"errors": [
{
"title": "Conflict",
"status": "409",
"detail": "custom_api with the given api_type already exists"
}
]
}
Duplicate Custom Field
{
"errors": [
{
"title": "Conflict",
"status": "409",
"detail": "custom_field with the given slug already exists"
}
]
}
Internal server error. There was a system failure in the platform.
- application/json
- Schema
- Example (from schema)
- internal-server-error
Schema
- Array [
- ]
errors Error[]required
A brief summary of the error.
The HTTP response code of the error.
Optional additional detail about the error.
{
"errors": [
{
"title": "string",
"status": "string",
"detail": "string"
}
]
}
Internal server error
{
"errors": [
{
"title": "Internal Server Error",
"status": "500",
"detail": "there was a problem processing your request"
}
]
}