Create a Custom API Entry
POST/v2/extensions/:customApiSlug
Create a Custom API Entry
Request
Path Parameters
The slug of the Custom API.
- application/json
Body
data CustomApiEntryAttributesrequired
Specifies the type of the resource object, use the api_type
of the Custom API for Custom API Entry.
Specifies the data for this Custom API Entry, each key must match a slug
of a Custom Field. The corresponding value must conform to the defined field_type
and meet the validation defined for that field if set.
links object
meta Meta (integer)
timestamps Timestampsrequired
Responses
- 201
- 400
- 409
- 413
- default
Created
Response Headers
ETag string
A unique identifier representing the current version of the resource. When the resource changes, the ETag value will also change.
- application/json
- Schema
- Example (from schema)
- valid_entry
Schema
data objectrequired
The unique identifier for the Custom API Entry
Specifies the type of the resource object, use the api_type
of the Custom API for Custom API Entry.
Specifies the data for this Custom API Entry, each key must match a slug
of a Custom Field. The corresponding value must conform to the defined field_type
and meet the validation defined for that field if set.
links object
Specifies the URI of the Custom API Entry.
meta Meta (integer)
timestamps Timestampsrequired
Specifies the date the entity is created.
Specifies the date the entity is last updated.
Specifies the sum of the size of each value stored for the Custom API Entry in bytes. The total size of a Custom API Entry must not exceed 64KB.
{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "string",
"links": {
"self": "/extensions/wishlists/7e067539-6f6c-46e1-8c55-940031b36c6a"
},
"meta": 0
}
}
Default Wishlist
{
"data": {
"id": "7e067539-6f6c-46e1-8c55-940031b36c6a",
"type": "wishlist_ext",
"name": "My Wishlist",
"items_count": 0,
"keep_purchased": false,
"links": {
"self": "/extensions/wishlists/7e067539-6f6c-46e1-8c55-940031b36c6a"
},
"meta": {
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244Z",
"created_at": "2017-01-10T11:41:19.244Z"
},
"resource_version": 0,
"data_size": 6
}
}
}
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."
}
]
}
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"
}
]
}
Payload Too Large. The total size of a Custom API Entry must not exceed 64KB.
- 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 too large
{
"errors": [
{
"title": "Request Entity Too Large",
"status": "413",
"detail": "Maximum entry size reached."
}
]
}
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"
}
]
}