Skip to content

File

thingiverse.api.file

Contains endpoint functions for accessing the API

get_files_file_id

asyncio(file_id, *, client) async

Get info about a file by id

Get basic information about how to access a file. For relevant files, a thumbnail image or three.js json file may be available.

Parameters:

Name Type Description Default
file_id int

Example: 1.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404 | None

FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404

Source code in thingiverse/api/file/get_files_file_id.py
async def asyncio(
    file_id: int,
    *,
    client: AuthenticatedClient,
) -> (
    FileSchema
    | GetFilesFileIdResponse401
    | GetFilesFileIdResponse403
    | GetFilesFileIdResponse404
    | None
):
    """Get info about a file by id

     Get basic information about how to access a file. For relevant files, a thumbnail image or three.js
    json file may be available.

    Args:
        file_id (int):  Example: 1.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404
    """

    return (
        await asyncio_detailed(
            file_id=file_id,
            client=client,
        )
    ).parsed

asyncio_detailed(file_id, *, client) async

Get info about a file by id

Get basic information about how to access a file. For relevant files, a thumbnail image or three.js json file may be available.

Parameters:

Name Type Description Default
file_id int

Example: 1.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404]

Response[FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404]

Source code in thingiverse/api/file/get_files_file_id.py
async def asyncio_detailed(
    file_id: int,
    *,
    client: AuthenticatedClient,
) -> Response[
    FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404
]:
    """Get info about a file by id

     Get basic information about how to access a file. For relevant files, a thumbnail image or three.js
    json file may be available.

    Args:
        file_id (int):  Example: 1.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404]
    """

    kwargs = _get_kwargs(
        file_id=file_id,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync(file_id, *, client)

Get info about a file by id

Get basic information about how to access a file. For relevant files, a thumbnail image or three.js json file may be available.

Parameters:

Name Type Description Default
file_id int

Example: 1.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404 | None

FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404

Source code in thingiverse/api/file/get_files_file_id.py
def sync(
    file_id: int,
    *,
    client: AuthenticatedClient,
) -> (
    FileSchema
    | GetFilesFileIdResponse401
    | GetFilesFileIdResponse403
    | GetFilesFileIdResponse404
    | None
):
    """Get info about a file by id

     Get basic information about how to access a file. For relevant files, a thumbnail image or three.js
    json file may be available.

    Args:
        file_id (int):  Example: 1.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404
    """

    return sync_detailed(
        file_id=file_id,
        client=client,
    ).parsed

sync_detailed(file_id, *, client)

Get info about a file by id

Get basic information about how to access a file. For relevant files, a thumbnail image or three.js json file may be available.

Parameters:

Name Type Description Default
file_id int

Example: 1.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404]

Response[FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404]

Source code in thingiverse/api/file/get_files_file_id.py
def sync_detailed(
    file_id: int,
    *,
    client: AuthenticatedClient,
) -> Response[
    FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404
]:
    """Get info about a file by id

     Get basic information about how to access a file. For relevant files, a thumbnail image or three.js
    json file may be available.

    Args:
        file_id (int):  Example: 1.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[FileSchema | GetFilesFileIdResponse401 | GetFilesFileIdResponse403 | GetFilesFileIdResponse404]
    """

    kwargs = _get_kwargs(
        file_id=file_id,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

get_files_file_id_download

asyncio(file_id, *, client) async

Get tracked download URL

Redirects to the requested file and adds an entry to the user's download history for use with the GET /users/{$username}/downloads endpoint, as opposed to the public url which is anonymous.

Parameters:

Name Type Description Default
file_id int

Example: 1.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404 | None

Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404

Source code in thingiverse/api/file/get_files_file_id_download.py
async def asyncio(
    file_id: int,
    *,
    client: AuthenticatedClient,
) -> (
    Any
    | GetFilesFileIdDownloadResponse401
    | GetFilesFileIdDownloadResponse403
    | GetFilesFileIdDownloadResponse404
    | None
):
    """Get tracked download URL

     Redirects to the requested file and adds an entry to the user's download history for use with the
    GET /users/{$username}/downloads endpoint, as opposed to the public url which is anonymous.

    Args:
        file_id (int):  Example: 1.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404
    """

    return (
        await asyncio_detailed(
            file_id=file_id,
            client=client,
        )
    ).parsed

asyncio_detailed(file_id, *, client) async

Get tracked download URL

Redirects to the requested file and adds an entry to the user's download history for use with the GET /users/{$username}/downloads endpoint, as opposed to the public url which is anonymous.

Parameters:

Name Type Description Default
file_id int

Example: 1.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404]

