kibana/docs/api/data-views/default-get.asciidoc
Matthew Kime 5d8a7920c1
[data views] Add data view REST api docs, keep deprecated equivalents (#123111)
* add data view api docs, keep deprecated equivalents

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2022-02-02 13:37:16 -06:00

60 lines
1.3 KiB
Text

[[data-views-api-default-get]]
=== Get default data view API
++++
<titleabbrev>Get default data view</titleabbrev>
++++
experimental[] Retrieve a default data view ID. Kibana UI uses the default data view unless user picks a different one.
[[data-views-api-default-get-request]]
==== Request
`GET <kibana host>:<port>/api/data_views/default`
`GET <kibana host>:<port>/s/<space_id>/api/data_views/default`
[[data-views-api-default-get-params]]
==== Path parameters
`space_id`::
(Optional, string) An identifier for the space. If `space_id` is not provided in the URL, the default space is used.
[[data-views-api-default-get-codes]]
==== Response code
`200`::
Indicates a successful call.
[[data-views-api-default-get-example]]
==== Example
Retrieve the default data view id:
[source,sh]
--------------------------------------------------
$ curl -X GET api/data_views/default
--------------------------------------------------
// KIBANA
The API returns an ID of a default data view:
[source,sh]
--------------------------------------------------
{
"data_view_id": "..."
}
--------------------------------------------------
In case there is no default data view, the API returns:
[source,sh]
--------------------------------------------------
{
"data_view_id": null
}
--------------------------------------------------