API Reference

Questions

FAQ questions, which keep their content in revisions.

Questions in Postman

List questions#

GET /cdna-api/faq/questions

Lists questions. Without limit every match comes back.

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

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,name,slug}.
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.
retrieveUnpublishedquery
1
Include unpublished records.

Example

List questions
GET /cdna-api/faq/questions?limit=2&properties={id,name,slug} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 79,
  "data": [
    {
      "id": 32,
      "name": "403 on a form submission or a POST from JavaScript",
      "slug": "403-on-a-form-submission-or-a-post-from-javascript"
    },
    {
      "id": 36,
      "name": "404 on a page under /my-account/",
      "slug": "404-on-a-page-under-my-account"
    }
  ]
}
Open in Postman docs Real response from this documentation site

Show a question#

GET /cdna-api/faq/question/{id}

Reads one question by its id.

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

Parameters

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

Example

Show a question
GET /cdna-api/faq/question/34?properties={id,name,slug} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 34,
    "name": "404 on an API endpoint that exists",
    "slug": "404-on-an-api-endpoint-that-exists"
  }
}
Open in Postman docs Real response from this documentation site

Show a question by its URL#

GET /cdna-api/faq/question/{slug}

Finds a question by its path, the way the public site does: a custom URL first, then the slugs.

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

Parameters

slugpathrequired
string
The question slug.
propertiesquery
selector
The fields and relations to return, such as {id,name,slug}.

Example

Show a question by its URL
GET /cdna-api/faq/question/404-on-an-api-endpoint-that-exists?properties={id,name,slug} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 34,
    "name": "404 on an API endpoint that exists",
    "slug": "404-on-an-api-endpoint-that-exists"
  }
}
Open in Postman docs Real response from this documentation site

Create a question#

POST /cdna-api/faq/question

Creates a question.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

languagebody
number
The language, by id.
questionbody
string
The question as readers see it. The record’s name follows it.
revisionsbody
object
A new revision: name, layout and areas, or text for a record with a body. Areas left out are empty.

Example

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

{
  "language": 47,
  "question": "Test question from API 168",
  "revisions": {
    "layout": 21,
    "areas": {
      "answer": "Main text 446"
    }
  }
}
Response 200 OK
{
  "result": "success",
  "data": {
    "question": {
      "originalPath": "/faq/question/test-question-from-api-577",
      "fullSlug": "test-question-from-api-577",
      "fullPath": "/faq/question/test-question-from-api-577",
      "id": 6,
      "slug": "test-question-from-api-577",
      "name": "Test question from API 577",
      "question": "Test question from API 577",
      "state": "new",
      "created": "2020-11-17T14:56:43+02:00",
      "modified": "2020-11-17T14:56:43+02:00"
    }
  },
  "message": "The Question has been added successfully."
}
Open in Postman docs Saved response from the Postman collection, shortened

Edit a question#

PUT /cdna-api/faq/question/{id}

Changes a question. Fields left out keep their values.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The question id.
questionbody
string
The question as readers see it. The record’s name follows it.
revisionsbody
object
A new revision: name, layout and areas, or text for a record with a body. Areas left out are empty.

A revisions object makes a new revision that is not live unless the request also sends "activeRevision": true, and it holds only the areas sent. To change some areas and keep the rest, use patchRevision with originRevision.

Example

Edit a question
PUT /cdna-api/faq/question/6 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "question": "Changed question from API 0",
  "revisions": {
    "layout": 21,
    "areas": {
      "answer": "Changed main text 614"
    }
  }
}
Response 200 OK
{
  "result": "success",
  "data": {
    "question": {
      "originalPath": "/faq/question/test-question-from-api-577",
      "fullSlug": "test-question-from-api-577",
      "fullPath": "/faq/question/test-question-from-api-577",
      "id": 6,
      "slug": "test-question-from-api-577",
      "name": "Changed question from API 140",
      "question": "Changed question from API 140",
      "state": "new",
      "created": "2020-11-17T14:56:43+02:00",
      "modified": "2020-11-17T14:57:31+02:00"
    }
  },
  "message": "The Question has been saved successfully."
}
Open in Postman docs Saved response from the Postman collection, shortened

Make an earlier revision live#

PUT /cdna-api/faq/question/{id}

Rolls the record back, or forward, to a revision it already has. No new revision is made, and published does not change.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The question id.
activeRevisionbodyrequired
id
A revision of this question.

Example

Make an earlier revision live
PUT /cdna-api/faq/question/6 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "activeRevision": 9
}
Response 200 OK
{
  "result": "success",
  "data": {
    "question": {
      "originalPath": "/faq/question/test-question-from-api-577",
      "fullSlug": "test-question-from-api-577",
      "fullPath": "/faq/question/test-question-from-api-577",
      "id": 6,
      "slug": "test-question-from-api-577",
      "name": "Changed question from API 140",
      "question": "Changed question from API 140",
      "state": "new",
      "created": "2020-11-17T14:56:43+02:00",
      "modified": "2020-11-17T15:01:58+02:00"
    }
  },
  "message": "The Question has been saved successfully."
}
Open in Postman docs Saved response from the Postman collection, shortened

Delete a question#

DELETE /cdna-api/faq/question/{id}

Deletes a question.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The question id.

Example

Delete a question
DELETE /cdna-api/faq/question/7 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "question": {
      "originalPath": "/faq/question/test-question-from-api-354",
      "fullSlug": "test-question-from-api-354",
      "fullPath": "/faq/question/test-question-from-api-354",
      "id": 7,
      "slug": "test-question-from-api-354",
      "name": "Test question from API 354",
      "question": "Test question from API 354",
      "state": "new",
      "created": "2020-11-17T15:03:01+02:00",
      "modified": "2020-11-17T15:03:01+02:00"
    }
  },
  "message": "The Question has been successfully deleted."
}
Open in Postman docs Saved response from the Postman collection, shortened

Duplicate a question#

POST /cdna-api/faq/duplicate-question/{id}

Copies a question. The copy is unpublished.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The question id.

Example

Duplicate a question
POST /cdna-api/faq/duplicate-question/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "question": {
      "originalPath": "/faq/question/how-can-i-do-this-copy-1",
      "fullSlug": "how-can-i-do-this-copy-1",
      "fullPath": "/faq/question/how-can-i-do-this-copy-1",
      "id": 13,
      "slug": "how-can-i-do-this-copy-1",
      "name": "Copy of How can I do this?",
      "question": "Copy of How can I do this?",
      "state": "answered",
      "created": "2021-06-22T20:55:59+00:00",
      "modified": "2021-07-07T07:43:17+00:00"
    }
  },
  "message": "The Question has been successfully duplicated."
}
Open in Postman docs Saved response from the Postman collection, shortened

Check that a question slug is free#

POST /cdna-api/faq/questions/check-slug

Answers {"result":"success"} when no question uses the slug. A slug in use, or one with characters a slug cannot have, answers HTTP 200 too, with "result": "error" and a message.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

slugbodyrequired
string
The slug to check.
idbody
integer
A record to leave out of the check, when renaming it.
sitebody
integer
The site to check in.

Example

Check that a question slug is free
POST /cdna-api/faq/questions/check-slug HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "slug": "404-on-an-api-endpoint-that-exists"
}
Response 200 OKIn use
{
  "result": "error",
  "message": "A record with this slug already exists"
}
Real response from this documentation site