Hi all,
after hours of work without success trying to understand what is happening on my environment I decide to ask for some help here. I appreciate if someone could at least point me for some direction.
I had the
Lime Survey Version 2.50+ Build 160606 hosted on a
Shared Server and I´m facing an issue using the REMOTE CONTROL 2 API.
When I sent a
json post request with the
export_responses method as follow:
Code:
{
"method":"export_responses",
"id":1,
"params":[
"wxvn7wmpmwymn8z9tw6pruz85jf8ytdh",
"988452",
"json",
"pt-BR",
"complete",
"code",
"short",
"3048",
"3048"
]
}
As response I have a json message with
wrong empty result as follow:
Code:
{
"id":1,
"result":"",
"error":null
}
The response header of the previous POST request is:
Code:
Status Code: 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: Keep-Alive
Content-Encoding: gzip
Content-Type: text/javascript
Date: Thu, 12 Jan 2017 01:46:00 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=5, max=500
Pragma: no-cache
Server: Apache
Transfer-Encoding: chunked
Vary: Accept-Encoding
The result should not be empty because the the json message is correct and the response id exists. I tried another type of message to see the result, now using the
list_group method:
Code:
{
"method":"list_groups",
"params":[
"gdv64ra8i6iu2knzvdknhaar3yi2zeiq",
"988452"
],
"id":1
}
So I had a
correct response:
Code:
{
"method":"list_groups",
"params":[
"gdv64ra8i6iu2knzvdknhaar3yi2zeiq",
"988452"
],
"id":1
}{
"id":1,
"result":[
{
"id":{
"gid":"22",
"language":"pt-BR"
},
"gid":"22",
"sid":"988452",
"group_name":"Informa\u00e7\u00f5es para contato",
"group_order":"0",
"description":"info",
"language":"pt-BR",
"randomization_group":"",
"grelevance":""
}
],
"error":null
}
The response header of the previous POST request is:
Code:
Status Code: 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: Keep-Alive
Content-Encoding: gzip
Content-Type: text/javascript
Date: Thu, 12 Jan 2017 10:51:26 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=5, max=500
Pragma: no-cache
Server: Apache
Transfer-Encoding: chunked
Vary: Accept-Encoding
This show me that RC2 API is working on my Hosted Lime Survey for the
list_group but not for the
export_response. On the server side I did no found any error.
[hr]
In order to investigate the issue I backup my remote Lime Survey installation and I installed on my local machine on an
AMP Stack called
WAMP Server which integrates the APACHE,MYSQL and PHP on Windows.
In the local installation, when I send the same json POST REQUEST:
Code:
{
"method":"export_responses",
"id":1,
"params":[
"vnnje8v8vtqk542ijkjkcwbvh9zc4wrf",
"988452",
"json",
"pt-BR",
"complete",
"code",
"short",
"3048",
"3048"
]
}
To my surprise it worked correctly and I had the following result as return:
Code:
{
"id":1,
"result":"eyJyZXNwb25zZXMiOiBbeyIzMDQ4Ijp7ImlkIjoiMzA0OCIsI...(I cut the text here)",
"error":null
}
The response header for the previous POST REQUEST is:
Code:
Status Code: 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: Keep-Alive
Content-Length: 1187
Content-Type: text/javascript
Date: Thu, 12 Jan 2017 01:34:25 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=5, max=100
Pragma: no-cache
Server: Apache/2.4.9 (Win32) PHP/5.5.12
x-powered-by: PHP/5.5.12
With this behavior looks that there is something wrong on my
Shared Sever where the Lime survey is installed, something that makes the JSON POST REQUEST return an empty result. However I had no clue about what could be wrong, should be something on PHP ? on Apache ? Mysql maybe ? I did not find any error on php logs.
I attached here in this post the PHP Info page of both server.
I appreciate any help.
Thank you.