开放接口文档
平台
-
站点
-
获取单个站点信息
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/platform/site/info?access_token="access_token"
-
参数 :
- site_id 站点ID, 必需参数
- domain 站点域名, 可选参数
- options 可选项,JSON字符串格式,包括以下属性:
- changyan: false | true, 是否包含畅言信息
- entrance_info: false | true 是否包含站点入口信息
返回 :
成功时 :
{ ret: 0, msg: "success", data:{ 'site_id': 3505790044, 'user_id': 500487, 'status': 1, 'logo_url': "www.example.com/logo.png", 'name': "foo", 'domain': "www.example.com", 'private_domain': "private.example.com" } }其中:
* status为站点状态, 0 未上线(已下线,未发布), 1 审核中(内容), 2 已上线, 3 审核未通过, 4 删除 5 审核封禁 * private_domain 为站点独立域名失败时:
{ ret: 1, msg: "具体失败信息" }
-
-
社区
-
新建话题
-
协议 : HTTP
-
方法 : POST
-
URL : http://api.kuaizhan.com/v2/club/topic/create?access_token="access_token"
- 参数 :
- user_id: 用户id, 必需参数
- forum_id: 社区id, 必需参数
- tag_ids: 话题标签
- title: 话题标题
- content: 话题内容, required=True
- is_html: 内容是非为html
- attachment_urls: 图片url(展示时可能存在防盗链问题,建议使用pic.kuaizhan.com)
- video_urls: 视频地址(展示时可能存在防盗链问题,建议使用pic.kuaizhan.com)
- internet_videos: 网络视频信息地址
- audios: 音频地址
- geo_longitude: 经度
- geo_latitude: 纬度
- geo_address: 具体地址
-
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "success", "data": { "attachments": [], "videos": [], "site_id": 6321338681, "audios": [], "states": [ 0, -110, 100, 50 ], "counts": { "downvotes": 0, "shares": 0, "participants": 0, "direct_replies": 0, "visits": 0, "favorites": 0, "replies": 0, "tippers": 0, "upvotes": 0, "tips": 0 }, "has_apply_info": null, "geo_address": null, "user_id": "Vb9dc3zXC4spppaO", "title": null, "vote_activity_id": null, "apply_condition": 0, "tag_ids": [ "ORDINARY" ], "brief": "搜狐快站", "content": "搜狐快站", "vote_setting": {}, "start_time": null, "form_id": "ORDINARY", "is_html": false, "is_passed": true, "forum_id": "VqrZbnzXCx2ycjcq", "_id": "V-ShE3zXC29L6cSQ", "geo": [], "is_private": false, "utime": "2016-09-23T11:27:15.086692", "enable_reply_limit": null, "group_id": null, "ctime": "2016-09-23T11:27:15.086672", "settings": {}, "freshness": 1474601235, "grade_update": { "grade": 3, "score": 2, "update": true }, "end_time": null, "reply_limit_per_user": null, "internet_videos": [], "is_recommended": false, "hotness": 13295563353, "forbid_upvote_after_end": null }, "ret": 0 }
-
-
禁言
-
协议 : HTTP
-
方法 : POST
-
URL : http://api.kuaizhan.com/v2/club/user/ban?access_token="access_token"
- 参数 :
- user_id: 用户id, 必需参数
- forum_id: 社区id, 必需参数
- reason_content: 禁言原因
- days: 禁言天数
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "success", "data": { "is_banned": true }, "ret": 0 }
-
-
编辑商品
-
创建商品
-
协议 : HTTP
-
方法 : POST
-
URL : http://api.kuaizhan.com/v2/ec/commodity/create?access_token="access_token"
-
参数 :
- shop_id: str 店铺id
- title: 商品名称
- desc: 商品简介
- type: 商品类型,const.COMMODITY_TYPES,默认 const.COMMODITY_TYPES.ORDINARY
- attachment_urls: [] 商品图片 url 列表
- global_category: 全局分类
- category_ids: [] 商品所属分类 id 列表
- keywords: 关键词字符串
- models: 规格,仅限普通商品,json对象,形如 {"颜色": ["红, "黄"], "尺码": ["M", "L", "XL"]}
model_details: 商品-规格关系,仅限普通商品,json对象,如下:
{ "[[\"颜色\",\"红\"], [\"尺寸\",\"XL\"]]": {"price": 10.0, "amount": 9}, ... }- json 对象的 key 为所属细分规格的 json 形式字符串,例如:JSON.stringify([["颜色", "红色"], ["尺寸": "XL"]]);,不考虑具体项的顺序
- json 对象的 value 为一个包含价格 price 和数量 amount 的对象。价格不能小于 0.01
- 如果输入了 models 和 model_details 且格式正确,则最终的 price,amount 等值都会基于规格计算,忽略原本输入值
price: 售价或“单购价”,若商品为拼团商品则非必填,否则仅在商品无细分规格时有用,大于等于 0.01
amount: 库存数量,若商品为拼团商品则必填,否则仅在商品无细分规格时有用
use_buyer_settings: 是否使用站点买家配置,仅对普通商品有用,输入 '1', 'true', 't', 'yes', 'y' 视为 True,其他为 False
group_price: 拼团价,仅限拼团商品必填
n_group_members: 拼团成团人数,仅限拼团商品必填
n_group_hours: 拼团时限,仅限拼团商品必填
multi_joining: 是否允许重复参团,仅限拼团商品,默认 False
original_price: “原价”,仅在商品无细分规格时有用
freight: 运费
is_online: 是否上架,输入 '1', 'true', 't', 'yes', 'y' 视为 True,其他为 False
coupon_start_date: 团购券生效日期
coupon_end_date: 团购券失效日期
coupon_auto_refund: 团购券是否自动退款
coupon_type: 团购券类型 from crm
enable_score: 使用积分购买
only_use_score: 仅可使用积分购买
proportion_of_score: 购买时的积分占比, 0.1 代表10%, 仅用积分购买时为100%
unit_name: 计量单位
max_count_of_purchase: int, 单个商品的限购个数
enable_purchase_limit: bool, 是否开启限购
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": { "original_price": 43, "only_use_score": false, "coupon_desc": null, "unit_name": null, "coupon_end_date": null, "site_id": 4208285106, "global_category": "日用品", "states": [ 100, -110, 50, 0 ], "shop_id": "V4800vQ0xafvOtuT", "freight": 12, "keywords": "", "enable_purchase_limit": false, "coupon_is_booking": null, "attachments": [ { "url": "http://pic.kuaizhan.com/g2/M01/3A/1C/wKjmqlYa98CAQ1LaAAd097_PQo46545556", "type": 1 } ], "max_count_of_purchase": null, "title": "第三方商品", "utime": "2016-09-22T19:16:37.397116", "multi_opening": null, "auto_grouping": null, "category_ids": [ "V9_byHlQrE__b-jW" ], "coupon_enable_refund": null, "is_use_template": false, "group_header_price": null, "type": 100, "price": 34, "models": [ [ "尺码", [ "32", "33", "34" ] ] ], "is_passed": true, "coupon_start_date": null, "proportion_of_score": 1, "_id": "V-O9lfJyvMXx0Ex5", "is_online": true, "model_details": [ { "price": 34, "amount": 999, "name": "W1siXHU1YzNhXHU3ODAxIiwgIjMyIl1d" }, { "price": 34, "amount": 999, "name": "W1siXHU1YzNhXHU3ODAxIiwgIjM0Il1d" }, { "price": 34, "amount": 999, "name": "W1siXHU1YzNhXHU3ODAxIiwgIjMzIl1d" } ], "coupon_id": null, "desc": "ok", "use_buyer_settings": true, "coupon_auto_refund": null, "ctime": "2016-09-22T19:16:37.397060", "freight_template_id": null, "group_header_discount": null, "freshness": 0, "amount": 2997, "avatar": "http://pic.kuaizhan.com/g2/M01/3A/1C/wKjmqlYa98CAQ1LaAAd097_PQo46545556", "sales_volume": 0, "is_recommended": false, "hotness": 0, "enable_score": false }, "ret": 0 }
-
-
修改商品
-
协议 : HTTP
-
方法 : POST
-
URL : http://api.kuaizhan.com/v2/ec/commodity/update?access_token="access_token"
- 参数 :
- commodity_id: str 商品id
- title: 商品名称
- desc: 商品简介
- attachment_urls: [] 商品图片 url 列表
- global_category: 全局分类
- category_ids: [] 商品所属分类 id 列表
- keywords: 关键词字符串
- original_price: “原价”,仅在商品无细分规格时有用
- freight: 运费
- models: 规格,仅限普通商品,json对象,形如 {"颜色": ["红, "黄"], "尺码": ["M", "L", "XL"]}
model_details: 商品-规格关系,仅限普通商品,json对象,如下:
{ "[[\"颜色\",\"红\"], [\"尺寸\",\"XL\"]]": {"price": 10.0, "amount": 9}, ... }- json 对象的 key 为所属细分规格的 json 形式字符串,例如:JSON.stringify([["颜色", "红色"], ["尺寸": "XL"]]);,不考虑具体项的顺序
- json 对象的 value 为一个包含价格 price 和数量 amount 的对象。价格不能小于 0.01
- 如果输入了 models 和 model_details 且格式正确,则最终的 price,amount 等值都会基于规格计算,忽略原本输入值
- 如果想清空 models 和 model_details 并采用统一规格,则这两个参数都传 {} 即可
price: 售价或“单购价”,仅对拼团商品或商品无细分规格时有用,大于等于 0.01
amount: 库存数量,仅对拼团商品或在商品无细分规格时有用
use_buyer_settings: 是否使用站点买家配置,仅对普通商品有用,输入 '1', 'true', 't', 'yes', 'y' 视为 True,其他为 False
group_price: 拼团价,仅限拼团商品
n_group_members: 拼团成团人数,仅限拼团商品
n_group_hours: 拼团时限,仅限拼团商品
multi_joining: 是否允许重复参团,仅限拼团商品
is_online: 是否上架,输入 '1', 'true', 't', 'yes', 'y' 视为 True,其他为 False
-
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": "", "ret": 0 }
-
-
删除商品
-
协议 : HTTP
-
方法 : POST
-
URL : http://api.kuaizhan.com/v2/ec/commodity/delete?access_token="access_token"
-
参数 :
- commodity_id: str 商品id
-
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": 5, "ret": 0 }
-
-
-
获取商品信息
-
获取单个商品信息
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/ec/commodity/info?access_token="access_token"
- 参数 :
- commodity_id: str 商品id
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": { "shop": { "num_good_comment": null, "tel": "15527597196", "freshness": 0, "address": "北京 海淀区", "site_id": 4208285106, "verified_stage": 20, "qq_customer_num": null, "keywords": "", "full_to_off": false, "desc": "", "announcement_style": null, "announcement": "xxxxx", "close_time": null, "open_time": null, "average_consumption": null, "title": "测测测测", "detailed_address": null, "verification_id": "V948FPJyvBC4qLyB", "categories": [], "enable_qq_customer_service": null, "type": 1, "city_code": 2007, "cover_style": null, "sort_weight": 0, "layout_commodities": 3, "is_certificated": false, "num_bad_comment": null, "boss": "", "is_default": null, "total_delivery_score": null, "total_commodity_score": null, "is_online": true, "geo": [], "num_soso_comment": null, "utime": "2016-09-19T17:24:33.808000", "province_code": 2, "paid_orders_count": 3, "ctime": "2016-07-20T16:22:42.262000", "sales_volume": 15, "_id": "V4800vQ0xafvOtuT", "cover": "", "disable_bottom_navbar": null, "delivery_free": false, "avatar": "", "tel_vcode": "006625", "gross_earnings": 66616, "num_comment": null, "is_recommended": false, "hotness": 0, "disable_announcement": null }, "original_price": 4444, "multi_opening": true, "attachments": [ { "url": "http://192.168.110.218/g1/M00/01/5B/CgoYr1eW3AuAKEkVAAFMFY4FCmg3876325/imageView/v1/thumbnail/200x200", "type": 1 } ], "unit_name": null, "coupon_end_date": null, "site_id": 4208285106, "global_category": "营养/保健", "enable_purchase_limit": null, "shop_id": "V4800vQ0xafvOtuT", "states": [ 100, -110, 50, 0 ], "keywords": "", "coupon_is_booking": null, "coupon_desc": null, "group_price": 333, "max_count_of_purchase": null, "title": "拼团测试(无规格)", "enable_score": null, "only_use_score": null, "amount": 1231, "category_ids": [ null ], "coupon_enable_refund": null, "is_use_template": true, "multi_joining": true, "group_header_price": null, "type": 200, "is_passed": true, "models": [], "price": 555, "coupon_start_date": null, "proportion_of_score": null, "_id": "V9fNoHlQrBjQQaDk", "n_group_members": 54, "is_online": true, "model_details": {}, "coupon_id": null, "desc": "", "use_buyer_settings": false, "hotness": 0, "ctime": "2016-09-13T17:57:52.869000", "coupon_auto_refund": null, "freight_template_id": "V-OTJHlQrCIrrDZp", "group_header_discount": false, "freshness": 0, "utime": "2016-09-22T16:15:47.189000", "auto_grouping": false, "avatar": "http://192.168.110.218/g1/M00/01/5B/CgoYr1eW3AuAKEkVAAFMFY4FCmg3876325/imageView/v1/thumbnail/200x200", "sales_volume": 2, "is_recommended": false, "n_group_hours": 72, "price_interval": null }, "ret": 0 }
-
-
获取商铺下所有商品信息
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/ec/commodity/list?access_token="access_token"
- 参数 :
- shop_id: str 商铺id
- state: 状态,参考 const.ITEM_STATES,默认 const.ITEM_STATES.PASSED
- category_id: 商品分类 id,如果传了则不考虑 state 参数
- is_passed: 如果传了 category_id 则用于筛选商品,默认 True,如果不传 category_id 则无用
- is_onlin>: 上架或未上架商品列表,默认 True
- query: 如果传递,则结合 is_online(可不传,另外忽略以上其他参数),返回搜索结果
- offset: >= 0
- limit: 1 ~ 100, default 32
- fetch_pure_score: bool, 是否只获取纯积分商品
- fetch_by_ids: bool, 是否只根据商品id获取
- ids: 商品id数组,fetch_by_ids 为 true时,ids 不能为空或空数组
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": { "shop": { "num_good_comment": null, "tel": "15527597196", "freshness": 0, "address": "北京 海淀区", "site_id": 4208285106, "verified_stage": 20, "qq_customer_num": null, "keywords": "", "full_to_off": false, "desc": "", "announcement_style": null, "announcement": "xxxxx", "close_time": null, "open_time": null, "average_consumption": null, "title": "测测测测", "detailed_address": null, "verification_id": "V948FPJyvBC4qLyB", "categories": [], "enable_qq_customer_service": null, "type": 1, "city_code": 2007, "cover_style": null, "sort_weight": 0, "layout_commodities": 3, "is_certificated": false, "num_bad_comment": null, "boss": "", "is_default": null, "total_delivery_score": null, "total_commodity_score": null, "is_online": true, "geo": [], "num_soso_comment": null, "utime": "2016-09-19T17:24:33.808000", "province_code": 2, "paid_orders_count": 3, "ctime": "2016-07-20T16:22:42.262000", "sales_volume": 15, "_id": "V4800vQ0xafvOtuT", "cover": "", "disable_bottom_navbar": null, "delivery_free": false, "avatar": "", "tel_vcode": "006625", "gross_earnings": 66616, "num_comment": null, "is_recommended": false, "hotness": 0, "disable_announcement": null }, "original_price": 4444, "multi_opening": true, "attachments": [ { "url": "http://192.168.110.218/g1/M00/01/5B/CgoYr1eW3AuAKEkVAAFMFY4FCmg3876325/imageView/v1/thumbnail/200x200", "type": 1 } ], "unit_name": null, "coupon_end_date": null, "site_id": 4208285106, "global_category": "营养/保健", "enable_purchase_limit": null, "shop_id": "V4800vQ0xafvOtuT", "states": [ 100, -110, 50, 0 ], "keywords": "", "coupon_is_booking": null, "coupon_desc": null, "group_price": 333, "max_count_of_purchase": null, "title": "拼团测试(无规格)", "enable_score": null, "only_use_score": null, "amount": 1231, "category_ids": [ null ], "coupon_enable_refund": null, "is_use_template": true, "multi_joining": true, "group_header_price": null, "type": 200, "is_passed": true, "models": [], "price": 555, "coupon_start_date": null, "proportion_of_score": null, "_id": "V9fNoHlQrBjQQaDk", "n_group_members": 54, "is_online": true, "model_details": {}, "coupon_id": null, "desc": "", "use_buyer_settings": false, "hotness": 0, "ctime": "2016-09-13T17:57:52.869000", "coupon_auto_refund": null, "freight_template_id": "V-OTJHlQrCIrrDZp", "group_header_discount": false, "freshness": 0, "utime": "2016-09-22T16:15:47.189000", "auto_grouping": false, "avatar": "http://192.168.110.218/g1/M00/01/5B/CgoYr1eW3AuAKEkVAAFMFY4FCmg3876325/imageView/v1/thumbnail/200x200", "sales_volume": 2, "is_recommended": false, "n_group_hours": 72, "price_interval": null }], "ret": 0 }
-
-
获取店铺下商品数量
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/ec/commodity/count?access_token="access_token"
- 参数 :
- shop_id: str 商铺id
-
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": 5, "ret": 0 }
-
-
-
编辑商品分类
-
创建商品分类
-
协议 : HTTP
-
方法 : POST
-
URL : http://api.kuaizhan.com/v2/ec/commodity/category/create?access_token="access_token"
- 参数 :
- shop_id: str 商铺id
- title: 名称
- desc: 描述
-
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": { "_id": "V-PF9fJyvMzivJtX", "ctime": "2016-09-22T19:52:21.417910", "title": "测试123", "sort_volume": 1474545141418, "site_id": 4208285106, "count_online_commodities": 0, "states": [ 100, -110, 50, 0 ], "shop_id": "V4800vQ0xafvOtuT", "count_offline_commodities": 0, "desc": "test", "count_commodities": 0, "utime": "2016-09-22T19:52:21.417939" }, "ret": 0 }
-
-
修改商品分类
-
协议 : HTTP
-
方法 : POST
-
URL : http://api.kuaizhan.com/v2/ec/commodity/category/update?access_token="access_token"
- 参数 :
- shop_id: str 商铺id
- title: 名称
- desc: 描述
-
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": "", "ret": 0 }
-
-
删除商品分类
-
协议 : HTTP
-
方法 : POST
-
URL : http://api.kuaizhan.com/v2/ec/commodity/category/delete?access_token="access_token"
- 参数 :
- shop_id: str 商铺id
- title: 名称
- desc: 描述
-
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": "", "ret": 0 }
-
-
-
获取商品分类
-
获取单个商品分类
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/ec/commodity/category/info?access_token="access_token"
- 参数 :
- category_id: str 分类id
-
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": { "ctime": "2016-09-22T19:52:21.417000", "title": "测试123244", "sort_volume": 1474545141418, "site_id": 4208285106, "count_online_commodities": 0, "states": [ 100, -110, 50, 0 ], "shop_id": "V4800vQ0xafvOtuT", "count_commodities": 0, "desc": "test", "_id": "V-PF9fJyvMzivJtX", "count_offline_commodities": 0, "utime": "2016-09-22T20:02:05.161000" }, "ret": 0 }
-
-
获取商铺下商品分类
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/ec/commodity/category/list?access_token="access_token"
- 参数 :
- shop_id: str 商品id
-
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ "msg": "", "data": [ { "ctime": "2016-09-22T19:52:21.417000", "title": "测试123244", "sort_volume": 1474545141418, "site_id": 4208285106, "count_online_commodities": 0, "states": [ 100, -110, 50, 0 ], "shop_id": "V4800vQ0xafvOtuT", "count_commodities": 0, "desc": "test", "_id": "V-PF9fJyvMzivJtX", "count_offline_commodities": 0, "utime": "2016-09-22T20:02:05.161000" }, { "ctime": "2016-09-19T20:36:24.222000", "title": "测试", "sort_volume": 1474288584222, "site_id": 4208285106, "count_online_commodities": 2, "states": [ 100, -110, 50, 0 ], "shop_id": "V4800vQ0xafvOtuT", "count_commodities": 2, "desc": null, "_id": "V9_byHlQrE__b-jW", "count_offline_commodities": 0, "utime": "2016-09-19T20:36:24.222000" } ], "ret": 0 }
-
-
-
获取文章信息
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/platform/post/info?access_token="access_token"
-
参数 :
- id: 文章id
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ ret: 0, msg: "具体失败信息", data:{ 'post_id': 210224, 'post_title': "foo", 'category_id': 605160, 'post_desc': "kuaizhan", 'post_content': "", 'post_pic_id': "346247", 'cover_pic_url': "www.example.com/foo.jpg", 'label_arr': [], 'weight': 120, 'comment_on': 11, 'set_time': "" } }
-
-
获取文章列表
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/platform/post/list?access_token="access_token"
-
参数 :
- id 栏目id
- status 文章状态 all为所有,online为已发布,draft为草稿
- page 第几页
- per_page 每页文章数,默认为20
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ ret: 0, msg: "具体失败信息", data:{ 'list': "", 'has_more': 1, 'total_num': 4, 'total_page': 1 } }
-
-
获取公众号信息
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/wx/service/info?access_token="access_token"
-
参数 :
- site_id: 站点ID
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ ret: 0, msg: "该站点已绑定公众号", data:{ is_bind: true, verify_type: 1, service_type: 2, app_id: "", app_secret: "", nick_name: "", head_img: "", qrcode_url: "", guide_follow_post_url: "" } }
-
-
获取用户关注信息
-
协议 : HTTP
-
方法 : GET
-
URL : http://api.kuaizhan.com/v2/wx/user/subscribe?access_token="access_token"
-
参数 :
- site_id 站点ID
- open_id 用户对应公众号的open_id
返回 :
- 成功时 :
失败时:
{ ret: 1, msg: "具体失败信息" }
{ ret: 0, msg: "获取关注状态成功", data:{ is_subscriber: true } }
-
