Service Authorization¶
Manage service authorization tokens.
tokenList¶
Retrieves a paginated list of all service authorization tokens with filtering and sorting options.
See: Authorization
Parameters:
Optional query: ServiceAuthorizationQuery(Query)Query parameters to filter the results.Default query:¶query = { "page": 1, "fields": ["name", "token"], "filter": {}, "amount": 20, "orderBy": ["created_at", "desc"] }Returns:
list[TokenDataList]# 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: TokenCreateResponseParameters for the new tokenReturns:
# 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: GenericTokenToken to be deletedReturns:
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: GenericTokenToken to be updatedOptional verificationCode: strNew verification code for the tokenReturns:
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