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

Trouble with addAttachment method using Light Protocol

Theo T May 14, 2014

I want to add an attachment to a page in Confluence, preferably by using the Light Protocol that encodes the method name in the URL.

I have constructed the following JSON code, which should create a very simple text file:

[ 2339970
, { "fileName" : "Testfile.txt"
  , "contentType" : "text/plain"
  , "comment" : "to be ignored"
  }
, "VGhpcyBpcyBhIHRlc3QuClRvIENvbmZsdWVuY2Ugb3Igbm90IHRvIENvbmZsdWVuY2U/Cg=="
]

The third parameter is a base64 encoded string.

Unfortunately I get an error message from the server:

<error>
      <code>-32602</code>
      <data null="true"/>
      <message>Request parameter types did not match method parameter types (method addAttachment taking 3 parameters)</message>
   </error>

Any idea what I'm doing wrong here?

3 answers

0 votes
Stephen Rollins June 30, 2014

While I was not able to resolve this issue myself using the Light Protocol, I did successfully upload an attachment using the REST API.

The URL for uploading attachments is "<host:port>/confluence/rest/api/content/<page id>/child/attachment". Specific details for what data to send up can be found in Atlassian's Confluence REST API documentation.

Theo T July 6, 2014

Thank you for your answer, Stephen. I guess I'll have to try your direction for solving this issue.

0 votes
Theo T June 25, 2014

No, I eventually gave up on it. Sorry...

0 votes
Stephen Rollins June 25, 2014

I am having this same issue with the json-rpc light protocol. Have you found a solution yet?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events