Mattermost-server: [Help Wanted] Add plugin API for GetFile method

Created on 12 Oct 2018  路  11Comments  路  Source: mattermost/mattermost-server

If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.


The method GetFile(fileId string) ([]byte, *Response) is available in model/client4.go, the Go REST API driver for Mattermost, but does not have an equivalent in the plugin API.

Not having this method in the plugin API limits what plugins can do. Hence, we would like to add an equivalent plugin API for it.

Read about adding to the plugin API here https://developers.mattermost.com/contribute/server/plugins/. Most of these methods should have fairly simple equivalents in the app package, making them trivial to implement.

You'll want to look at these files:

If you have any questions or would like feedback, feel free to ask in the Developer Toolkit channel on our Mattermost community instance.


This ticket is part of a larger campaign for adding plugin API methods. See here: https://github.com/mattermost/mattermost-server/issues/9458

Easy TecGo

Most helpful comment

I would like to work on this.

All 11 comments

I would like to work on this.

@vaithak Any questions on this ticket? Let us know if we can help with anything :)

@jasonblais Currently there does not exist an api for this in app/, so can you give any idea of a basic overview required for this issue . Thanks

@vaithak Good question - I've posted it to our public Developer Toolkit channel to our plugin developers here https://pre-release.mattermost.com/core/pl/r74goy6kciykbjh8kio3nznkpa

Hey @vaithak - it should be similiar to the API call here: https://github.com/mattermost/mattermost-server/blob/master/api4/file.go#L146

you can refactor the code into the app and reuse in both api/plugin calls

@jasonblais @cpanato Should the signature of API call be that in api4/file.go or the one mentioned in the issue description above ?

@cpanato I am asking that the api that I have to define in plugin/api.go, should that API's signature be similar to that written in api4/file.go or the one mentioned in issue description above ?

@vaithak can be
GetFile(fileId string) ([]byte, *model.AppError)

Fixed with https://github.com/mattermost/mattermost-server/pull/9820.

Thanks you very much @vaithak for the contribution! :tada:

Was this page helpful?
0 / 5 - 0 ratings