Skip to content

v0.13.1

Compare
Choose a tag to compare
@soxtoby soxtoby released this 27 Apr 01:20
· 8 commits to master since this release
  • Support for new file upload APIs
    • Added GetUploadUrlExternal and CompleteUploadExternal methods to FilesApi.
    • Added Upload overloads that take advantage of new upload APIs (see below). The old overloads have been marked as obsolete in favour of the new methods.
    • Added IHttp parameter to FilesApi constructor. The old constructor has been marked as obsolete, and will use the default IHttp implementation.
  • Added missing StatusEmojiDisplayInfo, StatusTextCanonical, Pronouns, and StartDate properties to UserProfile.
  • Added ThreadBroadcast event. This replaces ReplyBroadcast, which will now work again, but has been marked as obsolete.

Upload API

Slack's new upload API requires at least 3 requests: 1 to get a URL to upload to, 1 to upload the file to that URL, and 1 to complete the upload operation, and the first 2 of those must be repeated for each file being uploaded together.

SlackNet provides two new Upload methods that handle these requests for you, providing an API similar to the old upload API. These Upload methods take in either a single FileUpload object or an IEnumerable of them, allowing you to specify the file contents in a number of formats, and return references to the uploaded files in Slack. The GetUploadUrlExternal and CompleteUploadExternal methods are provided for completeness, but using Upload is recommended.