Endpoint for APIv4: /files/{file_id}/link (#5607)

* APIv4: /files/{file_id}/link

* updated public link
Этот коммит содержится в:
Saturnino Abril
2017-03-12 07:24:44 +09:00
коммит произвёл enahum
родитель ce772b87da
Коммит d32334cdfb
5 изменённых файлов: 127 добавлений и 1 удалений

Просмотреть файл

@@ -903,6 +903,15 @@ func (c *Client4) GetFileThumbnail(fileId string) ([]byte, *Response) {
}
}
// GetFileLink gets the public link of a file by id.
func (c *Client4) GetFileLink(fileId string) (string, *Response) {
if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/link", ""); err != nil {
return "", &Response{StatusCode: r.StatusCode, Error: err}
} else {
return MapFromJson(r.Body)["link"], BuildResponse(r)
}
}
// GetFileInfosForPost gets all the file info objects attached to a post.
func (c *Client4) GetFileInfosForPost(postId string, etag string) ([]*FileInfo, *Response) {
if r, err := c.DoApiGet(c.GetPostRoute(postId)+"/files/info", etag); err != nil {