-
Notifications
You must be signed in to change notification settings - Fork 181
Open
Labels
Team:DeveloperIssues owned by the Developer Docs TeamIssues owned by the Developer Docs Teamapi-feedback
Description
Was the documentation helpful?
Yes
What documentation page is affected
- https://www.elastic.co/docs/api/doc/kibana/operation/operation-post-fleet-epm-packages
- Actually all Kibana API documentation pages
Description
The example curl provided by the documentation has a handful of issues:
curl \
--request POST 'https://localhost:5601/api/fleet/epm/packages' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/gzip; application/zip" \
--header "kbn-xsrf: true" \
--data-binary '@file'
API Key header
The first issue affects all Kibana API requests:
--header "Authorization: $API_KEY" \
should be:
--header "Authorization: ApiKey $API_KEY" \
(Note the additional ApiKey string). This is also reported in the introduction of the API Documentation.
Content-Type Header
This issue only affect the page (Fleet API) Install a package by upload
The following Content-Type header:
--header "Content-Type: application/gzip; application/zip" \
..
--data-binary '@myfile.zip'
Does not work with Kibana. It will answer with the following error:
{
"statusCode": 415,
"error": "Unsupported Media Type",
"message": "Unsupported media type application/gzip; application/zip. Please use 'application/gzip' or 'application/zip'"
} To fix the command, we need to adjust the content-type to be only application/zip (or application/gzip if the file is a gzip).
Metadata
Metadata
Assignees
Labels
Team:DeveloperIssues owned by the Developer Docs TeamIssues owned by the Developer Docs Teamapi-feedback