Skip to content

Commit 0ae4e98

Browse files
author
Slack API Ref Buildbot
committed
Add canvases.getContent method and new error codes
- Add new method canvases.getContent for retrieving canvas content as markdown or HTML - Add restricted_action error to conversations.history and conversations.open - Add invalid_resource error to oauth.v2.user.access - Add invalid_cursor error to reactions.list - Update example ID for slackLists.items.update list_id argument
1 parent 867464f commit 0ae4e98

13 files changed

Lines changed: 164 additions & 2 deletions
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"desc": "Get the content of a canvas as markdown (default) or HTML.",
3+
"http_method": "POST",
4+
"scope": {
5+
"bot": [
6+
"canvases:read"
7+
],
8+
"user": [
9+
"canvases:read"
10+
]
11+
},
12+
"json_input_supported": true,
13+
"rate_limits": "t3",
14+
"args": {
15+
"type": "object",
16+
"required": [
17+
"token",
18+
"canvas_id"
19+
],
20+
"properties": {
21+
"token": {
22+
"desc": "Authentication token bearing required scopes. Tokens should be passed as an HTTP Authorization header or alternatively, as a POST parameter.",
23+
"type": "string",
24+
"subtype": "auth",
25+
"example": "xxxx-xxxxxxxxx-xxxx"
26+
},
27+
"canvas_id": {
28+
"desc": "Encoded ID of the canvas",
29+
"example": "F1234ABCD",
30+
"subtype": "canvas",
31+
"schema": "file_id"
32+
},
33+
"content_type": {
34+
"desc": "Format in which to return the canvas content. Defaults to markdown.",
35+
"type": "string",
36+
"enum": [
37+
"html",
38+
"markdown"
39+
],
40+
"default": "markdown"
41+
}
42+
}
43+
},
44+
"output": {
45+
"type": "object",
46+
"required": [
47+
"content"
48+
],
49+
"properties": {
50+
"content": {
51+
"type": "string",
52+
"desc": "The content of the canvas in the requested content_type."
53+
}
54+
}
55+
},
56+
"errors": {
57+
"canvas_disabled_user_team": {
58+
"desc": "Canvas is disabled on user's team"
59+
},
60+
"canvas_not_found": {
61+
"desc": "The canvas does not exist, or is not visible to the calling user."
62+
}
63+
},
64+
"examples": {
65+
"success": {
66+
"url": "/api/canvases.getContent?token=YOUR_TOKEN&canvas_id=F1234ABCD",
67+
"description": "Typical success response",
68+
"example": {
69+
"ok": true,
70+
"content": "# Project plan\n\n- [ ] Draft spec\n- [x] Kickoff meeting\n"
71+
}
72+
},
73+
"error": {
74+
"url": "/api/canvases.getContent?token=YOUR_TOKEN&canvas_id=F0000000000",
75+
"description": "Typical error response when the canvas does not exist",
76+
"example": {
77+
"ok": false,
78+
"error": "canvas_not_found"
79+
}
80+
}
81+
}
82+
}

