Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JSON-RPC storePage/getPage not working properly

Erich Leipold February 13, 2014

I thought I had a problem using storePage, because it did not return any results. Having abandoned the idea that the JSON-RPC method should return the RemotePage instance, I focused on using getPage right after the storePage to get the ID for the newly-created page. I am not getting any content in my reply. Below are the two calls that I am using from a Linux shell:

curl --trace - --basic -u <username>:<password> --data '{"jsonrpc":"2.0","method":"storePage","params":{"space":"CLI","title":"Test Organization 2","content":"Some Content","parentId":25886799}}' -H "Content-Type: application/json" https://confluex.atlassian.net:443/wiki/rpc/json-rpc/confluenceservice-v2

curl --trace - --basic -u <username>:<password> --data '{"jsonrpc":"2.0","method":"getPage","params":{"spaceKey":"CLI","pageTitle":"Test Organization 2"}}' -H "Content-Type: application/json" https://confluex.atlassian.net:443/wiki/rpc/json-rpc/confluenceservice-v2

Both of those commands returns a zero-byte response. However, the storePage actually creates the Wiki page exactly where I want it. Am I doing something incorrectly?

We have an OnDemand instance of Confluence.

1 answer

0 votes
Steve Muskiewicz February 26, 2014

Hi,

We are also an OnDemand customer, I was testing out the Confluence JSON-RPC API today and saw exactly the same problem as you did, zero-byte response from pretty much any of the methods that I tried (including "getSpace").

However, I just tried using the "light protocol" as mentioned in the docs https://developer.atlassian.com/display/CONFDEV/Confluence+JSON-RPC+APIs#ConfluenceJSON-RPCAPIs-TheLightProtocoland that seemed to work for me.

Not sure why one works but the other doesn't, maybe a bug?

(Also FYI, I remember reading on some Google result that the "spaceKey" parameter name was actually a typo and it should be just "space" but that didn't seem to matter, nothing with the "heavy" protocol in OnDemand seems to work right for me at least.)

HTH, it would be nice to hear from Atlassian if there is some kind of problem in OnDemand with this or whether we are doing something wrong.

-steve

Erich Leipold March 3, 2014

Thanks, Steve. It will take me a little while to get back to this project, but I am interested in trying your suggestion. I'll let you know if this works out for me.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events