Service Authorization

Manage service authorization tokens.

tokenList

Retrieves a paginated list of all service authorization tokens with filtering and sorting options.

See: Authorization

Parameters:

Query parameters to filter the results.
Default query:
query = {
    "page": 1,
    "fields": ["name", "token"],
    "filter": {},
    "amount": 20,
    "orderBy": ["created_at", "desc"]
}

Returns:

# If receive an error "Authorization Denied", check policy "Service Authorization" / "Access" in Access Management.
from tagoio_sdk import Resources

resources = Resources()
result = resources.serviceAuthorization.tokenList({
    "page": 1,
    "fields": ["name", "token", "verification_code"],
    "amount": 20
})
print(result)  # [ { 'name': 'API Service Token', 'token': 'token-xyz-123' } ]

tokenCreate

Generates and retrieves a new service authorization token with specified permissions.

See: Authorization

Parameters:

tokenParams: TokenCreateResponse
Parameters for the new token

Returns:

# If receive an error "Authorization Denied", check policy "Service Authorization" / "Create" in Access Management.
from tagoio_sdk import Resources

resources = Resources()
result = resources.serviceAuthorization.tokenCreate({
    "name": "Service Token",
    "verification_code": "additional parameter"
})
print(result)  # { 'token': 'token-xyz-123', 'name': 'Service Token', ... }

tokenDelete

Permanently removes a service authorization token.

See: Authorization

Parameters:

Token to be deleted

Returns:

str
# If receive an error "Authorization Denied", check policy "Service Authorization" / "Delete" in Access Management.
from tagoio_sdk import Resources

resources = Resources()
result = resources.serviceAuthorization.tokenDelete("token-xyz-123")
print(result)  # Token Successfully Removed

tokenEdit

Updates a service authorization token with an optional verification code.

See: Authorization

Parameters:

Token to be updated
Optional verificationCode: str
New verification code for the token

Returns:

str
# If receive an error "Authorization Denied", check policy "Service Authorization" / "Edit" in Access Management.
from tagoio_sdk import Resources

resources = Resources()
result = resources.serviceAuthorization.tokenEdit("token-xyz-123", "verification-code")
print(result)  # Authorization Code Successfully Updated