go-vikunja / vikunja

Mirror of vikunja from https://code.vikunja.io/api
GNU Affero General Public License v3.0
930 stars 63 forks source link

API call for attachment download => "missing, malformed, expired or otherwise invalid token provided" #112

Closed ozuzo closed 7 months ago

ozuzo commented 8 months ago

Description

I think I've assigned all roles to an API token in Vikunja, and are able to extract projects, tasks, etc from the API. But when trying to recreate download links for attachments, I get

[message] => missing, malformed, expired or otherwise invalid token provided

for the /tasks/XX/attachments/YY call, instead of the contents of the attachment

Are tokens supposed to work for this call as well?

Vikunja Frontend Version

0.22.1

Vikunja API Version

0.22.1

Browser and version

n/a

Can you reproduce the bug on the Vikunja demo site?

No

Screenshots

No response

kolaente commented 8 months ago

Looks like attachment upload and download are not included in the available token scopes.

kolaente commented 7 months ago

Now implemented in 415c6380a52fa15d1765cd3d4915bc0e76b1349a, please check with the next unstable build (should be ready for deployment in ~45min, also on try).

Note that you need to recreate any tokens you were previously using for this.

ozuzo commented 7 months ago

Thanks - this seems to work now in my reporting tool :-)

kolaente commented 7 months ago

I'm a little curious, how are you using the api?

ozuzo commented 7 months ago

I'm running Vikunja to support a small group of not-very-technical board members of a committee - so we have a central location for ongoing tasks, keeping track of related documents etc (in the past this was usually done only in the minutes of meetings, quite ineffecient). Two issues: te GUI is for some of them already a bit challenging, and it was a bit difficult tracking any changes since our last board meeting (specifically: added comments).

So I've written a small PHP script to generate an overview of all open tasks, with all comments and attachments, highlighting any comments made within the last four weeks (the usual interval between meetings). That way we have a nice summary of what to discuss, and everybody can easily prepare...

ozuzo commented 7 months ago

Looks like:

image

kolaente commented 7 months ago

Very nice, thanks for the insight!