Website Publishing quickstart
The Website Publishing API supports managed Hive inner pages and manually managed or imported articles. Homepage composition, shared navigation, design, forms and business identity are managed by PulpSense.
Before you start
Section titled “Before you start”Ask PulpSense to activate your website and issue a website-specific credential.
You need read and edit for this walkthrough. Store the token in your server
or tool’s secret settings as PULPSENSE_WEBSITE_TOKEN.
Use a server-side script or terminal. These endpoints refuse cross-origin browser requests.
1. List your pages
Section titled “1. List your pages”curl --fail-with-body \ 'https://seo.pulpsense.com/api/website-publishing/v1/pages' \ -H "Authorization: Bearer $PULPSENSE_WEBSITE_TOKEN"The response is a JSON array. Each entry includes id, route,
currentRevision, liveRevision and updatedAt. Keep the id of the page you
want to edit.
2. Read the current page
Section titled “2. Read the current page”Set PAGE_ID to that entry’s UUID, then read its complete retained content:
curl --fail-with-body \ "https://seo.pulpsense.com/api/website-publishing/v1/pages/$PAGE_ID" \ -H "Authorization: Bearer $PULPSENSE_WEBSITE_TOKEN"The response includes currentRevision and the content under page. Read its
existing sections before changing a body slot.
3. Save a change
Section titled “3. Save a change”This example assumes the revision you read was 1. Use the actual current
revision in your request.
curl --fail-with-body --request PATCH \ "https://seo.pulpsense.com/api/website-publishing/v1/pages/$PAGE_ID" \ -H "Authorization: Bearer $PULPSENSE_WEBSITE_TOKEN" \ -H 'Content-Type: application/json' \ --data '{ "expectedRevision": 1, "patch": { "metadata": { "description": "Your complete updated description of this page." } } }'The response contains the newly saved revision. Only supplied fields change. The existing body, FAQs, images, links and medical schema are preserved.
A 409 means someone saved another revision first. Read the current page and
reconcile the change before retrying.
4. Preview the saved revision
Section titled “4. Preview the saved revision”Set OPERATION_ID to a fresh UUID. Use the revision returned by your save;
this example assumes it was 2.
curl --fail-with-body --request POST \ "https://seo.pulpsense.com/api/website-publishing/v1/pages/$PAGE_ID/preview" \ -H "Authorization: Bearer $PULPSENSE_WEBSITE_TOKEN" \ -H 'Content-Type: application/json' \ --data "{\"expectedRevision\":2,\"operationId\":\"$OPERATION_ID\"}"The response is 202 with the queued job’s id. Save it as JOB_ID.
5. Read the result
Section titled “5. Read the result”curl --fail-with-body \ "https://seo.pulpsense.com/api/website-publishing/v1/jobs/$JOB_ID" \ -H "Authorization: Bearer $PULPSENSE_WEBSITE_TOKEN"Wait for status: "succeeded", then open the returned url. Jobs are collected
at minutes 17 and 47 each hour; allow up to about 30 minutes plus build and queue
time. A preview does not advance the production revision.
Continue with page editing or preview and publishing.