如何使用配置微商城多客服接口

说明:

有赞云开放平台已对外开放多客服对接接口,该接口主要用于开放机器人相关配置读 / 写的接口。
开发者对接该接口,可以实现通过接口进行机器人相关配置,更新以及获取。

接口信息:

接口名称:获取多客服机器人配置
接口 API:youzan.message.courier.robot.settings.get.1.0.0
接口文档链接:https://doc.youzanyun.com/doc#/content/API/1-511/detail/api/0/696

JAVA 请求示例:

    public class RebotTest {
    @Test
    public void test() {
        com.youzan.cloud.open.sdk.core.client.auth.Token token = new Token("afeab5e6b75abc431f4b596b4167dxxx");
        DefaultYZClient yzClient = new DefaultYZClient();
        YouzanMessageCourierRobotSettingsGet youzanMessageCourierRobotSettingsGet = new YouzanMessageCourierRobotSettingsGet();
        //创建参数对象,并设置参数
        YouzanMessageCourierRobotSettingsGetParams youzanMessageCourierRobotSettingsGetParams = new YouzanMessageCourierRobotSettingsGetParams();
        youzanMessageCourierRobotSettingsGet.setAPIParams(youzanMessageCourierRobotSettingsGetParams);
        try {
            YouzanMessageCourierRobotSettingsGetResult result = yzClient.invoke(youzanMessageCourierRobotSettingsGet, token, YouzanMessageCourierRobotSettingsGetResult.class);
            System.out.println(JSON.toJSON(result));
        } catch (SDKException n) {
            n.printStackTrace();
        }
    }
}

返回参数:

{"code":200,"data":{"robot_transfer_enabled":false},"success":true,"message":"successful"}

参数说明:
“robot_transfer_enabled”:false,说明转人工按钮无启用;

接口名称:更新多客服机器人配置
接口 API:youzan.message.courier.robot.settings.update.1.0.0
接口文档链接:https://doc.youzanyun.com/doc#/content/API/1-511/detail/api/0/697

JAVA 请求示例:

        public class RebotTest {
         @Test
        public void test() {
        com.youzan.cloud.open.sdk.core.client.auth.Token token = new Token("afeab5e6b75abc431f4b596b4167dxxx");
        DefaultYZClient yzClient = new DefaultYZClient();
        YouzanMessageCourierRobotSettingsUpdate youzanMessageCourierRobotSettingsUpdate = new YouzanMessageCourierRobotSettingsUpdate();
        //创建参数对象,并设置参数
        YouzanMessageCourierRobotSettingsUpdateParams youzanMessageCourierRobotSettingsUpdateParams = new YouzanMessageCourierRobotSettingsUpdateParams();
        youzanMessageCourierRobotSettingsUpdateParams.setRobotTransferEnabled(true);
        youzanMessageCourierRobotSettingsUpdate.setAPIParams(youzanMessageCourierRobotSettingsUpdateParams);
        try {
            YouzanMessageCourierRobotSettingsUpdateResult result = yzClient.invoke(youzanMessageCourierRobotSettingsUpdate, token, YouzanMessageCourierRobotSettingsUpdateResult.class);
            System.out.println(JSON.toJSON(result));
        } catch (SDKException n) {
            n.printStackTrace();
        }
    }
}

参考:

更多关于多客服的相关解释,可搜索参考微商城帮助中心的在线文档。