I have been trying to set up a search in the https://explorer.natureserve.org/api-docs/ API, however, I keep getting the following error:
"JSON parse error: Cannot deserialize value of type `java.lang.Integer` from Object value (token `JsonToken.START_OBJECT`); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.lang.Integer` from Object value (token `JsonToken.START_OBJECT`)"
I am not sure where the issue is, as I have very similar code in Python, but the search works fine there.
Here is my code:
search_text = '{
"criteriaType" : "species",
"textCriteria" : [{"paramType" : "textSearch", "searchToken" : "Acanthomintha ilicifolia", "matchAgainst" : "allScientificNames", "operator" : "similarTo"}],
"statusCriteria" : [ ],
"locationCriteria" : [ ],
"pagingOptions" : {"page" : null, "recordsPerPage" : null},
"recordSubtypeCriteria" : [ ],
"modifiedSince" : null,
"locationOptions" : null,
"classificationOptions" : null,
"speciesTaxonomyCriteria" : [ ]}'
search_json = fromJSON(search_text)
searchResults = POST("https://explorer.natureserve.org/api/data/speciesSearch", body=search_json, encode="json")
contentACIL_raw = content(searchResults)