Hi,
I’m trying to update a meeting with Java using org.apache.http.impl.client.CloseableHttpClient().
The endpoint used for the request is : https://api.zoom.us/v2/mettings/xxxxxxxxxx
Any URL parameter is join to the request
The body include a json : {“topic”:“test meeting”}
I recieve a status code 200 and no update is done.
When I tried with Postman, update is done perfectly.
This is the java code used :
String zoom_api_url = "https://api.zoom.us/v2/mettings/xxxxxxxxxx";
CloseableHttpClient client = HttpClients.createDefault();
HttpPatch patchMethod = new HttpPatch(zoom_api_url);
patchMethod.setHeader("Authorization", "Bearer " + token);
patchMethod.setHeader("Content-Type", "application/json");
patchMethod.setHeader("Accept", "application/json");
// Same result if I add or not the cookies to the request
RequestConfig requestConfig = RequestConfig.custom()
.setCookieSpec(CookieSpecs.DEFAULT)
.build();
patchMethod.setConfig(requestConfig);
StringEntity stringData = null;
try {
stringData = new StringEntity("{\"topic\":\" test meeting\"}", ContentType.APPLICATION_JSON);
stringData.setContentEncoding("UTF-8");
patchMethod.setEntity(stringData);
CloseableHttpResponse getStubResponse = client.execute(patchMethod);
int getStubStatusCode = getStubResponse.getStatusLine().getStatusCode();
String responseBody = EntityUtils.toString(getStubResponse.getEntity());
logger.info("response code:" + getStubStatusCode + " " + "responseBody : " + responseBody);
} catch (ParseException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Please can you help me with this error ?
Thank’s in advance.
Jean-Yves