> For the complete documentation index, see [llms.txt](https://docs.rulecube.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rulecube.com/v2.5/language-reference/ockto.md).

# Ockto

Collection of Ockto functions, to get personal data from validated external sources.

### Methods

#### startSession

```javascript
startSession(sessionId: string, ocktoOptions: { testCaseId?: string, consentCode: Ockto.ConsentCodes, ocktoType: string, odmVersion: string, requestDocuments: string[], disablePartner: boolean, psd2InfoIncluded: boolean, psd2AmountOfMonths: number })
```

Starts an Ockto session. To be able to use Ockto, an applicable license must be configured for the Tenant.

**Parameters**

&#x20;   **sessionId&#x20;*****string***

&#x20;       The sessionId used in Ockto.

&#x20;   **ocktoOptions&#x20;*****{ testCaseId?: string, consentCode: Ockto.ConsentCodes, ocktoType: string, odmVersion: string, requestDocuments: string\[], disablePartner: boolean, psd2InfoIncluded: boolean, psd2AmountOfMonths: number }***

&#x20;       The Ockto options you want to use.

| consentCode        | Consent provided in the app to the user. View the [Ockto support portal](https://support.ockto.nl/hc/nl/articles/8951075185948-Consents) for more information.                                                                                                                       |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ocktoType          | Provides the combination of datasources that needs to be collected by the consumer. Contact Ockto support to get the right type.                                                                                                                                                     |
| odmVersion         | The version of ODM returned. When left empty or null is used, the latest ODM version will be returned. (V#\_#).                                                                                                                                                                      |
| requestDocuments   | <p>Per specified document a link is returned in the ODM. Using this link the receiver can download the document. Documents are available for 10 minutes and will be deleted when downloaded. By default Ockto does not return documents.<br>Possible values: UPO, UWV, PSD2, PDF</p> |
| disablePartner     | If true, Ockto will not show the add partner data pop-up within the app.                                                                                                                                                                                                             |
| psd2InfoIncluded   | If set to true, Ockto will return PSD2 data.                                                                                                                                                                                                                                         |
| psd2AmountOfMonths | Number of months to be collected (up to 12 moths)                                                                                                                                                                                                                                    |

**Return type**

&#x20;   { sessionId: string, qrCode: string }

**Examples**

```javascript
Ockto.startSession("ac1b098c-928b-4db2-8f47-ca1bec360eba", {
  consentCode: Ockto.ConsentCodes.Algemeen,
  ocktoType: "P",
  odmVersion: "v4_3",
  requestDocuments: [],
  disablePartner: true,
  psd2InfoIncluded: true,
  psd2AmountOfMonths: 3
})
```

#### getStatus

```javascript
getStatus(sessionId: string)
```

Gets the status of an Ockto session.

**Parameters**

&#x20;   **sessionId&#x20;*****string***

&#x20;       The sessionId used in Ockto.

**Return type**

&#x20;   string

**Examples**

```javascript
Ockto.getStatus("ac1b098c-928b-4db2-8f47-ca1bec360eba")
```

#### getResult

```javascript
getResult(sessionId: string)
```

Gets the result of an Ockto session.

**Parameters**

&#x20;   **sessionId&#x20;*****string***

&#x20;       The sessionId used in Ockto.

**Return type**

&#x20;   { \[key: string]: any; }

**Examples**

```javascript
Ockto.getResult("ac1b098c-928b-4db2-8f47-ca1bec360eba")
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs.rulecube.com/v2.5/language-reference/ockto.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.
