API ReferenceContent

Forms

Form definitions and the submissions made to them.

Forms in Postman

About forms

A form is a definition: steps, elements, validation and conditions, kept in revisions. Submissions are records of what a visitor sent, on their own page; a site can also submit a form through the API without a page.

Revisions Yes

A form definition keeps its structure in revisions.

Revisions, publishing and approval
Custom fields Yes

Forms take custom fields.

Custom fields
Submissions Yes

Each submission is stored against the form, with its files, and can be edited by token.

Submissions

List forms#

GET /cdna-api/forms/forms

Lists forms. Without limit every match comes back.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Form, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,name,identifier}.
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 compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List forms
GET /cdna-api/forms/forms?orderBy=id:DESC&limit=2&properties={id,name,identifier} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 5,
  "data": [
    {
      "id": 14,
      "name": "Register Form",
      "identifier": "hub-register"
    },
    {
      "id": 13,
      "name": "Hub Multistep Sample ",
      "identifier": "hub-multistep-sample"
    }
  ]
}
Open in Postman docs Real response from this documentation site

Create a form#

POST /cdna-api/forms/form

Creates a form.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The new form under data.form, and a message.

Parameters

namebody
string
The name.

Example

Create a form
POST /cdna-api/forms/form HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "name": "Test from API 790"
}

Show a form#

GET /cdna-api/forms/form/{id}

Reads one form definition by its id. Add a revision id after it, /forms/form/{id}/{revision}, to read an earlier revision.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Form, in the Reference

Parameters

idpathrequired
integer
The form id.
propertiesquery
selector
The fields and relations to return, such as {id,name,identifier}.

Example

Show a form
GET /cdna-api/forms/form/11?properties={id,name,identifier} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 11,
    "name": "Hub Newsletter Signup",
    "identifier": "hub-newsletter"
  }
}
Open in Postman docs Real response from this documentation site

Edit a form#

PUT /cdna-api/forms/form/{id}

Changes a form. Fields left out keep their values.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The saved form under data.form, and a message.

Parameters

idpathrequired
integer
The form id.
namebody
string
The name.

Example

Edit a form
PUT /cdna-api/forms/form/1 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "name": "Test from API 470 (edited)"
}

Delete a form#

DELETE /cdna-api/forms/form/{id}

Deletes a form.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The deleted form under data.form, and a message.

Parameters

idpathrequired
integer
The form id.

Example

Delete a form
DELETE /cdna-api/forms/form/1 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Show a form revision#

GET /cdna-api/forms/form-revision/{form.id}/{id}

Reads one form revision by its id.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
FormRevision, in the Reference

Parameters

form.idpathrequired
integer
The form id.
idpathrequired
integer
The revision id.
propertiesquery
selector
The fields to return.

Example

Show a form revision
GET /cdna-api/forms/form-revision/11/40 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

Make a form revision live#

PUT /cdna-api/forms/activate-form-revision/{form.id}

Makes one of a form’s revisions the live one. The body key is revision_id, with an underscore.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The message “The active revision has been set”.

Parameters

form.idpathrequired
integer
The form id.
revision_idbodyrequired
integer
The revision to make live.

Example

Make a form revision live
PUT /cdna-api/forms/activate-form-revision/11 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "revision_id": 40
}

In Forms