my goal is to remove the default space watch of newly created users.
so i managed to get space watchers and their affiliated account id by requesting:
i'm getting status code 204 which is a sucess by documentation, but the user is not deleted from space watches.
Am i getting something wrong here? Is this a bug?
welcome to the Atlassian Community.
Your requests look quite fine, I‘ve just spotted one difference, comparing it to the documentation in the accountId parameter. The I is uppercase - depending on the implementation of the API, that might be the solution.
PS: I‘m replying from mobile currently, otherwise I‘d check myself.
Whoops. Replied in the wrong question:
So I cheated and used Bob Swift's excellent Command-Line client. I think your issue is that you need add latest as part of the URL:
When I used its removeWatch command with verbose (-v) enabled, I saw this:
% acli wiki -v --action removeWatch --space HELP --userId ACCOUNTID
URL requested: https://MYSITE.atlassian.net/wiki/rest/api/latest/user/watch/space/HELP?accountId=ACCOUNTID
Request type: DELETE
Content type: application/json; charset=utf-8
Response code: 204, message: No Content, url: https://MYSITE.atlassian.net/wiki/rest/api/latest/user/watch/space/HELP?accountId=ACCOUNTID
When I tried to replicate this using the renderRequest command (because I hate dealing with authentication tokens), the key thing to make it work was getting the Content type correct:
% acli wiki -v --action renderRequest --type "JSON" --requestType DELETE --request 'rest/api/latest/user/watch/space/HELP?accountId=ACCOUNTID'