Hello,
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:
GET /wiki/rest/api/space/SPACEKEY/watch
Followed by:
DELETE /wiki/rest/api/user/watch/space/SPACEKEY?accountid=ACCOUNTID
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?
Hi @t.lange
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.
Cheers,
Matthias
PS: I‘m replying from mobile currently, otherwise I‘d check myself.
Ooof, nevermind my overly long post. @Matthias Gaiser _K15t_ nailed it - it's the capital I. Doh.
Um, CLI is still a handy tool though. :-}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
DELETE /wiki/rest/api/latest/user/watch/space/SPACEKEY?accountid=ACCOUNTID
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'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.