验证API

passbase的Python项目详细描述


banner

通基

此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

(您可能需要使用根权限运行pipsudo 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

ClassMethodHTTP requestDescription
IdentityApiget_identity_by_idGET /identities/{id}Get identity
IdentityApiget_identity_resource_by_idGET /identity/{id}/resources/{resource_id}Get resource
IdentityApiget_identity_resource_file_by_idGET /identity/{id}/resources/{resource_id}/resource_files/{resource_file_id}Get resource file
IdentityApilist_identitiesGET /identitiesList identities
IdentityApilist_identity_resourcesGET /identity/{id}/resourcesList resources
ProjectApiget_settingsGET /settingsGet project settings

模型文档

授权文件

IdentityAccessToken

可发布API密钥

  • Type:API密钥
  • API key参数名:X-API-key
  • Location:HTTP头

秘书长

  • Type:API密钥
  • API key参数名:X-API-key
  • Location:HTTP头

作者

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
空间计数器在Java中不起作用   json在java中表示XPath列表的最佳方式   java报警服务接收器安卓   java注入bean在自定义的all存储库中   java从迁移到Spring MVC 4+Hibernate5   JavaEclipseIDE透视图被缓存,更改没有任何影响   java Hibernate:在将对象插入Derby嵌入式数据库时引发SQLGrammerException   适用于mp4或mp3文件的java Exoplayer自动流媒体质量   安卓如何在java的静态方法中使用这个关键字?   SSL服务器端的spring主机名验证+Tomcat和Java 8   java Eclipse强制刷新IDs   java有可能返回Mono。只是从GetMapping(“/”)处理程序中获取(“索引”)吗?   arraylist当我用java编程时,我遇到了这个错误,有人能告诉我到底出了什么问题吗?   java如何更改Apache CXF web服务中的日期时间格式   Jfoenix ChipView中的java多线程   java任务在Spark上不可序列化