Lists input types. Without limit every match comes back.
Input Types
The field types a layout area is bound to, such as Text, Richtext, Switch, Component Collection and the site’s own select types.
List input types#
GET
/cdna-api/common/input-types
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- InputType, in the Reference
Parameters
propertiesquery- selector
- The fields and relations to return, such as
{id,name,category,editor}. filtersquery- name=value
- Any stored field, or a relation with a dot, such as
parent.id=12. Prefix the name with!,>,<,%or|. Use stored field names exactly as in the model, and comparetotalCountwith the unfiltered list's to confirm a filter applied. orderByquery- string
field:ASCorfield:DESC, comma-separated. Stored fields only.limitquery- integer
- Records per response. There is no default.
offsetquery- integer
- Records to skip.
Example
List input types
GET /cdna-api/common/input-types?limit=2&properties={id,name,category,editor} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"totalCount": 97,
"data": [
{
"id": 96,
"name": "alignContent",
"category": "text",
"editor": "select"
},
{
"id": 103,
"name": "Animated Logos",
"category": "text",
"editor": "select"
}
]
}
Open in Postman docs Real response from this documentation site
Find input types by name#
GET
/cdna-api/common/input-types
Lists the input types with a given name: the name filter is exact, and %name matches part of it.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- InputType, in the Reference
Parameters
propertiesquery- selector
- The fields and relations to return, such as
{id,name,category,editor}. filtersquery- name=value
- Any stored field, or a relation with a dot, such as
parent.id=12. Prefix the name with!,>,<,%or|. Use stored field names exactly as in the model, and comparetotalCountwith the unfiltered list's to confirm a filter applied. orderByquery- string
field:ASCorfield:DESC, comma-separated. Stored fields only.limitquery- integer
- Records per response. There is no default.
offsetquery- integer
- Records to skip.
Example
Find input types by name
GET /cdna-api/common/input-types?name=Code&properties={id,name,category,editor} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"totalCount": 1,
"data": [
{
"id": 107,
"name": "Code",
"category": "text",
"editor": "code"
}
]
}
Open in Postman docs Real response from this documentation site
Show an input type#
GET
/cdna-api/common/input-type/{id}
Reads one input type by its id.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
- Model
- InputType, in the Reference
Parameters
idpathrequired- integer
- The input type id.
propertiesquery- selector
- The fields and relations to return, such as
{id,name,category,editor}.
Example
Show an input type
GET /cdna-api/common/input-type/107?properties={id,name,category,editor} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"data": {
"id": 107,
"name": "Code",
"category": "text",
"editor": "code"
}
}
Real response from this documentation site
Create an input type#
POST
/cdna-api/common/input-type
Creates an input type.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
namebody- string
- The name.
categorybody- string
- What the area holds:
text,image,file,component,collection,recordorrecords. editorbody- string
- For a text type, its editor:
text,textarea,richtext,select,multiselect,switch,codeand others. regexbody- string
- A pattern every value must match.
Example
Create an input type
POST /cdna-api/common/input-type HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"name": "Only vocals and white space",
"category": "text",
"editor": "textarea",
"regex": "/^[aeiou ]*$/i"
}
Response
200 OK
{
"result": "success",
"data": {
"inputType": {
"id": 25,
"name": "Only vocals and white space",
"category": "text",
"editor": "textarea",
"regex": "/^[aeiou ]*$/i",
"maxLength": null,
"created": "2020-03-11T03:50:20+00:00",
"modified": "2020-03-11T03:50:20+00:00",
"defaultContent": null,
"possibleValues": []
}
},
"message": "The Input Type has been added successfully."
}
Open in Postman docs Saved response from the Postman collection, shortened
Edit an input type#
PUT
/cdna-api/common/input-type/{id}
Changes an input type. Fields left out keep their values.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
idpathrequired- integer
- The input type id.
namebody- string
- The name.
regexbody- string
- A pattern every value must match.
Example
Edit an input type
PUT /cdna-api/common/input-type/25 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json
{
"name": "Only small caps vocals",
"regex": "/^[aeiou]*$/"
}
Response
200 OK
{
"result": "success",
"data": {
"inputType": {
"id": 25,
"name": "Only small caps vocals",
"category": "text",
"editor": "textarea",
"regex": "/^[aeiou]*$/",
"maxLength": null,
"created": "2020-03-11T03:50:20+00:00",
"modified": "2020-03-11T03:51:59+00:00",
"defaultContent": null,
"possibleValues": []
}
},
"message": "The Input Type has been saved successfully."
}
Open in Postman docs Saved response from the Postman collection, shortened
Delete an input type#
DELETE
/cdna-api/common/input-type/{id}
Deletes an input type.
- Access
- Admin users and integrations, with an OAuth access token or an API key.
Parameters
idpathrequired- integer
- The input type id.
Example
Delete an input type
DELETE /cdna-api/common/input-type/25 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
200 OK
{
"result": "success",
"data": [],
"message": "The Input Type has successfully been deleted."
}
Open in Postman docs Saved response from the Postman collection