Response[Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404]

Source code in thingiverse/api/file/get_files_file_id_download.py
async def asyncio_detailed(
    file_id: int,
    *,
    client: AuthenticatedClient,
) -> Response[
    Any
    | GetFilesFileIdDownloadResponse401
    | GetFilesFileIdDownloadResponse403
    | GetFilesFileIdDownloadResponse404
]:
    """Get tracked download URL

     Redirects to the requested file and adds an entry to the user's download history for use with the
    GET /users/{$username}/downloads endpoint, as opposed to the public url which is anonymous.

    Args:
        file_id (int):  Example: 1.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404]
    """

    kwargs = _get_kwargs(
        file_id=file_id,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync(file_id, *, client)

Get tracked download URL

Redirects to the requested file and adds an entry to the user's download history for use with the GET /users/{$username}/downloads endpoint, as opposed to the public url which is anonymous.

Parameters:

Name Type Description Default
file_id int

Example: 1.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404 | None

Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404

Source code in thingiverse/api/file/get_files_file_id_download.py
def sync(
    file_id: int,
    *,
    client: AuthenticatedClient,
) -> (
    Any
    | GetFilesFileIdDownloadResponse401
    | GetFilesFileIdDownloadResponse403
    | GetFilesFileIdDownloadResponse404
    | None
):
    """Get tracked download URL

     Redirects to the requested file and adds an entry to the user's download history for use with the
    GET /users/{$username}/downloads endpoint, as opposed to the public url which is anonymous.

    Args:
        file_id (int):  Example: 1.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404
    """

    return sync_detailed(
        file_id=file_id,
        client=client,
    ).parsed

sync_detailed(file_id, *, client)

Get tracked download URL

Redirects to the requested file and adds an entry to the user's download history for use with the GET /users/{$username}/downloads endpoint, as opposed to the public url which is anonymous.

Parameters:

Name Type Description Default
file_id int

Example: 1.

required

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404]

Response[Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404]

Source code in thingiverse/api/file/get_files_file_id_download.py
def sync_detailed(
    file_id: int,
    *,
    client: AuthenticatedClient,
) -> Response[
    Any
    | GetFilesFileIdDownloadResponse401
    | GetFilesFileIdDownloadResponse403
    | GetFilesFileIdDownloadResponse404
]:
    """Get tracked download URL

     Redirects to the requested file and adds an entry to the user's download history for use with the
    GET /users/{$username}/downloads endpoint, as opposed to the public url which is anonymous.

    Args:
        file_id (int):  Example: 1.

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[Any | GetFilesFileIdDownloadResponse401 | GetFilesFileIdDownloadResponse403 | GetFilesFileIdDownloadResponse404]
    """

    kwargs = _get_kwargs(
        file_id=file_id,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)

post_files_0_upload_file

asyncio(*, client, body=UNSET) async

Upload a file as pendingupload

Upload a file to the storageBucket as \"pendingUpload\". The file will be stored in a temporary folder until it is finalized (eg; associated with a thing/make/comment/etc) via the /finalize endpoint.

Parameters:

Name Type Description Default
body PostFiles0UploadFileBody | Unset
UNSET

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403 | None

PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403

Source code in thingiverse/api/file/post_files_0_upload_file.py
async def asyncio(
    *,
    client: AuthenticatedClient,
    body: PostFiles0UploadFileBody | Unset = UNSET,
) -> (
    PostFiles0UploadFileResponse200
    | PostFiles0UploadFileResponse400
    | PostFiles0UploadFileResponse401
    | PostFiles0UploadFileResponse403
    | None
):
    r"""Upload a file as pendingupload

     Upload a file to the storageBucket as \"pendingUpload\". The file will be stored in a temporary
    folder until it is finalized (eg; associated with a thing/make/comment/etc) via the /finalize
    endpoint.

    Args:
        body (PostFiles0UploadFileBody | Unset):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403
    """

    return (
        await asyncio_detailed(
            client=client,
            body=body,
        )
    ).parsed

