---
title: TokensApi
summary: CLASS in nl.bimbase.bimworks.client.apis.
order: 10
languages: [java]
sdk-package: Java · nl.bimbase.bimworks.client.apis
---

# TokensApi

[[page:reference/java/api|API catalogue]] · `nl.bimbase.bimworks.client.apis` · CLASS

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public class TokensApi
````

This API provides token related calls. Most calls allow you to create Auth Tokens, which can then be used to for delegation of authentication and authorization.
Auth Token are generally used from differents (parts of) applications. The Java SDK allows you to create new [[page:reference/java/nl-bimbase-bimworks-client/bimworksclient-a27e861c|BimWorksClient]] with Auth Tokens using [[page:reference/java/nl-bimbase-bimworks-client/bimworksclientfactory-5cc371b0#member-createclientwithauth-2dc84120f3c0|BimWorksClientFactory#createClientWithAuth(ObjectNode)]]

## Inheritance and interfaces

- [[page:reference/java/nl-bimbase-bimworks-client-apis/subapi-e2929b7e|SubApi]]

## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/java/nl-bimbase-bimworks-client-apis/tokensapi-9d19a9a4#member-init-8d202aec89d0|TokensApi(BimWorksClient)]] | CONSTRUCTOR |  |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/tokensapi-9d19a9a4#member-createversionstoken-8e7bb34e69cd|createVersionsToken(Set&lt;UUID&gt;, Duration, EnumSet&lt;Scope&gt;, Set&lt;String&gt;, boolean)]] | METHOD | Create a new "VersionsToken" restricted to the given scopes (the preferred variant — scopes keep working when new API calls are added to a family, unlike tas… |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/tokensapi-9d19a9a4#member-createversionstoken-5c81d3d50b6f|createVersionsToken(Set&lt;UUID&gt;, Duration, Set&lt;String&gt;, Set&lt;String&gt;, boolean)]] | METHOD | Create a new "VersionsToken". |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/tokensapi-9d19a9a4#member-createnodestoken-aab01636d5d4|createNodesToken(Set&lt;UUID&gt;, Duration, EnumSet&lt;Scope&gt;, Set&lt;String&gt;, boolean)]] | METHOD | Create a new "NodesToken" restricted to the given scopes (the preferred variant). The issued scopes can never exceed the scopes of the issuing credential. |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/tokensapi-9d19a9a4#member-createnodestoken-97bd123a820b|createNodesToken(Set&lt;UUID&gt;, Duration, Set&lt;String&gt;, Set&lt;String&gt;, boolean)]] | METHOD |  |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/tokensapi-9d19a9a4#member-createrecursivenodetoken-2d7953057e30|createRecursiveNodeToken(UUID, Duration, EnumSet&lt;Scope&gt;, Set&lt;String&gt;, boolean)]] | METHOD | Create a new "RecursiveNodeToken" restricted to the given scopes (the preferred variant). The issued scopes can never exceed the scopes of the issuing creden… |
| [[page:reference/java/nl-bimbase-bimworks-client-apis/tokensapi-9d19a9a4#member-createrecursivenodetoken-41773e183158|createRecursiveNodeToken(UUID, Duration, Set&lt;String&gt;, Set&lt;String&gt;, boolean)]] | METHOD |  |

## `TokensApi(BimWorksClient)` {#member-init-8d202aec89d0}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public TokensApi(nl.bimbase.bimworks.client.BimWorksClient bimWorksClient)
````



### Parameters

| Name | Type | Description |
|---|---|---|
| `bimWorksClient` | [[page:reference/java/nl-bimbase-bimworks-client/bimworksclient-a27e861c|BimWorksClient]] |  |

## `createVersionsToken(Set<UUID>, Duration, EnumSet<Scope>, Set<String>, boolean)` {#member-createversionstoken-8e7bb34e69cd}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public com.fasterxml.jackson.databind.node.ObjectNode createVersionsToken(java.util.Set<java.util.UUID> versionUuids, java.time.Duration duration, java.util.EnumSet<nl.bimbase.bimworks.client.Scope> scopes, java.util.Set<java.lang.String> allowedIpAdresses, boolean linkAccount) throws nl.bimbase.bimworks.client.BimWorksException
````

Create a new "VersionsToken" restricted to the given scopes (the preferred variant —
scopes keep working when new API calls are added to a family, unlike task-name lists).
The issued scopes can never exceed the scopes of the credential this client is
authenticated with.

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuids` | `java.util.Set<java.util.UUID>` | A Set of UUID representing the Versions you want to give access to |
| `duration` | `java.time.Duration` | How long this token should be valid |
| `scopes` | `java.util.EnumSet<nl.bimbase.bimworks.client.Scope>` | The scopes granted to the token; null keeps the issuing credential's own scopes (or an unscoped token for an unscoped account) |
| `allowedIpAdresses` | `java.util.Set<java.lang.String>` | IP addresses that are allowed to use the token. When empty there is no restriction on IP addresses |
| `linkAccount` | `boolean` |  |

## `createVersionsToken(Set<UUID>, Duration, Set<String>, Set<String>, boolean)` {#member-createversionstoken-5c81d3d50b6f}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
@java.lang.Deprecated
public com.fasterxml.jackson.databind.node.ObjectNode createVersionsToken(java.util.Set<java.util.UUID> versionUuids, java.time.Duration duration, java.util.Set<java.lang.String> allowedTasks, java.util.Set<java.lang.String> allowedIpAdresses, boolean linkAccount) throws nl.bimbase.bimworks.client.BimWorksException
````

```warning
Deprecated: task-name allow-lists are deprecated — use the [[page:reference/java/nl-bimbase-bimworks-client/scope-5e02db34|Scope]] based variant
```

Create a new "VersionsToken".

### Parameters

| Name | Type | Description |
|---|---|---|
| `versionUuids` | `java.util.Set<java.util.UUID>` | A Set of UUID representing the Versions you want to give access to |
| `duration` | `java.time.Duration` | How long this token should be valid |
| `allowedTasks` | `java.util.Set<java.lang.String>` | The allowed set of API calls. When empty there is no restriction on the allowed API calls. It is important to note that including API calls in this list merely allows them to be called, the calls themselves will still check the relevant authorization. |
| `allowedIpAdresses` | `java.util.Set<java.lang.String>` | IP addresses that are allowed to use the token. When empty there is no restriction on IP addresses |
| `linkAccount` | `boolean` |  |

### Exceptions

- `BimWorksException` — 

## `createNodesToken(Set<UUID>, Duration, EnumSet<Scope>, Set<String>, boolean)` {#member-createnodestoken-aab01636d5d4}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public com.fasterxml.jackson.databind.node.ObjectNode createNodesToken(java.util.Set<java.util.UUID> nodeUuids, java.time.Duration duration, java.util.EnumSet<nl.bimbase.bimworks.client.Scope> scopes, java.util.Set<java.lang.String> allowedIpAdresses, boolean linkAccount) throws nl.bimbase.bimworks.client.BimWorksException
````

Create a new "NodesToken" restricted to the given scopes (the preferred variant).
The issued scopes can never exceed the scopes of the issuing credential.

### Parameters

| Name | Type | Description |
|---|---|---|
| `nodeUuids` | `java.util.Set<java.util.UUID>` |  |
| `duration` | `java.time.Duration` |  |
| `scopes` | `java.util.EnumSet<nl.bimbase.bimworks.client.Scope>` |  |
| `allowedIpAdresses` | `java.util.Set<java.lang.String>` |  |
| `linkAccount` | `boolean` |  |

## `createNodesToken(Set<UUID>, Duration, Set<String>, Set<String>, boolean)` {#member-createnodestoken-97bd123a820b}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
@java.lang.Deprecated
public com.fasterxml.jackson.databind.node.ObjectNode createNodesToken(java.util.Set<java.util.UUID> nodeUuids, java.time.Duration duration, java.util.Set<java.lang.String> allowedTasks, java.util.Set<java.lang.String> allowedIpAdresses, boolean linkAccount) throws nl.bimbase.bimworks.client.BimWorksException
````

```warning
Deprecated: task-name allow-lists are deprecated — use the [[page:reference/java/nl-bimbase-bimworks-client/scope-5e02db34|Scope]] based variant
```



### Parameters

| Name | Type | Description |
|---|---|---|
| `nodeUuids` | `java.util.Set<java.util.UUID>` |  |
| `duration` | `java.time.Duration` |  |
| `allowedTasks` | `java.util.Set<java.lang.String>` |  |
| `allowedIpAdresses` | `java.util.Set<java.lang.String>` |  |
| `linkAccount` | `boolean` |  |

## `createRecursiveNodeToken(UUID, Duration, EnumSet<Scope>, Set<String>, boolean)` {#member-createrecursivenodetoken-2d7953057e30}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
public com.fasterxml.jackson.databind.node.ObjectNode createRecursiveNodeToken(java.util.UUID nodeUuid, java.time.Duration duration, java.util.EnumSet<nl.bimbase.bimworks.client.Scope> scopes, java.util.Set<java.lang.String> allowedIpAdresses, boolean linkAccount) throws nl.bimbase.bimworks.client.BimWorksException
````

Create a new "RecursiveNodeToken" restricted to the given scopes (the preferred
variant). The issued scopes can never exceed the scopes of the issuing credential.

### Parameters

| Name | Type | Description |
|---|---|---|
| `nodeUuid` | `java.util.UUID` |  |
| `duration` | `java.time.Duration` |  |
| `scopes` | `java.util.EnumSet<nl.bimbase.bimworks.client.Scope>` |  |
| `allowedIpAdresses` | `java.util.Set<java.lang.String>` |  |
| `linkAccount` | `boolean` |  |

## `createRecursiveNodeToken(UUID, Duration, Set<String>, Set<String>, boolean)` {#member-createrecursivenodetoken-41773e183158}

````java sdk=java sdk-namespace="nl.bimbase.bimworks.client.apis"
@java.lang.Deprecated
public com.fasterxml.jackson.databind.node.ObjectNode createRecursiveNodeToken(java.util.UUID nodeUuid, java.time.Duration duration, java.util.Set<java.lang.String> allowedTasks, java.util.Set<java.lang.String> allowedIpAdresses, boolean linkAccount) throws nl.bimbase.bimworks.client.BimWorksException
````

```warning
Deprecated: task-name allow-lists are deprecated — use the [[page:reference/java/nl-bimbase-bimworks-client/scope-5e02db34|Scope]] based variant
```



### Parameters

| Name | Type | Description |
|---|---|---|
| `nodeUuid` | `java.util.UUID` |  |
| `duration` | `java.time.Duration` |  |
| `allowedTasks` | `java.util.Set<java.lang.String>` |  |
| `allowedIpAdresses` | `java.util.Set<java.lang.String>` |  |
| `linkAccount` | `boolean` |  |

## Inherited members

- `java.lang.Object#equals(java.lang.Object)`
- `java.lang.Object#toString()`
- `java.lang.Object#wait(long)`
- `java.lang.Object#wait(long,int)`
- `java.lang.Object#wait()`
- `java.lang.Object#finalize()`
- `java.lang.Object#getClass()`
- `java.lang.Object#hashCode()`
- `java.lang.Object#clone()`
- `java.lang.Object#notify()`
- `java.lang.Object#notifyAll()`
- [[page:reference/java/nl-bimbase-bimworks-client-apis/subapi-e2929b7e#member-getbimworksclient-a7cb880c7470|getBimWorksClient()]]
