I am using the Confluence RESTful API to retrieve all pages with a certain label from Confluence (where <my_label> is substituted with the label I am looking for):
/rest/api/content/search?cql=label=<my_label>&limit=500
Now I would like to constrain the search to pages contained in a specific space (<my_space> is the key of the space I am looking for), and I use the following request:
/rest/api/content/search?cql=label=<my_label>%AND%space=<my_space>&limit=500
This works great for space keys composed of only letters, e.g. <my_space> = ABCDE.
However, our private user spaces are composed of a tilde and letters, e.g. <my_space> = ~abcde, in which case I retrieve the REST reply:
{"statusCode":400,"data":{"authorized":false,"valid":true,"errors":[],"successful":false},"message":"Expecting a value for operator '=' after field 'space' but got '~'"}
I've already tried to substitute the tilde by its HTML representation (~ - so <my_space> = ~abcde), but the REST reply remains the same.
Does anyone know how I can restrict the search by label to a certain space with a REST request which works for arbitrary space keys?