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();
}
}
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();
}
}
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();
}
}
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);
}
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();
}
}
Aggregations