asyncio_detailed(*, client, body=UNSET) async

Upload a file as pendingupload

Upload a file to the storageBucket as \"pendingUpload\". The file will be stored in a temporary folder until it is finalized (eg; associated with a thing/make/comment/etc) via the /finalize endpoint.

Parameters:

Name Type Description Default
body PostFiles0UploadFileBody | Unset
UNSET

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403]

Response[PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403]

Source code in thingiverse/api/file/post_files_0_upload_file.py
async def asyncio_detailed(
    *,
    client: AuthenticatedClient,
    body: PostFiles0UploadFileBody | Unset = UNSET,
) -> Response[
    PostFiles0UploadFileResponse200
    | PostFiles0UploadFileResponse400
    | PostFiles0UploadFileResponse401
    | PostFiles0UploadFileResponse403
]:
    r"""Upload a file as pendingupload

     Upload a file to the storageBucket as \"pendingUpload\". The file will be stored in a temporary
    folder until it is finalized (eg; associated with a thing/make/comment/etc) via the /finalize
    endpoint.

    Args:
        body (PostFiles0UploadFileBody | Unset):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403]
    """

    kwargs = _get_kwargs(
        body=body,
    )

    response = await client.get_async_httpx_client().request(**kwargs)

    return _build_response(client=client, response=response)

sync(*, client, body=UNSET)

Upload a file as pendingupload

Upload a file to the storageBucket as \"pendingUpload\". The file will be stored in a temporary folder until it is finalized (eg; associated with a thing/make/comment/etc) via the /finalize endpoint.

Parameters:

Name Type Description Default
body PostFiles0UploadFileBody | Unset
UNSET

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403 | None

PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403

Source code in thingiverse/api/file/post_files_0_upload_file.py
def sync(
    *,
    client: AuthenticatedClient,
    body: PostFiles0UploadFileBody | Unset = UNSET,
) -> (
    PostFiles0UploadFileResponse200
    | PostFiles0UploadFileResponse400
    | PostFiles0UploadFileResponse401
    | PostFiles0UploadFileResponse403
    | None
):
    r"""Upload a file as pendingupload

     Upload a file to the storageBucket as \"pendingUpload\". The file will be stored in a temporary
    folder until it is finalized (eg; associated with a thing/make/comment/etc) via the /finalize
    endpoint.

    Args:
        body (PostFiles0UploadFileBody | Unset):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403
    """

    return sync_detailed(
        client=client,
        body=body,
    ).parsed

sync_detailed(*, client, body=UNSET)

Upload a file as pendingupload

Upload a file to the storageBucket as \"pendingUpload\". The file will be stored in a temporary folder until it is finalized (eg; associated with a thing/make/comment/etc) via the /finalize endpoint.

Parameters:

Name Type Description Default
body PostFiles0UploadFileBody | Unset
UNSET

Raises:

Type Description
UnexpectedStatus

If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.

TimeoutException

If the request takes longer than Client.timeout.

Returns:

Type Description
Response[PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403]

Response[PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403]

Source code in thingiverse/api/file/post_files_0_upload_file.py
def sync_detailed(
    *,
    client: AuthenticatedClient,
    body: PostFiles0UploadFileBody | Unset = UNSET,
) -> Response[
    PostFiles0UploadFileResponse200
    | PostFiles0UploadFileResponse400
    | PostFiles0UploadFileResponse401
    | PostFiles0UploadFileResponse403
]:
    r"""Upload a file as pendingupload

     Upload a file to the storageBucket as \"pendingUpload\". The file will be stored in a temporary
    folder until it is finalized (eg; associated with a thing/make/comment/etc) via the /finalize
    endpoint.

    Args:
        body (PostFiles0UploadFileBody | Unset):

    Raises:
        errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
        httpx.TimeoutException: If the request takes longer than Client.timeout.

    Returns:
        Response[PostFiles0UploadFileResponse200 | PostFiles0UploadFileResponse400 | PostFiles0UploadFileResponse401 | PostFiles0UploadFileResponse403]
    """

    kwargs = _get_kwargs(
        body=body,
    )

    response = client.get_httpx_client().request(
        **kwargs,
    )

    return _build_response(client=client, response=response)