Create a Custom API
POST/v2/settings/extensions/custom-apis
Create a Custom API
Request
- application/json
Body
data CustomApiAttributesrequired
Specifies the type of the resource object, use custom_api
for Custom APIs.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom API.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: Value must match regular expression ^[a-z0-9_-]{1,63}$
Specifies a unique slug identifier for the Custom API. The API Entries for the created Custom API will be accessible at the location /v2/extensions/<slug>
.
Possible values: Value must match regular expression ^[a-z0-9_]{1,59}_ext$
Specifies a unique API type for this Custom API. Entries for this API will use this value for their type
field. This field must be suffixed with _ext
to distinguish it from built in APIs.
links object
meta object
timestamps objectrequired
Responses
- 201
- 400
- 409
- default
Created
- application/json
- Schema
- Example (from schema)
Schema
data objectrequired
The unique identifier for the Custom API.
Specifies the type of the resource object, use custom_api
for Custom APIs.
Possible values: non-empty
and <= 255 characters
Specifies the name of this Custom API.
Possible values: <= 255 characters
Specifies the description for this Custom API.
Possible values: Value must match regular expression ^[a-z0-9_-]{1,63}$
Specifies a unique slug identifier for the Custom API. The API Entries for the created Custom API will be accessible at the location /v2/extensions/<slug>
.
Possible values: Value must match regular expression ^[a-z0-9_]{1,59}_ext$
Specifies a unique API type for this Custom API. Entries for this API will use this value for their type
field. This field must be suffixed with _ext
to distinguish it from built in APIs.
links objectrequired
Specifies the URI of the Custom API.
meta object
timestamps objectrequired
Specifies the date the entity is created.
Specifies the date the entity is last updated.
{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"type": "string",
"name": "string",
"description": "string",
"slug": "string",
"api_type": "string",
"links": {
"self": "/settings/extensions/custom-apis/3fa85f64-5717-4562-b3fc-2c963f66afa6"
},
"meta": {
"timestamps": {
"updated_at": "2017-01-10T11:41:19.244Z",
"created_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."
}
]
}
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"
}
]
}