Vote #77721
完了REST API should return attachment's id in addition to token
0%
journals
The first part (before the @.@) of the token _is_ in fact the ID.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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":https://plan.io/api/#uploading-a-file straight away and hopefully this patch can be included in Redmine as well in a next minor release.
--------------------------------------------------------------------------------
Thanks for submitting the patch, Jan.
I think this should be implemented in Redmine core. I am setting target version to 3.4.0.
--------------------------------------------------------------------------------
Patch committed, thanks.
--------------------------------------------------------------------------------