Documentation Index

Fetch the complete documentation index at: https://docs.document360.com/llms.txt

Use this file to discover all available pages before exploring further.

Troubleshooting API rendering and display issues

Prev Next

Incorrect HTML styling in API response

When it occurs: When retrieving article HTML content via the API, the rendered output displays with broken styling or misplaced quotes.

Why it happens: API responses are formatted in JSON, which uses escape characters (for example, \") to handle certain characters safely. If these escaped characters are not converted back (unescaped) before rendering, the HTML structure breaks.

For example, a paragraph like:

<p>This is a "sample" paragraph.</p>

May appear in the JSON response as:

"<p>This is a \"sample\" paragraph.</p>"

How to fix it:

  1. Retrieve the HTML content via the API and inspect the response.
  2. Look for escaped characters in the JSON response, such as:
    • \" (escaped double quotes)
    • \\ (escaped backslashes)
    • \n (newline)
    • \t (tab)
  3. Unescape the JSON content before rendering it. This restores the original HTML structure.
  4. Verify the styling after unescaping to ensure the content appears correctly.
  5. If the issue persists, check if additional modifications in your code are altering the API response.
    JSON Escape and Unescape tool with highlighted buttons for user interaction.
    Once unescaped properly, the HTML will display as expected, preventing styling discrepancies.

Variables and snippets not rendering in API response

When it occurs: When retrieving article content via the API, variables appear as unprocessed placeholders — for example, {{variable.UserName}} instead of the actual value.

Why it happens: The isForDisplay parameter is not set correctly in the API request.

  • When isForDisplay = true: variables and snippets are fully rendered in the response, and placeholders are replaced with actual values.
  • When isForDisplay = false (or not set): the response contains unprocessed placeholders, which are not suitable for direct display.
    How to fix it:
  1. Retrieve the article content via the API and inspect the response.
  2. Check if variables or snippets appear unprocessed in the response.
  3. Ensure the API request includes "isForDisplay": true. Example request:
   {
     "articleId": "your-article-id",
     "isForDisplay": true
   }
  1. Send the modified request and verify the API response now displays correctly rendered variables and snippets.
  2. If the issue persists, ensure that the system processing the API response handles and displays the rendered content properly.

IMPORTANT
When updating articles via the API, do not pass fully rendered content back. This would replace dynamic placeholders with static values, breaking future rendering.