Attachments through ReST API

Added by Wes W. about 12 years ago

Is it possible to attach files through the ReST API at all?

Replies (14)

RE: Attachments through ReST API - Added by Wes W. about 12 years ago

Alright,
and thanks for such a quick reply!

RE: Attachments through ReST API - Added by Wes W. about 12 years ago

[Another quick question about the API]
Is there a method in which I could ADD to the current description of an issue when updating it?
So far all I seem to do is replace the old description with the new one.

RE: Attachments through ReST API - Added by Felix Schäfer about 12 years ago

Well, you can read and write the description field of an issue (provided you have the correct permissions), "appending" to the description is merely a "read description", "add string/lines to that", "write the result to the description field".

RE: Attachments through ReST API - Added by Wes W. about 12 years ago

Also, what is the xml tag to add watchers to an issue through the api?

RE: Attachments through ReST API - Added by Felix Schäfer about 12 years ago

On issue creation I think a list of user ids in the equivalent of issue[watcher_user_ids][], pretty sure not possible through the issue rest api after that.

RE: Attachments through ReST API - Added by Svetlana Nazarova over 11 years ago

Hallo
Has the situation been changed last 6 months?
Is it possible to attach files through the ReST API now?

RE: Attachments through ReST API - Added by RedminePro Yang over 11 years ago

Is it possible to embed a file content and its meta data in the JSON/XML.

API Post

"attachments"=>{"1"=>{ "file"=>{content=>"file content here", type=>"plain/text"} , "description"=>"test"}}

RE: Attachments through ReST API - Added by Robert Gstöhl over 11 years ago

What redmine version are you (Rongde / Svetlana) using? In my case, the embedded attachment is silently ignored by redmine when testing this out with curl:

issue3.json:

1 {
2 "issue":{
3 "subject":"Test ohne journals updtd json",
4 "tracker":{
5 "name":"Bug",
6 "id":1
7 },
8 "id":3,
9 "attachments":{
10 "1":{
11 "file":{
12 "content":"file content here",
13 "type":"plain/text"
14 },
15 "description":"test"
16 }
17 }
18 }
19 }

Any help is greatly appreciated. Cheers Robert

RE: Attachments through ReST API - Added by RedminePro Yang over 11 years ago

Hi Robert,

I am sorry, I meant to suggest Redmine Developer to support that. I was asking whether it is possible to do like that.

I am really sorry!

RE: Attachments through ReST API - Added by Robert Gstöhl over 11 years ago

No problem Rongde. I already thought this would be too easy to be true. At the moment I'm mucking around with multi-part form generation to get the attachments into redmine. Kind of like the C# redmine client (http://redmineclient.sourceforge.net) does it.

RE: Attachments through ReST API - Added by RedminePro Yang over 11 years ago

C# Redmine client can upload attachment to Redmine Site?

Currently, my iOS redmine client upload the photo to GetCloundApp.com, and embed the photo url in the issue description
http://redminepro.jawasoft.com/issues/74

RE: Attachments through ReST API - Added by Terence Mill about 11 years ago

We tried the C#Client for redmine 1.2.1 and it does not work.

(1-14/14)