Passhub API客户端

sightseeingtech-passhub-api的Python项目详细描述


passhub api客户端

Passhub API文档

使用python访问passhub。此模块提供对api的高级和低级调用。

要求。

python 2.7和3.4+

安装和使用

pip安装

如果python包托管在github上,则可以直接从github安装

pip install sightseeingtech_passhub_api

(您可能需要使用根权限运行pipsudo pip install sightseeingtech_passhub_api

然后导入包:

importsightseeingtech_passhub_api

设置工具

通过Setuptools安装。

python setup.py install --user

(或sudo python setup.py install为所有用户安装软件包)

然后导入包:

importsightseeingtech_passhub_api

开始

请按照installation procedure操作,然后运行以下命令:

from__future__importprint_functionimporttimeimportsightseeingtech_passhub_apifromsightseeingtech_passhub_api.restimportApiExceptionfrompprintimportpprintconfiguration=Configuration()configuration.api_key['X-Api-Key']='YOUR_API_KEY'configuration.host='YOUR_HOST'configuration.verify_ssl=Falseclient=ApiClient(configuration)try:productResourceApi=sightseeingtech_passhub_api.ProductResourceApi(client)print('Loading products...')products=productResourceApi.get_all_products()print('Product %d products is/are loaded.\n'%len(products))exceptApiExceptionase:print("Exception when calling ProductResourceApi->get_all_products: %s\n"%e)

API端点文档

ClassMethodHTTP requestDescription
OrderRecordResourceApicreateOrderRecordPOST /api/v1/orderRecordscreateOrderRecord
OrderRecordResourceApigetAllOrderRecordsGET /api/v2/orderRecordsgetAllOrderRecords
OrderRecordResourceApigetOrderRecordGET /api/v1/orderRecords/{id}getOrderRecord
OrderRecordResourceApimergeVouchersPOST /api/v1/orderRecords/mergeVouchersmergeVouchers
OrderRecordResourceApiupdateOrderRecord)PUT /api/v1/orderRecordsupdateOrderRecord
ProductResourceApifindProductsByVendorGET /api/v1/products/vendor/{vendorId}findProductsByVendor
ProductResourceApigetAllProductsGET /api/v2/productsgetAllProducts
VendorResourceApigetAllVendorsGET /api/v2/vendorsgetAllVendors
VoucherResourceApicancelValidationPOST /api/v2/voucher/validate/cancelV2 Cancel validation for the voucher
VoucherResourceApicancelVoucherPOST /api/v1/voucher/cancelcancelVoucher
VoucherResourceApiconvertVoucherPOST /api/v1/voucher/convertconvertVoucher
VoucherResourceApivalidateVoucherPOST /api/v2/voucher/validate[V2 Validates voucher which represents single order item or group of them.

授权文件

X-API-键

  • 类型:api键
  • api密钥参数名:x-api-key
  • 位置:http头

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

推荐PyPI第三方库


热门话题
Java匹配正则表达式并提取组oneliner   同步嵌套映射和集合(Java)   使用ApachePOI将结果集从Java数据库导出到Excel   java创建一个方法,其中变量是jTable   java如何创建带有嵌套循环的半菱形形状?   C/C++和Java的调试器   Java API中的生成器模式示例?   java代码分支应该应用什么样的单元测试组合?   如何求算法的时间复杂度   java如果我想代理所有服务调用,以便在不显式调用记录器的情况下正确记录它们,我有什么选择?   RabbitMQ java客户端到多个队列的连接   出现第一个空格之前的java掩码字符串   java使用子类对象修改其超类对象中的受保护属性   java如何使用PagerSlidingTabStrip删除选项卡?   java在禁用按钮后刷新整数值