JSON-RPC storePage/getPage not working properly

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

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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Sarah Goff-Dupont
Published 4 hours ago in Confluence

Think you know shares vs. @mentions in Confluence? Take this collab quiz.

To anyone who doubts that Atlassians are a little too obsessed with collaboration, and tools related thereto, let me describe a recent discussion we had (which took place on our internal Confluence, ...

56 views 2 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you