pagehive

read_page

Read one page from the draft.

Draft contentRead-onlyAll plans

What it does

Read one page from the draft. By default it returns source only: the template, page CSS, global CSS, the partials the template includes and the scripts it references, without rendered HTML or element ids. files limits that set (template, page_css, global_css, partials, scripts, partial:name, script:name); rendered true adds the rendered HTML; elements bot returns the ids the bot wrote, and elements all adds the automatic ph- ids. comments is open (default) or all; a site key gets none. Every response carries version, the current draft version, which patch_page accepts as base_version. One response holds at most 32000 characters of file text and is never cut off without a cursor: next holds the arguments for the following read (file, offset, version, plus rendered, files and elements when set) and is null at the end; elements_offset then continues until elements_next is null. A follow-up without the first read's rendered or files can fail with validation_failed reason unknown_file, and one after the draft changed fails with reason page_changed. Page and template reference: https://pagehive.io/docs/bot-guide.md (section Pages and partials).

Plans

Works on every plan: Free, Basic, Pro and Ultra.

Parameters

NameTypeAbout
site_idrequiredstringThe id of the site. list_sites gives the ids of your sites.
pathrequiredstringThe page to read, such as /.
commentsone of: open, allopen (default) returns open comment threads on the page; all also returns resolved ones.
filesstring or array of stringLimits the files returned: template, page_css, global_css, partials, scripts, or one by name such as partial:header.
renderedbooleantrue adds the page as rendered HTML.
elementsone of: none, bot, allbot returns the element ids your agent wrote; all also returns the automatic ones.
filestringThe file to continue reading, from next in an earlier response.
offsetintegerWhere to continue in that file, from next.
limitintegerThe most characters of file text to return.
elements_offsetintegerWhere to continue the element list, from elements_next.
versionintegerThe draft version from next. If the draft changed in between, the call fails with page_changed.
cursorstringnext_cursor from the previous page of this tool, to read the next page. Send the other arguments as on the first call; leave out the paging arguments the cursor replaces.

Example

Call read_page with these arguments:

{
  "site_id": "01a1…",
  "path": "/"
}

Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.

Related guides