‎docs.slack.dev/methods/conversations.history.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@
212212
},
213213
"not_in_channel": {
214214
"desc": "The token used does not have access to the proper channel. Only user tokens can access public channels they are not in."
215+
},
216+
"restricted_action": {
217+
"desc": "User does not have permission to perform this action."
215218
}
216219
},
217220
"examples": {

‎docs.slack.dev/methods/conversations.open.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@
125125
"not_enough_users": {
126126
"desc": "Needs at least 2 users to open"
127127
},
128+
"restricted_action": {
129+
"desc": "User does not have permission to perform this action."
130+
},
128131
"too_many_users": {
129132
"desc": "Needs at most 8 users to open"
130133
},

‎docs.slack.dev/methods/methods.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,13 @@
12031203
"canvases"
12041204
]
12051205
},
1206+
{
1207+
"name": "canvases.getContent",
1208+
"description": "Get the content of a canvas as markdown (default) or HTML.",
1209+
"family": [
1210+
"canvases"
1211+
]
1212+
},
12061213
{
12071214
"name": "canvases.sections.lookup",
12081215
"description": "Find sections matching the provided criteria",

‎docs.slack.dev/methods/oauth.v2.user.access.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@
176176
"invalid_refresh_token": {
177177
"desc": "The given refresh token is invalid."
178178
},
179+
"invalid_resource": {
180+
"desc": "The `resource` in the assertion is malformed, or is not a resource tokens can be issued for."
181+
},
179182
"no_scopes": {
180183
"desc": "Missing `scope` in the request."
181184
},

‎docs.slack.dev/methods/reactions.list.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
}
7979
},
8080
"errors": {
81+
"invalid_cursor": {
82+
"desc": "Value passed for `cursor` was not valid or is no longer valid."
83+
},
8184
"user_not_found": {
8285
"desc": "Value passed for `user` was invalid."
8386
}

‎docs.slack.dev/methods/slackLists.items.update.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
},
2727
"list_id": {
2828
"desc": "ID of the List to add or update cells.",
29-
"example": "F01ABCDE2FG",
29+
"example": "F0123ABC456",
3030
"type": "string",
3131
"subtype": "list"
3232
},
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"group": "canvases",
3+
"name": "canvases.getContent",
4+
"deprecated": false,
5+
"desc": "Get the content of a canvas as markdown (default) or HTML.",
6+
"args": {
7+
"canvas_id": {
8+
"required": true,
9+
"example": "F1234ABCD",
10+
"desc": "Encoded ID of the canvas."
11+
},
12+
"content_type": {
13+
"required": false,
14+
"example": "markdown",
15+
"desc": "Format in which to return the canvas content. Defaults to markdown.",
16+
"type": "enum"
17+
}
18+
},
19+
"response": {
20+
"examples": [
21+
"{\n \"ok\": true,\n \"content\": \"# Project plan\\n\\n- [ ] Draft spec\\n- [x] Kickoff meeting\\n\"\n}",
22+
"{\n \"ok\": false,\n \"error\": \"canvas_not_found\"\n}"
23+
]
24+
},
25+
"errors": {
26+
"access_denied": "Access to a resource specified in the request is denied.",
27+
"accesslimited": "Access to this method is limited on the current network.",
28+
"account_inactive": "Authentication token is for a deleted user or workspace when using a bot token.",
29+
"canvas_disabled_user_team": "Canvas is disabled on user's team",
30+
"canvas_not_found": "The canvas does not exist, or is not visible to the calling user.",
31+
"deprecated_endpoint": "The endpoint has been deprecated.",
32+
"ekm_access_denied": "Administrators have suspended the ability to post a message.",
33+
"enterprise_is_restricted": "The method cannot be called from an Enterprise.",
34+
"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.",
35+
"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.",
36+
"invalid_array_arg": "The method was passed an array as an argument. Please only input valid strings.",
37+
"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.",
38+
"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.",
39+
"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.",
40+
"is_bot": "This method cannot be called by a legacy bot.",
41+
"method_deprecated": "The method has been deprecated.",
42+
"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.",
43+
"missing_scope": "The token used is not granted the specific scope permissions required to complete this request.",
44+
"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.",
45+
"not_allowed_token_type": "The token type used in this request is not allowed.",
46+
"not_authed": "No authentication token provided.",
47+
"org_login_required": "The workspace is undergoing an enterprise migration and will not be available until migration is complete.",
48+
"ratelimited": "The request has been ratelimited. Refer to the Retry-After header for when to retry the request.",
49+
"request_timeout": "The method was called via a POST request, but the POST data was either missing or truncated.",
50+
"service_unavailable": "The service is temporarily unavailable.",
51+
"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.",
52+
"token_expired": "Authentication token has expired.",
53+
"token_revoked": "Authentication token is for a deleted user or workspace or the app has been removed when using a user token.",
54+
"two_factor_setup_required": "Two factor setup is required.",
55+
"unknown_method": "This method is currently not available."
56+
}
57+
}

‎methods/conversations/conversations.history.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"org_login_required": "The workspace is undergoing an enterprise migration and will not be available until migration is complete.",
8484
"ratelimited": "The request has been ratelimited. Refer to the Retry-After header for when to retry the request.",
8585
"request_timeout": "The method was called via a POST request, but the POST data was either missing or truncated.",
86+
"restricted_action": "User does not have permission to perform this action.",
8687
"service_unavailable": "The service is temporarily unavailable.",
8788
"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.",
8889
"token_expired": "Authentication token has expired.",

‎methods/conversations/conversations.open.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"org_login_required": "The workspace is undergoing an enterprise migration and will not be available until migration is complete.",
6161
"ratelimited": "The request has been ratelimited. Refer to the Retry-After header for when to retry the request.",
6262
"request_timeout": "The method was called via a POST request, but the POST data was either missing or truncated.",
63+
"restricted_action": "User does not have permission to perform this action.",
6364
"service_unavailable": "The service is temporarily unavailable.",
6465
"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.",
6566
"token_expired": "Authentication token has expired.",

0 commit comments

Comments
 (0)