4

I'm trying to make an external REST API call to rest.php. I was getting "Unable to decode supplied JSON", but then I figured out I could take the values I was stuffing into json (from the API Explorer) and then make them their own parameters (REST API without JSON just key=value).

I'm trying to request contributions between two dates. In the json style as shown in the API Explorer, it's like this:

&json={"receive_date":{"BETWEEN":["2017-12-01","2017-12-01"]}}

I'm trying this, and it's not working:

&received_date[BETWEEN]=2017-12-01,2017-12-02

Any ideas?

1 Answer 1

6

I just figured it out:

&received_date[BETWEEN][]=2017-12-01&received_date[BETWEEN][]=2017-12-02
2
  • Great, you can mark your answer as best answer.
    – samuelsov
    Commented Dec 22, 2017 at 13:24
  • Your answer helped me generalize this to other OR searches, for instance (using REST format, v3 API) &last_name[]=name1&last_name[]=name2 Thx!
    – cfritze64
    Commented Nov 21, 2020 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.