peterlu
11 years agoChampion
rest api - search blog by label
Hi Guys,
User case:
A blog has 3 labels set "Apple", "Banana", "Test Space"
Here are the rest calls that works:
/search/messages?q=is_root:true%20AND%20labels:(Apple)&include_blogs=true /search/messages?q=is_root:true%20AND%20labels:(Apple%20OR%20Banana)&include_blogs=true
Here is the rest call that does not work:
/search/messages?q=is_root:true%20AND%20labels:(Test%20Space)&include_blogs=true
Any idea?
What is the format for labels with spaces?
Thanks
I'm not sure exactly why this occurs, but I've worked around similar issues in the past by replacing the space with %3F, which is the encoded form of ?. In the search query, the question mark character represents a single-character wildcard and seems to do the trick.
- I would also try with %22Test%20Space%22 , where %22 is the encoding for " (although I haven't tried that myself so I am not 100% sure)