Update sender language and time zone
Thursday, January 3, 2019 at 08:01amCan you please provide us a code on how to update sender language and the timezone of the sender account
OneSpan Introduces DigipassONE, Bringing a Unified Platform Approach to Authentication Modernization
A new authentication platform helps financial institutions support diverse customer authentication preferences while modernizing at their own pace Learn More
Reply to: Update sender language and time zone
Thursday, January 3, 2019 at 08:53amprivate void updateSenderLanguageAndTimezone(String api_url, String api_key, String senderId, String language, String timezoneId) throws IOException { URL sourceClient = new URL(api_url + "/account/senders/" + senderId); HttpURLConnection sourceConn = (HttpURLConnection) sourceClient.openConnection(); sourceConn.setRequestProperty("Content-Type", "application/json; esl-api-version=11.21"); sourceConn.setRequestProperty("Accept", "application/json; esl-api-version=11.21"); sourceConn.setRequestProperty("Authorization", "Basic " + api_key); sourceConn.setRequestMethod("POST"); sourceConn.setDoOutput(true); sourceConn.setDoInput(true); String payloadJSON = "{ \"language\": \"" + language + "\",\"timezoneId\": \"" + timezoneId + "\"}"; System.out.println(payloadJSON); OutputStream os = sourceConn.getOutputStream(); os.write(payloadJSON.toString().getBytes()); os.flush(); os.close(); int sourceResponseCode = ((HttpURLConnection) sourceConn).getResponseCode(); if (sourceResponseCode != 200) { Reader ir = 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(); sourceConn.disconnect(); throw new RuntimeException(response.toString()); } } Sample Usage: updateSenderLanguageAndTimezone("API_URL", "API_KEY", "sender_id", "fr", "GMT");