kibana/docs/api/saved-objects/bulk_get.asciidoc
Court Ewing f8521c09a4 Documentation for Saved Objects API (#19513)
* Adds documentation for Saved Objects API

Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>

* [DOCS] Moved Rest APIs in navigation

* docs: revise rest api intro

* docs: revise create object api details

* docs: revise saved object api intro

* docs: revise delete saved object api details

* docs: remove newline character from api response

* docs: get saved object api details

* docs: update saved object api details

* docs: fix title attribute in saved object api examples

* docs: bulk-get saved object api details

* docs: find saved object api details

* docs: add index-pattern to valid types in api

* docs: clarify sending multiple values in api

* docs: note that savedObjects.find is not safe for export
2018-05-30 12:28:29 -04:00

81 lines
2 KiB
Text

[[saved-objects-api-bulk-get]]
=== Bulk Get Objects
experimental[This functionality is *experimental* and may be changed or removed completely in a future release.]
The bulk-get saved object API enables you to retrieve multiple Kibana saved
objects by id.
==== Request
`POST /api/saved_objects/_bulk_get`
==== Request Body
The request body must be a JSON array containing objects, each of which
contains the following properties:
`type` (required)::
(string) Valid options, include: `visualization`, `dashboard`, `search`, `index-pattern`, `config`, and `timelion-sheet`
`id` (required)::
(string) ID of object to retrieve
==== Response body
The response body will have a top level `saved_objects` property that contains
an array of objects, which represent the response for each of the requested
objects. The order of the objects in the response is identical to the order of
the objects in the request.
For any saved object that could not be found, an error object will exist in its
place.
==== Examples
The following example attempts to retrieve an index pattern with id
`my-pattern` and a dashboard with id `my-dashboard`, but only the index pattern
exists.
[source,js]
--------------------------------------------------
POST api/saved_objects/_bulk_get
[
{
"type": "index-pattern",
"id": "my-pattern"
},
{
"type": "dashboard",
"id": "my-dashboard"
}
]
--------------------------------------------------
// KIBANA
A successful call returns a response code of `200` and a response body
containing a JSON structure similar to the following example:
[source,js]
--------------------------------------------------
{
"saved_objects": [
{
"id": "my-pattern",
"type": "index-pattern",
"version": 1,
"attributes": {
"title": "my-pattern-*"
}
},
{
"id": "my-dashboard",
"type": "dashboard",
"error": {
"statusCode": 404,
"message": "Not found"
}
}
]
}
--------------------------------------------------