Re: Problems using report webservice
Hi,
I'm trying to use the report webservice and I'm facing problems:
Working:
Calling "occurrences_by_website.xml" via http-get request.
Not Working:
Calling "occurrences_by_website.xml" via http-post request.
Parameters: report = "occurrences_by_website.xml", reportSource = "local", mode="json", auth_token = "xxx" nonce="yyy"
Response: {"error":"Undefined index: content","file":"\/opt\/pkgsrc-gcc\/share\/httpd\/htdocs\/indicia\/modules\/indicia_svc_data\/controllers\/services\/report.php","line":153,"trace":[]}
Calling "map_occurrences_for_survey.xml" via http-get or http-post request.
Parameters: report = "map_occurrences_for_survey.xml", reportSource = "local", mode="json", auth_token = "xxx", nonce = "yyy", params="{"survey":2,"searchArea":"POINT(222638.981586547 334111.17140196)"}"
Response-post:
{"error":"Undefined index: content","file":"\/opt\/pkgsrc-gcc\/share\/httpd\/htdocs\/indicia\/modules\/indicia_svc_data\/controllers\/services\/report.php","line":153,"trace":[]}
Response-get:
{"parameterRequest":{"survey":{"datatype":"lookup","allow_buffer":null,"emptyvalue":"0","display":"Survey","description":"Select the survey to return data for","query":"SELECT id, title as caption FROM surveys","lookup_values":null,"population_call":"direct:survey:id:title"},"searchArea":{"datatype":"geometry","allow_buffer":"true","emptyvalue":null,"display":"Report Search Area","description":null,"query":null,"lookup_values":null,"population_call":null}},"uid":"aa3b0c52a5b8a285b3c0d269e330ada9"}
As I could read from the wiki, I should use post and I can provide parameter with the first call, so that i don't have to use resumeReport, which is also not working for me:
http-get: index.php/services/report/resumeReport?params=%7B%22survey%22%3A2%2C%22searchArea%22%3A%22POINT%28222638.981586547+334111.17140196%29%22%7D&uid=aa3b0c52a5b8a285b3c0d269e330ada9&nonce=1b6972c0e1f487298bdaa44f424c5ac8808294c3&auth_token=a7e4157ebed2b5af7392d82340fc1b8b0009db37
response: {"error":"Trying to resume a report but one or more of params or uid is null","uid":null,"params":[]}
Regards
Daniel