……
1.上传图片(模式1)
(上传一张图片,由系统对图片进行模糊处理。为了更好的系统支持,建议上传的图片用标准的jpg格式)
接口URL:
http://web.8tupian.com/api/b.php
示例:
http://web.8tupian.com/api/b.php?act=up1&pic={图片的网络地址}&price=10&pid={商户pid}&key={商户key}
请求方式:GET 或 POST
请求参数:
参数名 | 类型 | 说明 | 示例值 |
---|---|---|---|
act | string | 固定值 up1 | up1 |
pic | string | 图片的网络地址 | http://www.8tupian.com/uploads/allimg/190103/1-1Z103130012163.jpg |
price | int | 图片价格(单位:分) | 10 |
pid | int | 商户pid(可登录后台,在“api接口”的页面查看到) | 10272 |
key | string | 商户key(可登录后台,在“api接口”的页面查看到) | 98800e620e693c95d4f08b7992971c3d |
……
返回值(Json字符串)
JSON内容:
参数名 | 类型 | 说明 | 示例值 |
---|---|---|---|
code | int | 0为成功,其它值为失败 | 0 |
msg | string | 失败的原因,code不为0时,才有此字段。 | "PID不存在" "KEY校验失败" |
picurl | string | 上传成功后生成的图片网络地址。code为0时,才有此字段 | http://test.8tupian.com/1a1b1.pg0 |
……
……
2.上传图片(模式2)
(上传两张图片,分别对应支付前看到的图像和支付后看到的图像。为了更好的系统支持,建议上传的图片用标准的jpg格式)
接口URL:
http://web.8tupian.com/api/b.php
示例:
http://web.8tupian.com/api/b.php?act=up2&pic={图片1的网络地址}&pic2={图片2的网络地址}&price=10&pid={商户pid}&key={商户key}
请求方式:GET 或 POST
请求参数:
参数名 | 类型 | 说明 | 示例值 |
---|---|---|---|
act | string | 固定值 up2 | up2 |
pic | string | 图片1的网络地址(支付前看到的图像) | http://www.8tupian.com/uploads/allimg/190103/1-1Z103130012163.jpg |
pic2 | string | 图片2的网络地址(支付后看到的图像) | http://www.8tupian.com/uploads/allimg/190103/1-1Z103130050330.jpg |
price | int | 图片价格(单位:分) | 10 |
pid | int | 商户pid(可登录后台,在“api接口”的页面查看到) | 10272 |
key | string | 商户key(可登录后台,在“api接口”的页面查看到) | 98800e620e693c95d4f08b7992971c3d |
……
返回值(Json字符串)
JSON内容:
参数名 | 类型 | 说明 | 示例值 |
---|---|---|---|
code | int | 0为成功,其它值为失败 | 0 |
msg | string | 失败的原因,code不为0时,才有此字段。 | "PID不存在" "KEY校验失败" |
picurl | string | 上传成功后生成的图片网络地址。code为0时,才有此字段 | http://test.8tupian.com/1a1b1.pg0 |
……
……
3.上传图片(模式3)
(上传一张图片,并设置支付后跳转的网址。为了更好的系统支持,建议上传的图片用标准的jpg格式)
接口URL:
http://web.8tupian.com/api/b.php
示例:
http://web.8tupian.com/api/b.php?act=up3&pic={图片的网络地址}&texturl=http://www.8tupian.com&price=10&pid={商户pid}&key={商户key}
请求方式:GET 或 POST
请求参数:
参数名 | 类型 | 说明 | 示例值 |
---|---|---|---|
act | string | 固定值 up3 | up3 |
pic | string | 图片的网络地址 | http://www.8tupian.com/uploads/allimg/190103/1-1Z103130050330.jpg |
texturl | string | 支付后跳转的网址,或者显示的文字 | http://www.8tupian.com |
price | int | 图片价格(单位:分) | 10 |
pid | int | 商户pid(可登录后台,在“api接口”的页面查看到) | 10272 |
key | string | 商户key(可登录后台,在“api接口”的页面查看到) | 98800e620e693c95d4f08b7992971c3d |
……
返回值(Json字符串)
JSON内容:
参数名 | 类型 | 说明 | 示例值 |
---|---|---|---|
code | int | 0为成功,其它值为失败 | 0 |
msg | string | 失败的原因,code不为0时,才有此字段。 | "PID不存在" "KEY校验失败" |
picurl | string | 上传成功后生成的图片网络地址。code为0时,才有此字段 | http://test.8tupian.com/1a8b1.pg3 |
……
……
另外,如果连续调用此接口(比如:批量上传图片),两次调用之间最好加上一秒钟的时间间隔:
sleep(1000);
.