# REST Management API - Cannot get it to work with DLS

**URL:** https://forum.search-guard.com/t/rest-management-api-cannot-get-it-to-work-with-dls/589
**Category:** Search Guard
**Created:** [September 1, 2017, 12:54pm UTC](https://forum.search-guard.com/t/rest-management-api-cannot-get-it-to-work-with-dls/589 "2017-09-01T12:54:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Terry\_Quigley](https://avatars.discourse-cdn.com/v4/letter/t/43a26b/32.png) [@Terry\_Quigley](https://forum.search-guard.com/u/Terry_Quigley)
#### Post date: [September 1, 2017, 12:54pm UTC](https://forum.search-guard.com/t/rest-management-api-cannot-get-it-to-work-with-dls/589/1 "2017-09-01T12:54:59Z")

</div>

Hi

Do you have any examples of how a _dls_ query should be written via the Roles API . I can’t find any documentation with examples. This post states it should be supported [Redirecting to Google Groups](https://groups.google.com/forum/#!topic/search-guard/KLGE1vxdAxQ)

If I save down the following example the query is ignored:

{“indices”:{“_“:{”_”:[“SEARCH”],“_dls_”:“‘{"bool":{"filter":[{"type":{"value":"countries"}}]}}’”}}}

This is how it is stored when I query via sg\_admin.

_dls_: “‘{"bool":{"filter":[{"type":{"value":"countries"}}]}}’”

I can also use sg\_admin to reload the role so that the start / end quotes and the escaping backslashes are removed. This works:

_dls_: ‘{“bool” : {“filter”: {“type” : { “value” : “countries”}}}}’

but I can’t save it down like that via the REST API.

How should I proceed ?

Thanks

---

<div class="post-metadata">

### Author: ![Terry\_Quigley](https://avatars.discourse-cdn.com/v4/letter/t/43a26b/32.png) [@Terry\_Quigley](https://forum.search-guard.com/u/Terry_Quigley)
#### Post date: [September 1, 2017, 1:38pm UTC](https://forum.search-guard.com/t/rest-management-api-cannot-get-it-to-work-with-dls/589/2 "2017-09-01T13:38:20Z")

</div>

After wrestling with this for a day I solved it within minutes of posting this question :

The answer was not to use single quotes anywhere when saving the _dls_ field down via the REST API.

It would be good if this were documented somewhere though.

Thanks

> **···**
>
> On Friday, September 1, 2017 at 1:55:00 PM UTC+1, Terry Quigley wrote:
> 
> > Hi
> 
> > Do you have any examples of how a _dls_ query should be written via the Roles API . I can’t find any documentation with examples. This post states it should be supported [https://groups.google.com/forum/#!topic/search-guard/KLGE1vxdAxQ](https://groups.google.com/forum/#!topic/search-guard/KLGE1vxdAxQ)
> 
> > 
> 
> > If I save down the following example the query is ignored:
> 
> > 
> 
> > {“indices”:{“_“:{”_”:[“SEARCH”],“_dls_”:“‘{"bool":{"filter":[{"type":{"value":"countries"}}]}}’”}}}
> 
> > 
> 
> > This is how it is stored when I query via sg\_admin.
> 
> > 
> 
> > _dls_: “‘{"bool":{"filter":[{"type":{"value":"countries"}}]}}’”
> 
> > 
> 
> > I can also use sg\_admin to reload the role so that the start / end quotes and the escaping backslashes are removed. This works:
> 
> > 
> 
> > _dls_: ‘{“bool” : {“filter”: {“type” : { “value” : “countries”}}}}’
> 
> > 
> 
> > but I can’t save it down like that via the REST API.
> 
> > 
> 
> > How should I proceed ?
> 
> > 
> 
> > Thanks
> 
> >

---

<div class="post-metadata">

### Author: ![searchguard\_google\_group](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.search-guard.com/searchguard_google_group/32/462_2.png) [@searchguard\_google\_group](https://forum.search-guard.com/u/searchguard_google_group)
#### Post date: [September 1, 2017, 7:31pm UTC](https://forum.search-guard.com/t/rest-management-api-cannot-get-it-to-work-with-dls/589/3 "2017-09-01T19:31:56Z")

</div>

thx for letting us know. we will update the docs accordingly

> **···**
>
> > Am 01.09.2017 um 15:38 schrieb Terry Quigley \<topquigley@gmail.com\>:
> > 
> > After wrestling with this for a day I solved it within minutes of posting this question :
> > 
> > The answer was not to use single quotes anywhere when saving the \_dls\_ field down via the REST API.
> > 
> > It would be good if this were documented somewhere though.
> > 
> > Thanks
> > 
> > On Friday, September 1, 2017 at 1:55:00 PM UTC+1, Terry Quigley wrote:  
> > Hi
> > 
> > Do you have any examples of how a \_dls\_ query should be written via the Roles API . I can't find any documentation with examples. This post states it should be supported [Redirecting to Google Groups](https://groups.google.com/forum/#!topic/search-guard/KLGE1vxdAxQ)
> > 
> > If I save down the following example the query is ignored:
> > 
> > {"indices":{"\*":{"\*":["SEARCH"],"\_dls\_":"'{\"bool\":{\"filter\":[{\"type\":{\"value\":\"countries\"}}]}}'"}}}
> > 
> > This is how it is stored when I query via sg\_admin.
> > 
> > \_dls\_: "'{\"bool\":{\"filter\":[{\"type\":{\"value\":\"countries\"}}]}}'"
> > 
> > I can also use sg\_admin to reload the role so that the start / end quotes and the escaping backslashes are removed. This works:
> > 
> > \_dls\_: '{"bool" : {"filter": {"type" : { "value" : "countries"}}}}'
> > 
> > but I can't save it down like that via the REST API.
> > 
> > How should I proceed ?
> > 
> > Thanks
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Search Guard Community Forum" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to search-guard+unsubscribe@googlegroups.com.  
> > To post to this group, send email to search-guard@googlegroups.com.  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/search-guard/f1a374d8-971b-414b-b34b-e5f614c81cd1%40googlegroups.com\](https://groups.google.com/d/msgid/search-guard/f1a374d8-971b-414b-b34b-e5f614c81cd1%40googlegroups.com%5C).  
> > For more options, visit [https://groups.google.com/d/optout\](https://groups.google.com/d/optout%5C).
