Lists questions. Without limit every match comes back.
Questions
FAQ questions, which keep their content in revisions.
List questions#
/cdna-api/faq/questions
- 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 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.
retrieveUnpublishedquery- 1
- Include unpublished records.
Example
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{
"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"
}
]
}Show a question#
/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
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{
"result": "success",
"data": {
"id": 34,
"name": "404 on an API endpoint that exists",
"slug": "404-on-an-api-endpoint-that-exists"
}
}Show a question by its URL#
/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
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{
"result": "success",
"data": {
"id": 34,
"name": "404 on an API endpoint that exists",
"slug": "404-on-an-api-endpoint-that-exists"
}
}Create a question#
/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
namefollows it. revisionsbody- object
- A new revision:
name,layoutandareas, ortextfor a record with a body. Areas left out are empty.
Example
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"
}
}
}{
"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."
}Edit a question#
/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
namefollows it. revisionsbody- object
- A new revision:
name,layoutandareas, ortextfor 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
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"
}
}
}{
"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."
}Make an earlier revision live#
/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
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
}{
"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."
}Delete a question#
/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 /cdna-api/faq/question/7 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json{
"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."
}Duplicate a question#
/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
POST /cdna-api/faq/duplicate-question/2 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json{
"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."
}Check that a question slug is free#
/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
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"
}{
"result": "error",
"message": "A record with this slug already exists"
}