ost-kyc-sdk和python
ost-kyc-sdk-python的Python项目详细描述
ost kyc python sdk
官方的OST KYC SDK。
要求
要使用此节点模块,开发人员需要:
- 登录https://kyc.ost.com/admin/login。
- 从https://kyc.ost.com/admin/settings/developer-integrations获取api密钥和api机密。
文档
安装
安装ost kyc python sdk
> pip install ost_kyc_sdk_python
示例用法
需要sdk:
importost_kyc_sdk_python
初始化sdk对象:
//thelatestvalidAPIendpointis"https://kyc.sandboxost.com",thismaychangeinthefuturekyc_sdk=ost_kyc_sdk_python.Services({'api_key':<api_key>,'api_secret':<api_secret>,'api_base_url':<api_secret>,'config':{'timeout':<desired_timeout_in_secs>}})Heretimeoutforrequestscanbepassedinsideconfig,timeoutisinseconds(defaultis15secs).
用户模块
users_service=kyc_sdk.services.users
创建新用户:
r=users_service.create({'email':'alice+1@ost.com'})print(r)< P>获取现有用户:
r=users_service.get({'id':'11003'})print(r)
获取用户列表和其他数据:
r=users_service.list()print(r)
用户KYC模块
users_kyc_service=kyc_sdk.services.users_kyc
提交KYC:
r=users_kyc_service.submit_kyc({'user_id':11035,'first_name':'aniket','last_name':'ayachit','birthdate':'21/12/1991','country':'india','nationality':'indian','document_id_number':'arqpa7659a','document_id_file_path':'2/i/016be96da275031de2787b57c99f1471','selfie_file_path':'2/i/9e8d3a5a7a58f0f1be50b7876521aebc','residence_proof_file_path':'2/i/4ed790b2d525f4c7b30fbff5cb7bbbdb','ethereum_address':'0xdfbc84ccac430f2c0455c437adf417095d7ad68e','estimated_participation_amount':'2','street_address':'afawfveav ','city':'afawfveav','state':'afawfveav','postal_code':'afawfveav','investor_proof_files_path':['2/i/9ff6374909897ca507ba3077ee8587da','2/i/4872730399670c6d554ab3821d63ebce']})print(r)
列出用户kyc:
r=users_kyc_service.list()print(r)
获取用户KYC
r=users_kyc_service.get({'user_id':11003})print(r)
获取预签名的url
r=users_kyc_service.get_pre_signed_url_put({'files':{'residence_proof':'application/pdf','investor_proof_file1':'application/pdf','investor_proof_file2':'application/pdf','document_id':'image/jpeg','selfie':'image/jpeg'}})print(r)
获取发布预签名的URL
r=users_kyc_service.get_pre_signed_url_post({'files':{'residence_proof':'application/pdf','investor_proof_file1':'application/pdf','investor_proof_file2':'application/pdf','document_id':'image/jpeg','selfie':'image/jpeg'}})print(r)
发送KYC批准电子邮件
r=users_kyc_service.email_approve({'user_id':11003})print(r)
发送KYC拒绝电子邮件
r=users_kyc_service.email_deny({'user_id':11003})print(r)
发送KYC报告问题电子邮件
r=users_kyc_service.email_report_issue({'user_id':11003})print(r)
用户KYC详细信息模块
users_kyc_details_service=kyc_sdk.services.users_kyc_details
获取用户的KYC详细信息
r=users_kyc_details_service.get({'user_id':11003})print(r)
验证模块
validator_service=kyc_sdk.services.validators
验证以太坊地址
r=validator_service.verify_ethereum_address({'ethereum_address':'0x32be343b94f860124dc4fee278fdcbd38c102d88'})print(r)
注意:如果用户想在python 2中使用非英语字符,请在文件的开头写# -*- coding: utf-8 -*-
。