Skip to content
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

Request-URI Too Large #111

Closed
gmcmicken opened this issue Mar 24, 2021 · 4 comments · Fixed by #146
Closed

Request-URI Too Large #111

gmcmicken opened this issue Mar 24, 2021 · 4 comments · Fixed by #146
Labels
bug Something isn't working

Comments

@gmcmicken
Copy link

Some API methods such as views.publish require a large payload and as a result - can fail with Request-URI Too Large. Is there a way to have the client send as HTTP POST with either form values or JSON encoded body? Slack API supports both of these options. Using the Slack Web API

@damienalexandre
Copy link
Member

Slack document this method as "GET":

"/views.publish": {
"get": {
"consumes": [
"application/x-www-form-urlencoded",
"application/json"
],
"description": "Publish a static view for a User.",
"externalDocs": {
"description": "API method documentation",
"url": "https://api.slack.com/methods/views.publish"
},
"operationId": "views_publish",
"parameters": [
{
"description": "Authentication token. Requires scope: `none`",
"in": "header",
"name": "token",
"required": true,
"type": "string"
},
{
"description": "`id` of the user you want publish a view to.",
"in": "query",
"name": "user_id",
"required": true,
"type": "string"
},
{
"description": "A [view payload](/reference/surfaces/views). This must be a JSON-encoded string.",
"in": "query",
"name": "view",
"required": true,
"type": "string"
},
{
"description": "A string that represents view state to protect against possible race conditions.",
"in": "query",
"name": "hash",
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Typical success response includes the published view payload.",
"schema": {
"additionalProperties": true,
"description": "This method either only returns a brief _OK_ response or a verbose schema is not available for this method.",
"properties": {
"ok": {
"$ref": "#/definitions/defs_ok_true"
}
},
"required": [
"ok"
],
"title": "Default success template",
"type": "object"
}
},
"default": {
"description": "Typical error response, before getting to any possible validation errors.",
"schema": {
"additionalProperties": true,
"description": "This method either only returns a brief _not OK_ response or a verbose schema is not available for this method.",
"properties": {
"ok": {
"$ref": "#/definitions/defs_ok_false"
}
},
"required": [
"ok"
],
"title": "Default error template",
"type": "object"
}
}
},
"security": [
{
"slackAuth": [
"none"
]
}
],
"tags": [
"views"
]
}
},

Because https://github.com/slackapi/slack-api-specs has so much issues, we have a patch system in place to edit the specification when needed. But this change would be a big one, may I suggest you open an issue on https://github.com/slackapi/slack-api-specs too?

Also here is the documentation about our patch system https://github.com/jolicode/slack-php-api/blob/master/doc/updating-sdk.md is you wanna submit a PR about this 😉

Thanks a lot

@damienalexandre damienalexandre added the bug Something isn't working label Mar 25, 2021
@ryneandal
Copy link

@gmcmicken Did you happen to open an issue on https://github.com/slackapi/slack-api-specs? This is a major issue for one of our implementations and I'll go ahead and take the reins to resolve this issue if need be.

@gmcmicken
Copy link
Author

No sorry I didn't have the time to pursue this one. Thanks @ryneandal

@ryneandal
Copy link

One interesting note is that I cannot replicate this in our "dev" environment, which is just a free-tier Slack organization that has little to no API call volume. I'm using the same payload and functionality, yet it posts with no issue.

I'm wondering if this is somehow related to the number of requests our production environment makes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants