Search in sources :

Example 1 with EssClient

use of com.tencentcloudapi.ess.v20201111.EssClient in project tencentcloud-sdk-java by TencentCloud.

the class CreateFlow method main.

public static void main(String[] args) {
    try {
        EssClient client = ClientConfig.getClientByEndpoint(EndPoint);
        CreateFlowRequest request = new CreateFlowRequest();
        UserInfo userInfo = new UserInfo();
        // 管理员用户id或者员工用户id
        userInfo.setUserId(OperatorId);
        // 请求客户端在公网的ip地址
        userInfo.setClientIp("************");
        request.setOperator(userInfo);
        // 企业方 静默签署时type为3/非静默签署type为0(仅支持处于第一位的签署方进行静默签,且合同为顺序签署,请于控制台调整好模板)
        FlowCreateApprover enterpriseInfo = new FlowCreateApprover();
        enterpriseInfo.setApproverType(3L);
        enterpriseInfo.setOrganizationName("************");
        enterpriseInfo.setApproverName("************");
        enterpriseInfo.setApproverMobile("************");
        // 请务必设置
        enterpriseInfo.setRequired(true);
        // 客户个人 type为1
        FlowCreateApprover clientInfo = new FlowCreateApprover();
        clientInfo.setApproverType(1L);
        clientInfo.setApproverName("************");
        clientInfo.setApproverMobile("************");
        // 请务必设置
        clientInfo.setRequired(true);
        // 注:当进行B2B签署时,允许指向未注册的企业,此时签署人可以查看合同并按照指引注册企业
        request.setApprovers(new FlowCreateApprover[] { enterpriseInfo, clientInfo });
        // 请设置合理的时间(秒级时间戳),否则容易造成合同过期
        request.setDeadLine(1682474522L);
        request.setFlowName("************");
        CreateFlowResponse resp = client.CreateFlow(request);
        System.out.println(CreateFlowResponse.toJsonString(resp));
    } catch (TencentCloudSDKException e) {
        e.printStackTrace();
    }
}
Also used : CreateFlowResponse(com.tencentcloudapi.ess.v20201111.models.CreateFlowResponse) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) CreateFlowRequest(com.tencentcloudapi.ess.v20201111.models.CreateFlowRequest) UserInfo(com.tencentcloudapi.ess.v20201111.models.UserInfo) FlowCreateApprover(com.tencentcloudapi.ess.v20201111.models.FlowCreateApprover) EssClient(com.tencentcloudapi.ess.v20201111.EssClient)

Example 2 with EssClient

use of com.tencentcloudapi.ess.v20201111.EssClient in project tencentcloud-sdk-java by TencentCloud.

the class DescribeFileUrls method main.

public static void main(String[] args) {
    try {
        EssClient client = ClientConfig.getClientByEndpoint(EndPoint);
        DescribeFileUrlsRequest request = new DescribeFileUrlsRequest();
        UserInfo userInfo = new UserInfo();
        // 管理员用户id或者员工用户id
        userInfo.setUserId(OperatorId);
        // 请求客户端在公网的ip地址
        userInfo.setClientIp("************");
        request.setOperator(userInfo);
        request.setBusinessType("FLOW");
        // 传入flowId
        request.setBusinessIds(new String[] { "************" });
        DescribeFileUrlsResponse response = client.DescribeFileUrls(request);
        // 请注意打印方式
        System.out.println(new GsonBuilder().disableHtmlEscaping().create().toJson(response));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : GsonBuilder(com.google.gson.GsonBuilder) EssClient(com.tencentcloudapi.ess.v20201111.EssClient)

Example 3 with EssClient

use of com.tencentcloudapi.ess.v20201111.EssClient in project tencentcloud-sdk-java by TencentCloud.

the class StartFlow method main.

public static void main(String[] args) {
    try {
        EssClient client = ClientConfig.getClientByEndpoint(EndPoint);
        StartFlowRequest request = new StartFlowRequest();
        UserInfo userInfo = new UserInfo();
        // 管理员用户id或者员工用户id
        userInfo.setUserId(OperatorId);
        // 请求客户端在公网的ip地址
        userInfo.setClientIp("************");
        request.setOperator(userInfo);
        // 由CreateFlow返回
        request.setFlowId("************");
        StartFlowResponse response = client.StartFlow(request);
        System.out.println(client.gson.toJson(response));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : EssClient(com.tencentcloudapi.ess.v20201111.EssClient)

Example 4 with EssClient

use of com.tencentcloudapi.ess.v20201111.EssClient in project tencentcloud-sdk-java by TencentCloud.

the class ClientConfig method getClientByEndpoint.

public static EssClient getClientByEndpoint(String endPoint) {
    ClientProfile cp = new ClientProfile();
    HttpProfile hp = new HttpProfile();
    hp.setEndpoint(endPoint);
    cp.setHttpProfile(hp);
    return new EssClient(new Credential(Ak, Sk), "ap-guangzhou", cp);
}
Also used : Credential(com.tencentcloudapi.common.Credential) ClientProfile(com.tencentcloudapi.common.profile.ClientProfile) HttpProfile(com.tencentcloudapi.common.profile.HttpProfile) EssClient(com.tencentcloudapi.ess.v20201111.EssClient)

Example 5 with EssClient

use of com.tencentcloudapi.ess.v20201111.EssClient in project tencentcloud-sdk-java by TencentCloud.

the class CreateDocument method main.

public static void main(String[] args) {
    try {
        EssClient client = ClientConfig.getClientByEndpoint(EndPoint);
        CreateDocumentRequest request = new CreateDocumentRequest();
        UserInfo userInfo = new UserInfo();
        // 管理员用户id或者员工用户id
        userInfo.setUserId(OperatorId);
        // 请求客户端在公网的ip地址
        userInfo.setClientIp("************");
        request.setOperator(userInfo);
        // 由CreateFlow返回
        request.setFlowId("************");
        // 传入自定义文件名即可
        request.setFileNames(new String[] { "************" });
        // 后台配置后查询获取
        request.setTemplateId("************");
        // 普通控件
        FormField formField = new FormField();
        // 在模板配置拖入控件的界面可以查询到(ComponentName或者ComponentId选一填写,建议填写ComponentName)
        formField.setComponentName("************");
        formField.setComponentValue("************");
        // 传入需要填写的控件
        request.setFormFields(new FormField[] { formField });
        CreateDocumentResponse response = client.CreateDocument(request);
        System.out.println(client.gson.toJson(response));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : EssClient(com.tencentcloudapi.ess.v20201111.EssClient)

Aggregations

EssClient (com.tencentcloudapi.ess.v20201111.EssClient)8 GsonBuilder (com.google.gson.GsonBuilder)1 Credential (com.tencentcloudapi.common.Credential)1 TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)1 ClientProfile (com.tencentcloudapi.common.profile.ClientProfile)1 HttpProfile (com.tencentcloudapi.common.profile.HttpProfile)1 CreateFlowRequest (com.tencentcloudapi.ess.v20201111.models.CreateFlowRequest)1 CreateFlowResponse (com.tencentcloudapi.ess.v20201111.models.CreateFlowResponse)1 FlowCreateApprover (com.tencentcloudapi.ess.v20201111.models.FlowCreateApprover)1 UserInfo (com.tencentcloudapi.ess.v20201111.models.UserInfo)1