4

Is it possible to structure

/sites/all/modules/civicrm/extern/rest.php?entity=Activity&action=create&json={"sequential":1,"activity_date_time":"2015-09-01","id":2,"subject":"test","target_id":"1529697","status_id":2}&api_key=X&key=Y

without the JSON section? I'm integrating with Survey Gizmo and it assumes all REST calls will be in format ?variable=value&variable=value etc..

5

Yes, you do not need the params to be formatted as json, since they are all simple strings/numbers you can just place them in the url like subject=test&target_id=1529697 etc.

If you want your results back in json format, add &json=1 otherwise leave it off to get xml back.

  • 1
    Thanks Coleman, eventually got there. Notes for any future googlers looking for "http connect" in Survey Gizmo and CiviCRM. I'll write a blog post at some point. Don't put the key=value that you're taking from the question in the URL field, remove completely and put in "fields to pass". Don't use the JSON section provided by the API explorer. Switch it all to &key=value (unless you're using an array? in which case good luck) Enjoy advanced surveys. – Owen B Aug 26 '15 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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