-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GH-1309] Correct Attachments documentation #1324
Conversation
Thanks, @Omar8345, for this developer documentation PR. Your proposed changes will be technically reviewed by Engineering. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, @Omar8345! I think there might be some confusion going on here because the syntax in those examples matches how POST /api/v4/posts
expects the payload to look.
When you tried this, were you perhaps using an incoming webhook? I think the payload sent to a webhook uses the attachments
field without props
like in your changes.
If that's the case, I think we could instead add a separate example for posting message attachments using a webhook. If we do that, we should probably also update the existing examples to be posting to https://{your-mattermost-site}/api/v4/posts
since that's the correct API endpoint for that
Co-authored-by: Harrison Healey <[email protected]>
Thanks for your catch, I have made the corresponding changes requested and added a section for how to post a message attachment using a webhook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding that! I'm sure I'll find this useful since I've always needed to manually construct the curl command for this when I occasionally need to test something involving message attachments. I've got a couple minor tweaks I want to make, but they're more nitpicky so I can apply them myself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, would you be able to apply those? I guess I don't have the required permission to do that here
Co-authored-by: Harrison Healey <[email protected]>
Co-authored-by: Harrison Healey <[email protected]>
Co-authored-by: Harrison Healey <[email protected]>
Applied your suggested edits! I was a bit confused 😅 Edit: I just made a commit because I discovered that the curl and HTTP requests in the first FAQ wasn't putting |
@Omar8345 - Can you update your branch with latest master, please? Thanks! |
Done @cwarnermm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @Omar8345!
@hmhealey - This PR is ready for your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! I remember mentioning to do that, but I forgot to confirm that it was done in both parts. Thanks for fixing that!
Summary
This pull request corrects misinformation in the attachments documentation, in the end of the documentation, it instructs the developer to add an
attachments
key in theprops
field, which won't work, I have edited the documentation and the curl and HTTPS examples to add theattachments
key in the top-level of the post's JSON.Ticket Link
Fixes #1309