How to archive space via JSON RPC

Roman Janulek June 7, 2015

Hello,

I can't figure out how to call /rpc/json-rpc/confluenceservice-v2/setSpaceStatus. I don't know how to send data. I want to set space as ARCHIVED. I've read the documentation https://developer.atlassian.com/confdev/confluence-rest-api/confluence-xml-rpc-and-soap-apis/remote-confluence-methods but still no luck.

Thanks for help

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Stephen Deutsch
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 7, 2015

Here's how you would do it in the browser console using jQuery:

jQuery.ajax({
    contentType: 'application/json',
    type: 'POST',
    url: '/rpc/json-rpc/confluenceservice-v2/setSpaceStatus',
    data: '["SPACE_KEY", "ARCHIVED"]',
    success: function(response) {
      console.log(response);
    }, error: function(response) {
      console.log(response);
    }
});

Where SPACE_KEY is the key of the space that you want to set as archived.

If you are doing it outside of the browser, you will need to include the login token before the space key.

0 votes
Roman Janulek June 10, 2015

Hello Stephen,

Thank you very much this is working like a charm smile

 

Best regards,

Roman

 

DevOps March 26, 2017

Hello @Stephen Deutsch

I managed to archived a space in Confluence using the jQuery above in  browser console. There is a possibility to archive many spaces using this jQuery? From Atlasian documentation the Confluence method setSpaceStatus have parameters((String token, String spaceKey, String status).

Thanks for your help 

TAGS
AUG Leaders

Atlassian Community Events