Skip to content

Commit 0e4f9e4

Browse files
authored
Merge pull request #238 from vip30/add-chat-unfurl
Adds support for unfurls in Slack Web AP
2 parents 8043c9b + 42b4f0a commit 0e4f9e4

File tree

3 files changed

+77
-2
lines changed

3 files changed

+77
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def application do
2424
end
2525

2626
def deps do
27-
[{:slack, "~> 0.23.5"}]
27+
[{:slack, "~> 0.23.6"}]
2828
end
2929
```
3030

lib/slack/web/docs/chat.unfurl.json

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"desc":"Provide custom unfurl behavior for user-posted URLs.",
3+
"args":{
4+
"ts":{
5+
"required":true,
6+
"example":"1405894322.002768",
7+
"desc":"Timestamp of the message to add unfurl behavior to."
8+
},
9+
"channel":{
10+
"required":true,
11+
"type":"channel",
12+
"example":"C1234567890",
13+
"desc":"Channel ID of the message."
14+
},
15+
"unfurls":{
16+
"required":true,
17+
"desc":"URL-encoded JSON map with keys set to URLs featured in the the message, pointing to their unfurl blocks or message attachments."
18+
},
19+
"user_auth_message":{
20+
"required":false,
21+
"desc":"Provide a simply-formatted string to send as an ephemeral message to the user as invitation to authenticate further and enable full unfurling behavior."
22+
},
23+
"user_auth_required":{
24+
"required":false,
25+
"example":true,
26+
"desc":"Set to true or 1 to indicate the user must install your Slack app to trigger unfurls for this domain."
27+
},
28+
"user_auth_url":{
29+
"required":false,
30+
"example":"https://example.com/onboarding?user_id=xxx",
31+
"desc":"Send users to this custom URL where they will complete authentication in your app to fully trigger unfurling. Value should be properly URL-encoded.."
32+
}
33+
},
34+
"errors":{
35+
"missing_channel":"The request is missing the channel parameter",
36+
"missing_ts":"The request is missing the ts parameter",
37+
"cannot_find_channel":"The specified channel could not be located for this token.",
38+
"cannot_find_service":"A record of your app being allowed to unfurl for this workspace could not be found.",
39+
"cannot_parse_attachment":"The provided unfurls argument could not be parsed or understood.",
40+
"missing_unfurls":"The request is missing the unfurls parameter.",
41+
"invalid_unfurls_format":"The unfurls parameter cannot be JSON-decoded into a map of URLs to attachments.",
42+
"cannot_unfurl_url":"The URL cannot be unfurled. This error may be returned if you haven't acknowledged a link_shared event tied to the same URL. It is also returned when the domain appears in a workspace's administrative blacklists.",
43+
"cannot_prompt":"The current user has already interacted with and dismissed a prompt for this application.",
44+
"cannot_find_message":"The ts value in the request does not match a message.",
45+
"cannot_unfurl_message":"The URL cannot be unfurled because the URL provided does not appear in the message.",
46+
"not_authed":"No authentication token provided.",
47+
"invalid_auth":"Some aspect of authentication cannot be validated. Either the provided token is invalid or the request originates from an IP address disallowed from making the request.",
48+
"account_inactive":"Authentication token is for a deleted user or workspace.",
49+
"token_revoked":"Authentication token is for a deleted user or workspace or the app has been removed.",
50+
"no_permission":"The workspace token used in this request does not have the permissions necessary to complete the request. Make sure your app is a member of the conversation it's attempting to post a message to.",
51+
"org_login_required":"The workspace is undergoing an enterprise migration and will not be available until migration is complete.",
52+
"ekm_access_denied":"Administrators have suspended the ability to post a message.",
53+
"missing_scope":"The token used is not granted the specific scope permissions required to complete this request.",
54+
"not_allowed_token_type":"The token type used in this request is not allowed.",
55+
"method_deprecated":"The method has been deprecated.",
56+
"deprecated_endpoint":"The endpoint has been deprecated.",
57+
"two_factor_setup_required":"Two factor setup is required.",
58+
"enterprise_is_restricted":"The method cannot be called from an Enterprise.",
59+
"is_bot":"This method cannot be called by a bot user.",
60+
"invalid_arguments":"The method was either called with invalid arguments or some detail about the arguments passed are invalid, which is more likely when using complex arguments like blocks or attachments.",
61+
"invalid_arg_name":"The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and names with non-alphanumeric characters other than _. If you get this error, it is typically an indication that you have made a very malformed API call.",
62+
"invalid_array_arg":"The method was passed an array as an argument. Please only input valid strings.",
63+
"invalid_charset":"The method was called via a POST request, but the charset specified in the Content-Type header was invalid. Valid charset names are: utf-8 iso-8859-1.",
64+
"invalid_form_data":"The method was called via a POST request with Content-Type application/x-www-form-urlencoded or multipart/form-data, but the form data was either missing or syntactically invalid.",
65+
"invalid_post_type":"The method was called via a POST request, but the specified Content-Type was invalid. Valid types are: application/json application/x-www-form-urlencoded multipart/form-data text/plain.",
66+
"missing_post_type":"The method was called via a POST request and included a data payload, but the request did not include a Content-Type header.",
67+
"team_added_to_org":"The workspace associated with your request is currently undergoing migration to an Enterprise Organization. Web API and other platform operations will be intermittently unavailable until the transition is complete.",
68+
"ratelimited":"The request has been ratelimited. Refer to the Retry-After header for when to retry the request.",
69+
"accesslimited":"Access to this method is limited on the current network",
70+
"request_timeout":"The method was called via a POST request, but the POST data was either missing or truncated.",
71+
"service_unavailable":"The service is temporarily unavailable",
72+
"fatal_error":"The server could not complete your operation(s) without encountering a catastrophic error. It's possible some aspect of the operation succeeded before the error was raised.",
73+
"internal_error":"The server could not complete your operation(s) without encountering an error, likely due to a transient issue on our end. It's possible some aspect of the operation succeeded before the error was raised."
74+
}
75+
}

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Slack.Mixfile do
44
def project do
55
[
66
app: :slack,
7-
version: "0.23.5",
7+
version: "0.23.6",
88
elixir: "~> 1.7",
99
elixirc_paths: elixirc_paths(Mix.env()),
1010
name: "Slack",

0 commit comments

Comments
 (0)