mailtodanish | Posts: 47

Is there way to set Language on Signer Level

0 votes
Hi, Chinese is not working on package level. We have application and deployed the JAR file but Locale is not working for CHINESE. It is working for rest all Language. Dont know exact issue because it is Siebel Application and we can only deploy JAR. It is not working for CHINESE Locale. Could you please suggest any other way to set Language. like 1. Signer Level 2. Is there way to call POST/HTTP and update Language on Existing package We will go ahead and create Package with SDK JAR and after creation if we can call any HTTP/POST and update language in Package. Thanks, Danish

Approved Answer
Duo_Liang | Posts: 3776

Reply to: Is there way to set Language on Signer Level

0 votes
Hi Danish, I've created some sample code for you to update the signer level language setting. To do so, you'd follow below steps: 0. make sure that your package is in DRAFT status 1. get Role's JSON (GET /api/packages/{package_id}/roles/{role_id}) 2. update the "language" field under "signers" node (go check our API reference) 3. update Role with JSON payload (PUT /api/packages/{package_id}/roles/{role_id}) The reason why you have to do get-update approach is because you have to pass in a fully dressed Role JSON to the PUT call(step 3), otherwise all missing fields regarding to this role will be set back to default. Hope this could help! Duo

mailtodanish | Posts: 47

Reply to: Is there way to set Language on Signer Level

0 votes
Hi , I have downloaded the script and it is updating language on Signer level . Is it possible if same way we can update language on package level only. It would be easy for us if we directly update Language on Package level and it will be for all signer. Thanks,Danish

Duo_Liang | Posts: 3776

Reply to: Is there way to set Language on Signer Level

0 votes
Hi Danish, If you still use this workflow, only change package level language setting won't overwriting existing recipient's signer level setting. So you might have to tweak the process a little bit to set package level language before adding any signers, like below steps: 1.create the package with all the settings and uploading documents without fields. 2.change package level language setting by REST function 3.add signers 4.add fields and signatures for signers. Or if this is too many changes to your code, it might be better to loop through all signers and to update their signer languages one by one. Duo

mailtodanish | Posts: 47

Reply to: Is there way to set Language on Signer Level

0 votes
Could you please provide sample code for below. 2.change package level language setting by REST function

Duo_Liang | Posts: 3776

Reply to: Is there way to set Language on Signer Level

0 votes
Sure, I will directly attach the code here:
		String packageId = "wlIXkBTEMLCtsb7bpZKFpKD0i9I=";
		String simplifiedChinese = "zh-CN";

		HttpURLConnection sourceConn = null;
		try {
			URL sourceClient = new URL(API_URL+"/packages/"+packageId);
			sourceConn = (HttpURLConnection) sourceClient.openConnection();
			sourceConn.setRequestProperty("Content-Type", "application/json");
			sourceConn.setRequestProperty("Accept", "application/json; esl-api-version=11.21");
			sourceConn.setRequestProperty("Authorization", "Basic " + API_KEY);
			sourceConn.setRequestMethod("PUT");
			sourceConn.setDoOutput(true);
			sourceConn.setDoInput(true);

			String payload = "{\"language\":\""+simplifiedChinese+"\"}";
			
			OutputStream os = sourceConn.getOutputStream();
			System.out.println(payload);
			os.write(payload.getBytes());
			os.flush();
			os.close();

			int sourceResponseCode = ((HttpURLConnection) sourceConn).getResponseCode();

			Reader ir = sourceResponseCode == 200 ? new InputStreamReader(sourceConn.getInputStream())
					: new InputStreamReader(sourceConn.getErrorStream());
			BufferedReader in = new BufferedReader(ir);
			String inputLine;
			StringBuffer response = new StringBuffer();

			while ((inputLine = in.readLine()) != null) {
				response.append(inputLine);
			}
			in.close();
			if (sourceResponseCode != 200) {
				throw new RuntimeException(response.toString());
			}
		} catch (RuntimeException re) {
			throw re;
		} catch (Exception e) {
			throw new RuntimeException("Fail to update package " + packageId + " : " + e.getMessage());
		} finally {
			if (sourceConn != null) {
				sourceConn.disconnect();
			}
		}
Duo

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off