有赞新零售社区

发帖
API使用问题»消息订阅接口中返回的json中,msg后面的值加了双引号

消息订阅接口中返回的json中,msg后面的值加了双引号

d7f96e3cc562 2019-01-20 2965 浏览 10 评论 | 只看楼主 [打印]
此问题导出json解析失败,请问是这是bug还是需要采用别的方式来解析呢?(对接语言  c#)
用手机打开
收藏 ··· 回复
    d7f96e3cc562 青铜   2019-01-20 | 只看该作者
    请看截图

      麻烦您把返回的json复制一下发上来,不要截图,方便定位问题,谢谢。

        d7f96e3cc562 青铜   2019-01-21 | 只看该作者
        {"client_id":"5ce1eda82ba71be76e","id":"E20190116204841058700009","kdt_id":42403204,"kdt_name":"北京微游儿童团","mode":1,"msg":"{"order_promotion":{"adjust_fee":"0.00"},"refund_order":[],"full_order_info":{"address_info":{"self_fetch_info":"","delivery_address":"金顶街槐满园驿站","delivery_postal_code":"","receiver_name":"安琳","delivery_province":"北京市","delivery_city":"北京市","delivery_district":"石景山区","address_extra":"{\"areaCode\":\"110107\",\"lon\":116.17615262252608,\"lat\":39.93454865714048}","receiver_tel":"13501288216"},"remark_info":{"buyer_message":""},"pay_info":{"outer_transactions":["4200000282201901164047468856"],"post_fee":"0.00","phase_payments":[],"total_fee":"0.60","payment":"0.60","transaction":["190116204852000038"]},"buyer_info":{"outer_user_id":"oHIuujufJGlWo-WeftiXgNAosZrc","buyer_phone":"13501288216","fans_type":9,"buyer_id":201795147,"fans_id":349194206,"fans_nickname":""},"orders":[{"outer_sku_id":"","sku_unique_code":"","goods_url":"https://h5.youzan.com/v2/showcase/goods?alias=3nvhqvcz3wz10","item_id":450913679,"outer_item_id":"P2019010300001","discount_price":"0.60","item_type":0,"num":1,"sku_id":0,"sku_properties_name":"[]","pic_path":"https://img.yzcdn.cn/upload_files/2019/01/16/FjPk3GC-h5mmDN4EgfuaFDwLpk9W.jpg","oid":"1494666299548637043","title":"测试商品请勿购买","buyer_messages":"","is_present":false,"pre_sale_type":"null","points_price":"0","price":"0.60","total_fee":"0.60","alias":"3nvhqvcz3wz10","payment":"0.60","is_pre_sale":"null"}],"source_info":{"is_offline_order":false,"book_key":"201901162047585c3f27fe5933b31928","biz_source":"null","source":{"platform":"wx","wx_entrance":"direct_buy"}},"order_info":{"consign_time":"","order_extra":{"buyer_name":"13501288216","is_offline":"0","is_from_cart":"false","is_member":"false","is_points_order":"0"},"created":"2019-01-16 20:48:41","status_str":"已支付","expired_time":"2019-01-16 21:48:41","success_time":"","type":0,"tid":"E20190116204841058700009","confirm_time":"","pay_time":"2019-01-16 20:48:57","update_time":"2019-01-16 20:48:58","pay_type_str":"WEIXIN_DAIXIAO","is_retail_order":false,"activity_type":1,"pay_type":10,"team_type":0,"refund_state":0,"close_type":0,"status":"TRADE_PAID","express_type":0,"order_tags":{"is_message_notify":true,"is_payed":true,"is_secured_transactions":true}}}}","sendCount":0,"sign":"b5e1d520c90434bd6c764f90775775a5","status":"TRADE_PAID","test":false,"type":"trade_TradePaid","version":1547642938}

          d7f96e3cc562 青铜   2019-01-21 | 只看该作者
          有赞-程志 发表于 2019-1-21 10:04
          麻烦您把返回的json复制一下发上来,不要截图,方便定位问题,谢谢。


          {"client_id":"5ce1eda82ba71be76e","id":"E20190116204841058700009","kdt_id":42403204,"kdt_name":"北京微游儿童团","mode":1,"msg":"{"order_promotion":{"adjust_fee":"0.00"},"refund_order":[],"full_order_info":{"address_info":{"self_fetch_info":"","delivery_address":"金顶街槐满园驿站","delivery_postal_code":"","receiver_name":"安琳","delivery_province":"北京市","delivery_city":"北京市","delivery_district":"石景山区","address_extra":"{\"areaCode\":\"110107\",\"lon\":116.17615262252608,\"lat\":39.93454865714048}","receiver_tel":"13501288216"},"remark_info":{"buyer_message":""},"pay_info":{"outer_transactions":["4200000282201901164047468856"],"post_fee":"0.00","phase_payments":[],"total_fee":"0.60","payment":"0.60","transaction":["190116204852000038"]},"buyer_info":{"outer_user_id":"oHIuujufJGlWo-WeftiXgNAosZrc","buyer_phone":"13501288216","fans_type":9,"buyer_id":201795147,"fans_id":349194206,"fans_nickname":""},"orders":[{"outer_sku_id":"","sku_unique_code":"","goods_url":"https://h5.youzan.com/v2/showcase/goods?alias=3nvhqvcz3wz10","item_id":450913679,"outer_item_id":"P2019010300001","discount_price":"0.60","item_type":0,"num":1,"sku_id":0,"sku_properties_name":"[]","pic_path":"https://img.yzcdn.cn/upload_files/2019/01/16/FjPk3GC-h5mmDN4EgfuaFDwLpk9W.jpg","oid":"1494666299548637043","title":"测试商品请勿购买","buyer_messages":"","is_present":false,"pre_sale_type":"null","points_price":"0","price":"0.60","total_fee":"0.60","alias":"3nvhqvcz3wz10","payment":"0.60","is_pre_sale":"null"}],"source_info":{"is_offline_order":false,"book_key":"201901162047585c3f27fe5933b31928","biz_source":"null","source":{"platform":"wx","wx_entrance":"direct_buy"}},"order_info":{"consign_time":"","order_extra":{"buyer_name":"13501288216","is_offline":"0","is_from_cart":"false","is_member":"false","is_points_order":"0"},"created":"2019-01-16 20:48:41","status_str":"已支付","expired_time":"2019-01-16 21:48:41","success_time":"","type":0,"tid":"E20190116204841058700009","confirm_time":"","pay_time":"2019-01-16 20:48:57","update_time":"2019-01-16 20:48:58","pay_type_str":"WEIXIN_DAIXIAO","is_retail_order":false,"activity_type":1,"pay_type":10,"team_type":0,"refund_state":0,"close_type":0,"status":"TRADE_PAID","express_type":0,"order_tags":{"is_message_notify":true,"is_payed":true,"is_secured_transactions":true}}}}","sendCount":0,"sign":"b5e1d520c90434bd6c764f90775775a5","status":"TRADE_PAID","test":false,"type":"trade_TradePaid","version":1547642938}

            您用这里提供的解析方式试试,https://www.youzanyun.com/docs/guide/3401/3449,有问题您再咨询。

              d7f96e3cc562 发表于 2019-1-21 11:05
              {"client_id":"5ce1eda82ba71be76e","id":"E20190116204841058700009","kdt_id":42403204,"kdt_name":"北 ...


              https://www.youzanyun.com/docs/guide/3401/3449,您参考一下这里提供的解析方式,看看是否可以正确解析。

                d7f96e3cc562 青铜   2019-01-21 | 只看该作者
                有赞-程志 发表于 2019-1-21 12:14
                https://www.youzanyun.com/docs/guide/3401/3449,您参考一下这里提供的解析方式,看看是否可以正确解析 ...


                这里的是java和PHP的,没有C#的demo呀,您这边有C#的demo吗?

                  d7f96e3cc562 发表于 2019-1-21 13:57
                  这里的是java和PHP的,没有C#的demo呀,您这边有C#的demo吗?


                  抱歉,目前还没有C#的demo,您看一下这个是否有帮助,https://www.cnblogs.com/yuanzijian-ruiec/p/9734409.htmlhttps://www.cnblogs.com/zxx193/p/3664562.html

                    d7f96e3cc562 青铜   2019-01-21 | 只看该作者
                    有赞-程志 发表于 2019-1-21 14:12
                    抱歉,目前还没有C#的demo,您看一下这个是否有帮助,https://www.cnblogs.com/yuanzijian-ruiec/p/97344 ...


                    好吧,我在看下,看看如何处理一下,不过话说为啥你们这个json的值会加一个双引号呢

                      lass="quote 15">
                      d7f96e3cc562 发表于 2019-1-21 15:38
                      好吧,我在看下,看看如何处理一下,不过话说为啥你们这个json的值会加一个双引号呢 ...


                      我们返回的结果中msg和kdt_name、client_id等一样,只做为一组key和value,msg返回的是String类型,所以加了双引号,您那里需要把msg按照String获取,然后再处理。

                        1跳至
                        您需要登录后才可以回帖 登录 | 立即注册

                        本版积分规则

                        复制链接
                        新浪微博
                        QQ空间
                        微信扫码
                        • 回复

                        • 评分

                        客服工作时间是9:00-18:00,客服妹子当前不在线,若不能及时回复请谅解。试试右上角的搜索吧,论坛有丰富的经验贴、公告贴,相信一定能够帮到您~

                        复制成功