Hi,
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#\"}]}"
$CURL_OPTIONS =
"-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?
Best,
Jeff
The Data API is supposed to honor the find request exactly like you'd do in FM. If it doesn't then I would thing that could be a bug and worth reporting as an issue.
Did you create your $post_data variable with the native json set element function?