AnsweredAssumed Answered

Rest API - Find with '#' Character

Question asked by JeffHenry on Apr 11, 2018
Latest reply on Apr 11, 2018 by JeffHenry



I've been using the REST API successfully to perform finds by a text field and noticed recently that if the find criteria contains a '#', it will result in a 401 error. I've realized that this character is an operator in FileMaker, so using it in a normal find request through FileMaker returns 1 or many results.


Documentation noting # being used to find integers within a string: Finding text and characters


I'm making the requests from another FileMaker Solution, so I'm using Insert From URL to make the request. Here is some of the code:


$URL = "https:/[server]/fmi/rest/api/find/[file]/[layout]

$POST_DATA = "{\"query\": [{\"Field\":\"==test#\"}]}"


     "-X POST \\" & ¶ &

     "-H \"Content-Type: application/json\" \\" & ¶ &

     "-H \"FM-Data-token:[TOKEN]\" \\" & ¶ &

     "-d @$POST_DATA"


If I make this call as shown, it returns a 401 Record Not Found error. If I make the call with "test\#" to escape the '#' symbol, it works in FileMaker, but returns Error Code 10 - Requested Data is Missing. It doesn't like the escape character in the Post Data.


I have the field set to Unicode.


Any ideas how to make this work?