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

# Client.get_path_and_version_id()

<span id="atoti.Client.get_path_and_version_id" />

> @overload<br />
> Client.get\_path\_and\_version\_id(<br />
>     *api\_name*: [str](https://docs.python.org/3/library/stdtypes.html#str),<br />
>     /,<br />
>     \*,<br />
>     *denied\_version\_ids*: [Set](https://docs.python.org/3/library/collections.abc.html#collections.abc.Set)\[[str](https://docs.python.org/3/library/stdtypes.html#str)] = `frozenset({})`,<br />
>     *path\_type*: [Literal](https://docs.python.org/3/library/typing.html#typing.Literal)\['rest', 'ws'] = `'rest'`,<br />
> ) → [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[[str](https://docs.python.org/3/library/stdtypes.html#str), [str](https://docs.python.org/3/library/stdtypes.html#str)]

> @overload<br />
> Client.get\_path\_and\_version\_id(<br />
>     *api\_name*: [str](https://docs.python.org/3/library/stdtypes.html#str),<br />
>     /,<br />
>     \*,<br />
>     *allowed\_version\_ids*: [Sequence](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)\[VersionIdT\_co],<br />
>     *denied\_version\_ids*: [Set](https://docs.python.org/3/library/collections.abc.html#collections.abc.Set)\[[str](https://docs.python.org/3/library/stdtypes.html#str)] = `frozenset({})`,<br />
>     *path\_type*: [Literal](https://docs.python.org/3/library/typing.html#typing.Literal)\['rest', 'ws'] = `'rest'`,<br />
> ) → [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[[str](https://docs.python.org/3/library/stdtypes.html#str), VersionIdT\_co]

Return the matching `(path, version_id)`.

If *allowed\_version\_ids* is not `None`, the server versions will be iterated following the order of its elements.

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> session.client.get_path_and_version_id("activeviam/pivot")
('activeviam/pivot/rest/v10', '10')
>>> session.client.get_path_and_version_id("activeviam/pivot", path_type="ws")
('activeviam/pivot/ws/v9', '9')
>>> session.client.get_path_and_version_id(
...     "activeviam/pivot", allowed_version_ids=["8", "9"]
... )
('activeviam/pivot/rest/v9', '9')
>>> session.client.get_path_and_version_id(
...     "activeviam/pivot", allowed_version_ids=["8", "7"]
... )
Traceback (most recent call last):
  ...
RuntimeError: None of the allowed version IDs ['8', '7'] match the provided ones: ['9', '10'].
>>> session.client.get_path_and_version_id(
...     "activeviam/pivot", denied_version_ids={"9", "10", "11"}
... )
Traceback (most recent call last):
  ...
RuntimeError: No `activeviam/pivot` API with `rest` path found.
```

### Parameters

<h4 id="atoti.Client.get_path_and_version_id.api_name">
  *api\_name*
</h4>

> [str](https://docs.python.org/3/library/stdtypes.html#str)

<h4 id="atoti.Client.get_path_and_version_id.denied_version_ids">
  *denied\_version\_ids*
</h4>

> [Set](https://docs.python.org/3/library/collections.abc.html#collections.abc.Set)\[[str](https://docs.python.org/3/library/stdtypes.html#str)]

<h4 id="atoti.Client.get_path_and_version_id.path_type">
  *path\_type*
</h4>

> [Literal](https://docs.python.org/3/library/typing.html#typing.Literal)\['rest', 'ws']

<h4 id="atoti.Client.get_path_and_version_id.allowed_version_ids">
  *allowed\_version\_ids*
</h4>

> [Sequence](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence)\[VersionIdT\_co]

***

<Callout icon="link">
  **See also**:
  [`http_client`](./atoti.client.Client.http_client#atoti.Client.http_client) for an example of how this method can be used.
</Callout>
