> For the complete documentation index, see [llms.txt](https://docs.ipaper.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipaper.io/flipbook-backend-api/paper/create-preview-token.md).

# CreatePreviewToken

## Description

Creates a preview SecurityToken that can be used to bypass any security on the Flipbook. After creating a token for a specific Flipbook, a specific client IP address and for a given time period, the Flipbook may be accessed using the URL: `<urlToFlipbook>/?SecurityToken=<token>` to bypass any security. This is typically used for scenarios where the user is logged in to an intranet and does not want to login to see the Flipbooks, while Flipbooks should be protected from public viewing. Instead of linking directly to the Flipbooks from the intranet, the intranet should link to a local page that creates the securitytoken and then redirects the user to the catalog.

Typical workflow:

1. \[Intranet] User clicks link to Flipbook.
2. \[Intranet] Requests security token from iPaper.
3. \[iPaper] Security token created & returned.
4. \[Intranet] Redirects user to actual Flipbook with securitytoken appended

## Parameters

| Name            | Value                                                                                                                                                               |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| paperID         | The ID of the iPaper that should be granted access to                                                                                                               |
| validityMinutes | How long the security token should be valid for                                                                                                                     |
| ip              | The IP that should be granted access. If this is en empty string, no IP validation will be performed and any IP presenting the correct token will be granted access |

## Sample Response

```xml
<?xml version="1.0" encoding="utf-8"?>
<result>
  <code><![CDATA[SUCCESS]]></code>
  <message><![CDATA[Preview token created.]]></message>
  <data>
    <token><![CDATA[ffc8d256-c727-4bc7-9a32-67a929f4fa53]]></token>
  </data>
</result>
```

## Return Codes

* SUCCESS
* ERROR
* LOGIN\_SECURITY\_VIOLATION


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ipaper.io/flipbook-backend-api/paper/create-preview-token.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
