Skip to main content

Python SDK

We offer a Python API for interacting with the Permissions API.

Server SDK

The Server SDK is designed for use in server-side applications. It can be used to propagate Resource changes from your system to the Permissions API and to check permissions for your actions.

Installation

Add the Permissions Server SDK PyPI package to your project.

pip install spaceblocks-permissions-server

Initialization

Before using the Server SDK, we need to create a Client in the Developer Portal with at least the following scopes:

  • permissions:management:read
  • permissions:management:write

This will give us a Client ID and Client Secret that we can use to authenticate with the API.

Instantiate the SDK with the API URL and API Key from the Developer Portal.

from spaceblocks_permissions_server import (
PermissionsClient,
ClientAuthenticationOptions
)

client = PermissionsClient(
'<SPACE_BLOCKS_PERMISSIONS_URL>',
ClientAuthenticationOptions(
api_key='<YOUR_API_KEY>',
client_id='<YOUR_CLIENT_ID>',
client_secret='<YOUR_CLIENT_SECRET>'
)
)