Feature #23566

REST API should return attachment's id in addition to token

Added by Alex Last 7 months ago. Updated 7 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:REST API
Target version:3.4.0
Resolution:Fixed

0001-return-attachment-id-in-api-response-to-attachment-u.patch Magnifier (1.44 KB) Jan from Planio www.plan.io, 2016-08-15 11:55

Associated revisions

Revision 15762
Added by Jean-Philippe Lang 7 months ago

Return attachment id in api response to attachment upload (#23566).

Patch by Jan Schulz-Hofen.

History

#1 Updated by Jan from Planio www.plan.io 7 months ago

The first part (before the .) of the token is in fact the ID.

#2 Updated by Alex Last 7 months ago

Than you, Jan! this is useful to know. it is hard to predict though if that is something that we could rely on going forward. it may be just some internal implementation detail rather than documented API.
if I parse id from the token, this may break for the next redmine version - non-starter for the Java library because I can't support separate versions for each Redmine version.

#3 Updated by Jan from Planio www.plan.io 7 months ago

Alex Last wrote:

Than you, Jan! this is useful to know. it is hard to predict though if that is something that we could rely on going forward. it may be just some internal implementation detail rather than documented API.
if I parse id from the token, this may break for the next redmine version - non-starter for the Java library because I can't support separate versions for each Redmine version.

I agree. Luckily, it's not hard to return the ID as well, so the attached patch implements this. We've added this to the Redmine API at Planio straight away and hopefully this patch can be included in Redmine as well in a next minor release.

#4 Updated by Go MAEDA 7 months ago

  • Status changed from Resolved to New
  • Target version changed from Candidate for next minor release to 3.4.0

Thanks for submitting the patch, Jan.
I think this should be implemented in Redmine core. I am setting target version to 3.4.0.

#5 Updated by Jean-Philippe Lang 7 months ago

  • Subject changed from "upload attachment" should return attachment's database id in addition to token because "delete" operation operates on id only to REST API should return attachment's id in addition to token
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Patch committed, thanks.

Also available in: Atom PDF