> ## Documentation Index
> Fetch the complete documentation index at: https://developers.circularo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# URL based Integrations

> [!WARNING]
>
> You are viewing the documentation of release 26.1, which is no longer the current one. [Go to the documentation of the current release 26.2](https://developers.circularo.com/).

## 1. Prepare document from template

### Prepare empty document

```text theme={null}
<frontend_url>/compose/create/general?mode=create&definition=<document_type>
```

You must specify document type (template name)

**Example:**

For document type `c_time_off_request` use:

```text theme={null}
<frontend_url>/compose/create/general?mode=create&definition=c_time_off_request
```

![Prepared empty document](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-104518.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=1a7693f85c5aa325666070e6d8b596e0)

### Prepare document with prefilled fields

```text theme={null}
<frontend_url>/compose/create/general?mode=create&definition=<document_type>&defaults=<prefilled_fields>
```

> [!NOTE]
>
> You must specify document type (template name) and prefilled fields.

* Prefilled fields must be specified in JSON format
* Field names can be found using template editor or in HTML code
* You can use *encodeURIComponent()* or similar function to escape characters

**Example:**

For document type `c_time_off_request` and field values

```json theme={null}
{
  "C_TIME_OFF_REQUEST_LEAVE_FROM":          "2020-11-15T00:00:00.000Z",
  "C_TIME_OFF_REQUEST_LEAVE_TO":            "2020-11-26T00:00:00.000Z",
  "C_TIME_OFF_REQUEST_AVAILABLE_ON_PHONE":  "Yes",
  "C_TIME_OFF_REQUEST_ALT_PHONE":           "123456789",
  "C_TIME_OFF_REQUEST_INTERNET_ACCESS":     "Mobile Internet"
}
```

use:

```text theme={null}
<frontend_url>/compose/create/general?mode=create&definition=c_time_off_request&defaults=%7B%22C_TIME_OFF_REQUEST_LEAVE_FROM%22%3A%222020-11-15T00%3A00%3A00.000Z%22%2C%22C_TIME_OFF_REQUEST_LEAVE_TO%22%3A%222020-11-26T00%3A00%3A00.000Z%22%2C%22C_TIME_OFF_REQUEST_AVAILABLE_ON_PHONE%22%3A%22Yes%22%2C%22C_TIME_OFF_REQUEST_ALT_PHONE%22%3A%22123456789%22%2C%22C_TIME_OFF_REQUEST_INTERNET_ACCESS%22%3A%22Mobile%20Internet%22%7D
```

![Prefilled document](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-104728.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=5fe731a80c91e87dba327581255436ce)

### Edit existing document

```text theme={null}
<frontend_url>/compose/create/general?mode=edit&definition=<document_type>&documentId=<document_ID>
```

You must specify document type (template name) and document ID of the document

**Example:**

For existing document with type `c_time_off_request` and ID `51ebfacf-6c5a-4261-b2c4-5c2401e98d80` use:

```text theme={null}
<frontend_url>/compose/create/general?mode=edit&definition=c_time_off_request&documentId=51ebfacf-6c5a-4261-b2c4-5c2401e98d80
```

## 2. Prepare *Microsoft Office* document

```text theme={null}
<frontend_url>/compose/create/office?mode=create&definition=<document_type>&extension=<extension>&type=oos
```

> [!NOTE]
>
> You must specify document type and document extension

Possible extensions are:

* `docx` - for *Microsoft Word* document
* `xlsx` - for *Microsoft Excel* document
* `pptx` - for *Microsoft PowerPoint* document

**Example:**

For document type `d_default` and `docx` extension (*Microsoft Word*) use:

```text theme={null}
<frontend_url>/compose/create/office?mode=create&definition=d_default&extension=docx&type=oos
```

![Prepared Microsoft Word document](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-104949.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=c6eb02ec1a3544f29cdaf323cf9f3071)

## 3. Prepare document from external file

```text theme={null}
<frontend_url>/compose/create/external?mode=create&definition=<document_type>&type=ext
```

> [!NOTE]
>
> You must specify document type

**Example:**

For document type `d_default` use:

```text theme={null}
<frontend_url>/compose/create/external?mode=create&definition=d_default&type=ext
```

![Prepared document from external file](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-105051.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=8f7e10c8aea7c2f9eb6952b3db642562)

## 4. Sign document in Circularo

### Open "Select who needs to sign" dialog

```text theme={null}
<frontend_url>/signPrepare?mode=create&documentId=<document_ID>&documentType=<document_type>&callbackUrl=<URL>
```

> [!NOTE]
>
> You must specify document type and ID of existing document

You can specify `callbackUrl` if you want to be redirected after successful signature or failure (user will not be able to leave the signing process - **It does not mean the token has restricted rights!** Just the current window does not allow you to leave the process)

**Example:**

For existing document with type `c_time_off_request`, ID `51ebfacf-6c5a-4261-b2c4-5c2401e98d80` and callback URL `https://www.google.com` use:

```text theme={null}
<frontend_url>/signPrepare?mode=create&documentId=51ebfacf-6c5a-4261-b2c4-5c2401e98d80&documentType=c_time_off_request&callbackUrl=https%3A%2F%2Fwww.google.com
```

!["Select who needs to sign"](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-105359.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=1e0508b3987550674dc946a8392531dc)

### Sign document

```text theme={null}
<frontend_url>/sign/<document_ID>/<document_type>
```

> [!NOTE]
>
> You must specify document type and ID of existing document

**Example:**

For existing document with type `c_time_off_request` and ID `51ebfacf-6c5a-4261-b2c4-5c2401e98d80` use:

```text theme={null}
<frontend_url>/sign/51ebfacf-6c5a-4261-b2c4-5c2401e98d80/c_time_off_request
```

![Sign document](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-105458.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=5532c3184dd5f22b4cbdd9bfb712d8af)

## 5. View documents

### Filter documents by document type

```text theme={null}
<frontend_url>/home/<document_type>
```

> [!NOTE]
>
> You must specify document type

**Example:**

For document type `c_time_off_request` use:

```text theme={null}
<frontend_url>/home/c_time_off_request
```

![Documents filtered by type](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-105604.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=47ee87ff88e7d51fae2acb5337982aa6)

### Select document

```text theme={null}
<frontend_url>/home/<document_type>?select=<document_ID>&selectType=<document_type>
```

> [!NOTE]
>
> You must specify document type and ID of existing document

**Example:**

For existing document with type `c_time_off_request` and ID `51ebfacf-6c5a-4261-b2c4-5c2401e98d80` use:

```text theme={null}
<frontend_url>/home/c_time_off_request?select=51ebfacf-6c5a-4261-b2c4-5c2401e98d80&selectType=c_time_off_request
```

![Selected document](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-105704.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=3a2bf989e5fa46c43788a14ef7f1f6f1)

### Show document detail

```text theme={null}
<frontend_url>/home/<document_type>?select=<document_ID>&selectType=<document_type>&modal=detail
```

> [!NOTE]
>
> You must specify document type and ID of existing document

**Example:**

For existing document with type `c_time_off_request` and ID `51ebfacf-6c5a-4261-b2c4-5c2401e98d80` use:

```text theme={null}
<frontend_url>/home/c_time_off_request?select=51ebfacf-6c5a-4261-b2c4-5c2401e98d80&selectType=c_time_off_request&modal=detail
```

![Detail of selected document](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-105803.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=01b858c59d757838bb23cd506c1eb076)

### Show document preview

```text theme={null}
<frontend_url>/home/<document_type>?select=<document_ID>&selectType=<document_type>&modal=preview
```

> [!NOTE]
>
> You must specify document type and ID of existing document

**Example:**

For existing document with type `c_time_off_request` and ID `51ebfacf-6c5a-4261-b2c4-5c2401e98d80` use:

```text theme={null}
<frontend_url>/home/c_time_off_request?select=51ebfacf-6c5a-4261-b2c4-5c2401e98d80&selectType=c_time_off_request&modal=preview
```

![Preview of selected document](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-105857.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=f6a44f1c2024e36065b5685cc04d7758)

### Show recent activity

```text theme={null}
<frontend_url>/home/recentActivity
```

![Recent activity](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-105930.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=82b6ca2a49a6657e2776aec3428bc418)

## 6. Share link for external users

```text theme={null}
<frontend_url>/share?shareId=<share_ID>
```

> [!NOTE]
>
> You must specify share ID

**Example:**

For existing share with id `ad54c893defd0cb7c613147a0d427155bcfd82d3dc3905b59d05721e261e4e04` use:

```text theme={null}
<frontend_url>/share?shareId=ad54c893defd0cb7c613147a0d427155bcfd82d3dc3905b59d05721e261e4e04
```

![Shared document to sign](https://mintcdn.com/circularo-developers/vJOJFZDAJ1W0AXGQ/images/1071284278--image-20240419-110056.png?fit=max\&auto=format\&n=vJOJFZDAJ1W0AXGQ\&q=85\&s=1b523dd53c76a0e3676850261f06fa6e)

## 7. Redirect on Login with token to a given state

This state allows for you to use authentication token as a mean to login and automatically get redirected towards a state with some provided parameters.

### Usage

```text theme={null}
<frontend_url>/loginRedirect?redirect=<new_state>&redirectParams=<redirect_params>&token=<token>
```

* `<new_state>` - Application state where you should be redirected to. Possible values are listed in the section below.
* `<redirect_params>` - Parameters for the state where you are going to be redirected to. It must be a URL encoded JSON object.
* `<token>` - User token used for the automatic authorization.

**Example**

```text theme={null}
<frontend_url>/loginRedirect?redirect=/signPrepare&redirectParams=%7B%22documentId%22%3A%22random_document_id%22%2C%22documentType%22%3A%22d_default%22%2C%22forceHandover%22%3A%22Adam%20Smith%22%2C%22callbackUrl%22%3A%22https%3A%2F%2Fwww.google.com%2F%22%7D&token=abcd
```

> [!WARNING]
>
> Remember to `encodeURI` the `redirectParams`, otherwise the redirect will fail.

### Possible states and their parameters

`/signPrepare` - Prepare state for document signing

* `documentId` - ID of the document to be signed.
* `forceHandover` - Name of the user which should be automatically passed in as an in-person signer.
* `callbackUrl` - Sandboxes the process of signing from the rest of the application and redirects the user on success / error to the given URL.

***

`/home/:category` - Redirect to the application home. There are multiple available categories, use these instead of `:category` in the URL:

* `inbox` - The users inbox
* `my_files` - The users folders
* `shared_files` - The shared folders
* `all_documents` - The overview of all users documents

There are also couple of available parameters:

* `selected` - ID of the document which will be pre-selected in the document table.
* `modal` - In combination with the `selected` parameter show a dialog with the document data. The only available value is `"modal": "preview"`, which shows a document preview.
* `categoryGroup` - If the category is a part of a category group (defined via settings), use this parameter to show the sub-category tabs.

## In this section

> [card] [Compose fill by URL](https://developers.circularo.com/26.1/example-integrations/url-based-integrations/compose-fill-by-url.md)
>
> How to open a new document form with its fields prefilled from the URL.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.