according to this workarround.
https://confluence.atlassian.com/confkb/how-to-disable-notifications-for-attachments-action-862622270.html
I need to disable notifications when an attachments is uploaded in confluence.
I did a Groovy code to perform it.
But The response is allways 401
"subCode": "upm.websudo.error"
Tried with basic and bearer token autentificación
import javax.xml.bind.DatatypeConverter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Scanner;
URL url = new URL("MYCONFLUENCEURL/rest/plugins/1.0/com.atlassian.confluence.plugins.confluence-file-notifications-key/modules/file-content-remove-notification-key");
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
httpConn.setRequestMethod("PUT");
httpConn.setRequestProperty("Content-Type", "application/vnd.atl.plugins.plugin.module+json");
httpConn.setRequestProperty("Authorization", "Bearer " + "MYTOKEN");
httpConn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(httpConn.getOutputStream());
writer.write("{\n \"enabled\": false\n}");
writer.flush();
writer.close();
httpConn.getOutputStream().close();
InputStream responseStream = httpConn.getResponseCode() / 100 == 2
? httpConn.getInputStream()
: httpConn.getErrorStream();
Scanner s = new Scanner(responseStream).useDelimiter("\\A");
String response = s.hasNext() ? s.next() : "";
log.warn(response);
Regards,