为了进行电商平台 的API开发,首先我们需要做下面几件事情。
1)开发者注册一个账号
2)然后为每个1688 应用注册一个应用程序键(App Key) 。
3)下载1688 API的SDK并掌握基本的API基础知识和调用
4)利用SDK接口和对象,传入AppKey或者必要的时候获取并传入SessionKey来进行程序开发。
5)利用1688 平台的文档中心和API测试工具,对接口进行测试。从而了解返回信息,方便程序获取。
以上是一般1688 API应用开发的关键流程,其中通过1688文档中心和API测试工具,进行概念了解和接口信息查询很重要。因为这些数据就是我们需要在逐步显示出来的。1688的API很多,不过都分为了好几个领域,慢慢就会了解深入了。
API示例:
"componentData": "{\"componentType\":\"detail_od_product_discounts\",\"trackInfo\":{\"expoData\":\"traceId@213e212816956235998373756e968c^__track_uuid@30696610341^promotionInfoType@^shareCoupon@false^experimentKey@^experimentGroup@^newSharePromotionStyle@^^atmosphere@normal^useCase@1688detail^role@defaultBuyer^business@slsj^channel@dsc^offerId@659739935946^scene@ptyx\",\"spmd\":\"a262eq.8239380.30696610341.0\",\"uiTrackInfo\":{\"od_coupon_tag_click\":{\"args\":{\"traceId\":\"213e212816956235998373756e968c\",\"atmosphere\":\"normal\",\"expoData\":\"atmosphere@normal^useCase@1688detail^role@defaultBuyer^business@slsj^channel@dsc^offerId@659739935946^scene@ptyx\",\"useCase\":\"1688detail\",\"role\":\"defaultBuyer\",\"business\":\"slsj\",\"shareCoupon\":\"false\",\"channel\":\"dsc\",\"offerId\":\"659739935946\",\"spm-cnt\":\"a262eq.8239380.30696610341.od_coupon_tag_click\",\"scene\":\"ptyx\"}},\"od_coupon_tag_share_click\":{\"args\":{\"traceId\":\"213e212816956235998373756e968c\",\"atmosphere\":\"normal\",\"expoData\":\"atmosphere@normal^useCase@1688detail^role@defaultBuyer^business@slsj^channel@dsc^offerId@659739935946^scene@ptyx\",\"useCase\":\"1688detail\",\"role\":\"defaultBuyer\",\"business\":\"slsj\",\"channel\":\"dsc\",\"offerId\":\"659739935946\",\"spm-cnt\":\"a262eq.8239380.30696610341.od_coupon_tag_share_click\",\"scene\":\"ptyx\"}}}},\"data\":{\"buttonName\":\"\",\"onHandPrice\":{\"ext\":\"起\",\"unit\":\"¥\"},\"bgColor\":\"#ff0e31\",\"couponList\":[{\"couponContent\":\"元宝联盟券\",\"couponType\":\"YUANBAO\"},{\"couponContent\":\"满188元包邮\",\"couponType\":\"ACTIVITY\"},{\"couponContent\":\"满888减5券\",\"couponType\":\"COUPON\"},{\"couponContent\":\"10件混批\",\"couponType\":\"CARD\"}],\"tagShareModel\":{\"sharePicUrl\":\"https://cbu01.alicdn.com/img/ibank/O1CN01JHtru31Y9pdutLpCg_!!3938133017-0-cib.jpg\",\"shareContent\":\"满99减3券、晚发必赔...\\n我在阿里巴巴发现了一个不错的商品,赶快来看看吧~\",\"bizType\":\"offer\",\"shareTitle\":\"可爱毛线针织樱桃发夹韩国花朵手工编织侧边夹女饰品发饰批发头饰\",\"sceneType\":\"od_promotion_tag\",\"pageContent\":{\"businessId\":659739935946},\"originalUrl\":\"http://m.1688.com/offer/659739935946.html?rpg-cnt=share.offerDetail&offerId=659739935946&traceId=213e212816956235998373756e968c&spm=a262eq.8239380.30696610341.0&__track_uuid=30696610341\"},\"couponInfoList\":[{\"summary\":\"元宝联盟券\",\"displayType\":\"coupon\",\"name\":\"元宝联盟券\",\"uiType\":\"YUANBAO\",\"integralInfoList\":[{\"validTimeText\":\"2天有效\",\"bizCode\":\"mall\",\"conditionText\":\"满10减2\",\"bizScene\":\"redEnvelope\",\"benefitId\":639,\"pointsNum\":120,\"couponTypeText\":\"元宝联盟-跨店券\",\"currentTime\":1695623600078,\"curFee\":2,\"statusText\":\"120元宝兑换\",\"startFee\":10,\"event\":\"pointsRedeem_639\",\"status\":\"0\"},{\"validTimeText\":\"2天有效\",\"bizCode\":\"mall\",\"conditionText\":\"满10减2\",\"bizScene\":\"redEnvelope\",\"benefitId\":640,\"pointsNum\":120,\"couponTypeText\":\"元宝联盟-跨店券\",\"currentTime\":1695623600078,\"curFee\":2,\"statusText\":\"120元宝兑换\",\"startFee\":10,\"event\":\"pointsRedeem_640\",\"status\":\"0\"},{\"validTimeText\":\"2天有效\",\"bizCode\":\"mall\",\"conditionText\":\"满10减2\",\"bizScene\":\"redEnvelope\",\"benefitId\":641,\"pointsNum\":120,\"couponTypeText\":\"元宝联盟-跨店券\",\"currentTime\":1695623600078,\"curFee\":2,\"statusText\":\"120元宝兑换\",\"startFee\":10,\"event\":\"pointsRedeem_641\",\"status\":\"0\"}],\"rankValue\":20,\"type\":\"YUANBAO\",\"userId\":0,\"extraInfo\":{\"uiType\":\"YUANBAO\"}},{\"summary\":\"关注有礼券\",\"buttonName\":\"领券\",\"displayType\":\"coupon\",\"uiType\":\"INTERACT\",\"name\":\"互动优惠券\",\"linkUrl\":\"https://show.1688.com/shop/common/pbnluve7.html?__pageId__=229790&cms_id=229790&wh_pha=true&source=native-od&sellerMemberId=b2b-393813301759f95&onSpecificVCName=AMPHARootViewController&height=fullscreen&traceId=213e212816956235998373756e968c&spm=a262eq.8239380.30696610341.0&__track_uuid=30696610341\",\"type\":\"INTERACT\",\"promotionItems\":[{\"summary\":\"关注有礼券\",\"promotionInfoType\":\"SCYL\",\"discountFee\":\"null\",\"applied\":false,\"creatorId\":3938133017,\"label\":\"满99减3券\",\"couponId\":\"6086754431\",\"onlySupportMobile\":false,\"canApply\":true,\"couponTypeName\":\"收藏赠券\",\"sellerId\":\"3938133017\",\"availablePeriod\":\"有效期:2023.09.09 00:00:00-2024.10.01 23:59:59\",\"displayContent\":\"3\",\"promotionDisplayName\":\"关注有礼券\",\"couponType\":\"0\",\"showDiscountFee\":false,\"startTime\":\"2023-09-09 00:00:00\",\"extendDetail\":\"\",\"detail\":\"关注有礼券\",\"endTime\":\"2024-10-01 23:59:59\",\"applyDisplayInfo\":\"null\",\"actionName\":\"立即领取\"}],\"rankValue\":100,\"extraInfo\":{\"uiType\":\"INTERACT\"}},{\"summary\":\"单笔订单满188元,免快递运费\",\"buttonName\":\"查看\",\"displayType\":\"text\",\"uiType\":\"ACTIVITY\",\"name\":\"满优惠\",\"type\":\"SHOP_PROMOTION\",\"promotionItems\":[{\"summary\":\"单笔订单满188元,免快递运费\",\"promotionInfoType\":\"SHOP_PROMOTION\",\"activityUrl\":\"https://air.1688.com/apps/alim/rax-1688-seller-pro/port.html?wh_weex=true&sellerId=3938133017&aid=1117823056&traceId=213e212816956235998373756e968c&spm=a262eq.8239380.30696610341.0&__track_uuid=30696610341\",\"availablePeriod\":\"有效期:2023.09.09 00:00:00-2023.10.08 23:59:59\",\"promotionDisplayName\":\"满优惠\",\"creatorId\":3938133017,\"startTime\":\"2023-09-09 00:00:00\",\"label\":\"满188元包邮\",\"detail\":\"单笔订单满188元,免快递运费\",\"endTime\":\"2023-10-08 23:59:59\",\"extendDetail\":\"不免邮区域:海外,台湾,香港,澳门,西藏,新疆,宁夏,甘肃,青海,内蒙古,海南\",\"actionName\":\"去凑单\"}],\"rankValue\":100,\"extraInfo\":{\"uiType\":\"ACTIVITY\"}},{\"summary\":\"满888元减5元\",\"buttonName\":\"领券\",\"displayType\":\"coupon\",\"uiType\":\"COUPON\",\"name\":\"优惠券\",\"type\":\"COUPON\",\"promotionItems\":[{\"summary\":\"满888元减5元\",\"promotionInfoType\":\"COUPON\",\"discountFee\":\"null\",\"applied\":false,\"creatorId\":3938133017,\"label\":\"满888减5券\",\"couponId\":\"6087474393\",\"onlySupportMobile\":false,\"canApply\":true,\"couponTypeName\":\"九月新品促销\",\"sellerId\":\"3938133017\",\"availablePeriod\":\"有效期:2023.09.09 00:00:00-2023.09.30 23:59:59\",\"displayContent\":\"5\",\"promotionDisplayName\":\"优惠券\",\"couponType\":\"0\",\"showDiscountFee\":false,\"startTime\":\"2023-09-09 00:00:00\",\"extendDetail\":\"\",\"detail\":\"满888元减5元\",\"endTime\":\"2023-09-30 23:59:59\",\"applyDisplayInfo\":\"null\",\"actionName\":\"立即领取\"},{\"summary\":\"满128元减3元\",\"promotionInfoType\":\"COUPON\",\"discountFee\":\"null\",\"applied\":false,\"label\":\"满128减3券\",\"couponId\":\"6086835441\",\"onlySupportMobile\":false,\"canApply\":true,\"couponTypeName\":\"九月新品促销\",\"sellerId\":\"3938133017\",\"availablePeriod\":\"有效期:2023.09.09 00:00:00-2023.09.30 23:59:59\",\"displayContent\":\"3\",\"promotionDisplayName\":\"优惠券\",\"couponType\":\"0\",\"showDiscountFee\":false,\"startTime\":\"2023-09-09 00:00:00\",\"extendDetail\":\"\",\"detail\":\"满128元减3元\",\"endTime\":\"2023-09-30 23:59:59\",\"applyDisplayInfo\":\"仅限新客户领取\",\"actionName\":\"立即领取\"},{\"summary\":\"满50元减2元\",\"promotionInfoType\":\"COUPON\",\"discountFee\":\"null\",\"applied\":false,\"label\":\"满50减2券\",\"couponId\":\"6087447406\",\"onlySupportMobile\":false,\"canApply\":true,\"couponTypeName\":\"九月新品促销\",\"sellerId\":\"3938133017\",\"availablePeriod\":\"有效期:2023.09.09 00:00:00-2023.09.30 23:59:59\",\"displayContent\":\"2\",\"promotionDisplayName\":\"优惠券\",\"couponType\":\"0\",\"showDiscountFee\":false,\"startTime\":\"2023-09-09 00:00:00\",\"extendDetail\":\"\",\"detail\":\"满50元减2元\",\"endTime\":\"2023-09-30 23:59:59\",\"applyDisplayInfo\":\"仅限新客户领取\",\"actionName\":\"立即领取\"}],\"rankValue\":100,\"extraInfo\":{\"uiType\":\"COUPON\"}},{\"summary\":\"本店部分商品满100元或10件可混批采购\",\"buttonName\":\"查看\",\"displayType\":\"coupon\",\"uiType\":\"CARD\",\"name\":\"混批\",\"type\":\"MIX_WHOLESALE\",\"promotionItems\":[{\"summary\":\"本店部分商品满100元或10件可混批采购\",\"promotionInfoType\":\"MIX_WHOLESALE\",\"availablePeriod\":\"null\",\"promotionDisplayName\":\"混批\",\"creatorId\":3938133017,\"label\":\"10件混批\",\"detail\":\"本店部分商品满100元或10件可混批采购