Troubleshooting · Developer docs

Troubleshooting

Grouped by symptom, never by module, because the person with the problem does not know which module has it. One hundred questions across ten pages, each answered with the causes in the order they usually turn out to be true.

Answer API requests

"Invalid reference to related records at activeRevision; expecting an id" when I send activeRevision: true

activeRevision means two things depending on where it is. Inside patchRevision or revisions, true makes the revision being written the live one. At the top level of the body it is the record's relation to its live revision, so it takes a revision id, and true there is refused with a 422 and nothing is saved. Move it inside the revision object.

HTTP Real answers from this documentation site's sandbox page
PUT /cdna-api/pages/page/1885
{"activeRevision": true, "patchRevision": {"originRevision": 3488, "areaContent(navSection)": "API sandbox"}}
# 422 "Invalid reference to related records at activeRevision; expecting an id for a single record or a list of ids for multiple records"

PUT /cdna-api/pages/page/1885
{"patchRevision": {"originRevision": 3482, "activeRevision": true, "areaContent(navSection)": "devdocs"}}
# 200: the new revision, 3483, is live

PUT /cdna-api/pages/page/1885
{"activeRevision": 3482}
# 200: an existing revision made live again, by its id

See Making a revision live, rolling back and publishing.

In the API reference: Make an earlier revision live.

More in API requests

  1. Updating one area emptied the others
  2. My patch changed the wrong section, with no error
  3. A multiselect area answers 422 "Unexpected associative array encountered"
  4. Custom fields look lost after a write
  5. "Could not find the referenced record with id 0"

Was this page helpful?

Your answer goes to the docs team.