验证API
passbase的Python项目详细描述
通基
此Python包由Swagger Codegen项目自动生成:
- API版本:1.0.0
- 包版本:1.2.0
- 生成包:io.swagger.codegen.v3版。generators.python.PythonClientCodegen在
要求
Python 2.7和3.4+
安装和使用
pip安装
如果python包托管在Github上,则可以直接从Github安装
pip install git+https://github.com/passbase/passbase-python.git
(您可能需要使用根权限运行pip
:sudo pip install git+https://github.com/passbase/passbase-python.git
)
然后导入包:
^{pr2}$设置工具
通过Setuptools安装。在
python setup.py install --user
(或sudo python setup.py install
为所有用户安装软件包)
然后导入包:
importpassbase
入门
请按照installation procedure操作,然后运行以下命令:
from__future__importprint_functionimporttimeimportpassbasefrompassbase.restimportApiExceptionfrompprintimportpprint# Configure API key authorization: SecretApiKeyconfiguration=passbase.Configuration()configuration.api_key['X-API-KEY']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['X-API-KEY'] = 'Bearer'# create an instance of the API classapi_instance=passbase.IdentityApi(passbase.ApiClient(configuration))id='38400000-8cf0-11bd-b23e-10b96e4ef00d'# str | Unique ID of the identity to returntry:# Get identityapi_response=api_instance.get_identity_by_id(id)pprint(api_response)exceptApiExceptionase:print("Exception when calling IdentityApi->get_identity_by_id: %s\n"%e)# Configure API key authorization: SecretApiKeyconfiguration=passbase.Configuration()configuration.api_key['X-API-KEY']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['X-API-KEY'] = 'Bearer'# create an instance of the API classapi_instance=passbase.IdentityApi(passbase.ApiClient(configuration))id='id_example'# str | Identity idresource_id='resource_id_example'# str | Resource idtry:# Get resourceapi_response=api_instance.get_identity_resource_by_id(id,resource_id)pprint(api_response)exceptApiExceptionase:print("Exception when calling IdentityApi->get_identity_resource_by_id: %s\n"%e)# Configure API key authorization: SecretApiKeyconfiguration=passbase.Configuration()configuration.api_key['X-API-KEY']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['X-API-KEY'] = 'Bearer'# create an instance of the API classapi_instance=passbase.IdentityApi(passbase.ApiClient(configuration))id='id_example'# str | Identity idresource_id='resource_id_example'# str | Resource idresource_file_id='resource_file_id_example'# str | Resource file idtry:# Get resource fileapi_response=api_instance.get_identity_resource_file_by_id(id,resource_id,resource_file_id)pprint(api_response)exceptApiExceptionase:print("Exception when calling IdentityApi->get_identity_resource_file_by_id: %s\n"%e)# Configure API key authorization: SecretApiKeyconfiguration=passbase.Configuration()configuration.api_key['X-API-KEY']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['X-API-KEY'] = 'Bearer'# create an instance of the API classapi_instance=passbase.IdentityApi(passbase.ApiClient(configuration))limit=56# int | (optional)cursor='cursor_example'# str | (optional)try:# List identitiesapi_response=api_instance.list_identities(limit=limit,cursor=cursor)pprint(api_response)exceptApiExceptionase:print("Exception when calling IdentityApi->list_identities: %s\n"%e)# Configure API key authorization: SecretApiKeyconfiguration=passbase.Configuration()configuration.api_key['X-API-KEY']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['X-API-KEY'] = 'Bearer'# create an instance of the API classapi_instance=passbase.IdentityApi(passbase.ApiClient(configuration))id='id_example'# str | Identity idlimit=56# int | (optional)cursor='cursor_example'# str | (optional)try:# List resourcesapi_response=api_instance.list_identity_resources(id,limit=limit,cursor=cursor)pprint(api_response)exceptApiExceptionase:print("Exception when calling IdentityApi->list_identity_resources: %s\n"%e)
API终结点文档
所有uri都是相对于https://api.passbase.com/verification/v1
Class | Method | HTTP request | Description |
---|---|---|---|
IdentityApi | get_identity_by_id | GET /identities/{id} | Get identity |
IdentityApi | get_identity_resource_by_id | GET /identity/{id}/resources/{resource_id} | Get resource |
IdentityApi | get_identity_resource_file_by_id | GET /identity/{id}/resources/{resource_id}/resource_files/{resource_file_id} | Get resource file |
IdentityApi | list_identities | GET /identities | List identities |
IdentityApi | list_identity_resources | GET /identity/{id}/resources | List resources |
ProjectApi | get_settings | GET /settings | Get project settings |
模型文档
- Cursor
- DataPoints
- Identity
- IdentityOwner
- IdentityResource
- PaginatedIdentities
- PaginatedResources
- ProjectSettings
- ProjectSettingsCustomizations
- ProjectSettingsVerificationSteps
- Resource
- ResourceFile
- ResourceFiles
- ResourceFilesInner
- ResourceFilesInput
- ResourceFilesInputInner
- ResourceInput
- ResourceType
- User
- WatchlistResponse
授权文件
IdentityAccessToken
可发布API密钥
- Type:API密钥
- API key参数名:X-API-key
- Location:HTTP头
秘书长
- Type:API密钥
- API key参数名:X-API-key
- Location:HTTP头
作者
- 项目
标签: