# Sitevision API

## Start with enabling the Sitevision REST API

Ebbot utilizes the Sitevision REST API to fetch Sitevision content and convert it to documents in EbbotGPT Knowledge. In order to fetch information, the REST API must be enabled within Sitevision. This can be done in Sitevision's edit mode: <br>

1. Click the cog wheel icon in the top bar and select site settings

<figure><img src="https://2117387010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3rWESGvwA3vHJ3zNiAG1%2Fuploads%2FOau7R0L5rlahsU1SlahR%2Fimage.png?alt=media&#x26;token=350ca267-1081-4efd-b1bc-0ddc2d63d04e" alt="" width="85"><figcaption></figcaption></figure>

2. Under 'Integration' - select REST-API

<figure><img src="https://2117387010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3rWESGvwA3vHJ3zNiAG1%2Fuploads%2FrKKaNvZx4odSnZTIScGk%2Fimage.png?alt=media&#x26;token=16e93124-15e4-4ce0-b0e0-52432499abde" alt="" width="188"><figcaption></figcaption></figure>

3. Check 'Enable REST-API', adjust any restrictions to the API you would like to apply and click OK.&#x20;

<figure><img src="https://2117387010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3rWESGvwA3vHJ3zNiAG1%2Fuploads%2FnyF0ZdhHy0lZqvW0LexZ%2Fimage.png?alt=media&#x26;token=76cd2414-c9f1-4cbf-9a07-4e5cc51486ea" alt="" width="141"><figcaption></figcaption></figure>

This enables the API, for more information about additional configuration, please consult the Sitevision help & documentation:

<https://help.sitevision.se/en/siteRestApiSettingsHelp.html>

<https://developer.sitevision.se/docs/rest-api/model-rest-api>

## Connecting your Sitevision instance to EbbotGPT

There are multiple settings in EbbotGPT Knowledge for the Sitevision connection, to control which content you would like the scraper to fetch. Here is a closer look at each setting:&#x20;

<figure><img src="https://2117387010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3rWESGvwA3vHJ3zNiAG1%2Fuploads%2F3lTjNbft7C7Rf1z9ALdG%2Fimage.png?alt=media&#x26;token=1fd8f12b-21e0-4601-9e40-8f6c2206c77a" alt=""><figcaption></figcaption></figure>

### Domain - Required

This is the domain of your site. Enter only the domain without protocol.

**Example:** mysite.domain.com

The scraper uses the HTTPS protocol when doing API calls, adding https\:// or http\:// before the domain will not work.&#x20;

### Username / Password - Optional

If your REST API is not publicly accessible, you would enter the username / password to a user that has access to the API.

\
This is marked as optional since this varies between sites, but if the API is not set to public, these credentials are required.

### Root node id - Optional

This is where the scrape will start. By default it uses the root node of your site, which means this can be left blank if you want to include the full site.

If you would like to start the scraping process at a different part of your site, you can enter the node ID of the page from where it should start.

The scraping process traverses down the site tree from the root node

### Only include pages visible in menus

Checking this box will exclude any pages that have been hidden from the navigation menu in Sitevision.

### Pages to exclude

Add the page ID's of any pages you want to exclude. If you want to exclude the specific page but include its subpages, deselect the 'Exclude subpages' checkbox.&#x20;

## How to get the ID of a Sitevision page

There are two primary ways to get the ID of a page.

1. From the address bar in the Sitevision editor.\
   When in Sitevision edit mode, the ID is the final part of the URL: \_<https://mysite.example.com/edit/_**2.11fcab81189aff705752d89f>\*\*
2. From the browsers console: \
   By opening the page and running \`window\.sv.PageContext.pageId\` in the developer console, it will output the ID of the current page.<br>

## Why you would want to change the Root node id

In some cases you might not want to start at the root and only grab certain parts of the site.

For example:\
![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeGT60R3eyGfFQALWkCSKgyn0IuKr9uBEy1YH1RZDKM8KNIxp2PaYg7NHJuYPa9g0uCT-HnKlxtnM7fjEfNJDqXL0QvFnFbu-oN5yQTUkYx0DPmpjtm_HWSGV8FNotPbYwMvMlwDzXmZacdbAaA_6KfYnR3?key=OX8Q2iQwnH4YPVkS_LSjWA)

\
Let’s say that we only want the EbbotGPT have knowledge about “Miljökämpen”, we would enter that page’s id.

## What nodes from Sitevision gets scraped?

The scraper get’s the following nodes:

* Text
* Block
* Inline

When getting either the block or inline nodes, it gets the HTML name and turns it into the corresponding markdown tag. If there is no corresponding tag, the node gets ignored.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ebbot.ai/ebbot-docs/core-capabilities/ebbotgpt/ebbotgpt-knowledge/source-types/api-sources/sitevision-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
