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为什么JPA规范(包括2.0)或Hibernate扩展不允许您为@Version注释指定生成器,例如Oracle序列   Univocity解析器中特定DecimalFormat的java格式结果集   javanetbeansjavadoc   java Maven概要文件不在子模块中继承   java HTTP 500错误:如何修复我的`dispatcherservlet。xml文件?   java Lucene 2.4.1索引将使用Lucene 6.2.1重新编制索引   java如何使用ManagedServiceFactory服务   java在一行上读取多个字符输入   java轮流挑选端点,试图获得最大值   通过Java/Spring引导连接到Docker Elasticsearch实例   java返回最大元素   java clear recyclerview打开另一个活动的按钮   java何时在JPA中使用一对多或多对一   使用Jersey客户端的JavaHTTPS