AnsweredAssumed Answered

Right syntax API REST - Find

Question asked by philou on Apr 29, 2018
Latest reply on Apr 30, 2018 by philou

Hi everybody,

 

I'am working for a long time now with Filemaker pro, but i am quit new with all feature around API REST, cURL, JSON.

 

I have a hard time to find the right syntax to use with "find"  in a query, to get a result.

 

When I am looking for all records, this one is running very well :

URL Endpoint :

https://192.168.108.14/fmi/rest/api/record/mwh/company?range=5000&sort=[

    {"fieldName": "Company","sortOrder": "ascend"},

    {"fieldName": "Address_TownCity", "sortOrder": "ascend"}]

cURL options :

-X GET --header "Content-Type: application/json" --header "FM-Data-token: 519266fb1dc0a8fe9328d77f781868f831f60c9889d4a3e4899e"

 

But when i am looking to Find records, I cannot get the right syntax to get what I want.

URL Endpoint :

https://192.168.108.14/fmi/rest/api/find/mwh/company?{"query":[{"Company":"=MWH"}],"sort":[{"fieldName":"Company","sortOrder":"ascend"},{"fieldName":"Address_TownCity","sortOrder":"ascend"}]}

cURL options :

-X POST --header "Content/Type: application/json" --header "FM-Data-token: 3def20026b25a54c8d8f40939e488a24a2f9b68d654bd2a98e73"

 

this is the Answer :

? * Line 1, Column 1

  Syntax error: value, object or array expected.

* Line 1, Column 2

  Extra non-whitespace after JSON value.

 

There is probably a little mistake somewhere ?

 

Thanks for your precious help

 

PhiLou

Outcomes