- Posts: 9
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
I'm stuck with the API (remotecontrol) of LimeSurvey
- DidierH
- Topic Author
- Offline
- New Member
Less
More
3 years 5 months ago #207004
by DidierH
I'm stuck with the API (remotecontrol) of LimeSurvey was created by DidierH
I am trying to develop a scenario on Integromat.com to call the API ("RemoteControl") of LimeSurvey to dynamically add participants to a survey.
I tested the call to the "get_session_key" function.
URL: survey.mydomain.com/index.php/admin/remotecontrol
HTTP method: POST
Header:
Content-Type: application/json
Accept: application/json
Accept-Charset: utf-8
Body:
{"method": "get_session_key", "params": {"username": "my_user_name", "password": "my_password","plugin":"Authdb"}}
Username and password are correct. I always get a "null" response.
Can someone tell me where I am wrong?
I tested the call to the "get_session_key" function.
URL: survey.mydomain.com/index.php/admin/remotecontrol
HTTP method: POST
Header:
Content-Type: application/json
Accept: application/json
Accept-Charset: utf-8
Body:
{"method": "get_session_key", "params": {"username": "my_user_name", "password": "my_password","plugin":"Authdb"}}
Username and password are correct. I always get a "null" response.
Can someone tell me where I am wrong?
The topic has been locked.
- DidierH
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
3 years 5 months ago #207051
by DidierH
Replied by DidierH on topic I'm stuck with the API (remotecontrol) of LimeSurvey
This is the answer I receive when I try with Advanced Rest Client (Chrome extension) :
{"id":null,"result":null,"error":"unable to decode malformed json"}
{"id":null,"result":null,"error":"unable to decode malformed json"}
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 5 months ago #207060
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic I'm stuck with the API (remotecontrol) of LimeSurvey
I think there are a HTML error here maybe have a look to server log ?
(we must imporove error log with remote_control, really difficult).
(we must imporove error log with remote_control, really difficult).
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- DidierH
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
3 years 5 months ago #207087
by DidierH
Replied by DidierH on topic I'm stuck with the API (remotecontrol) of LimeSurvey
Hi !
I had a look at log files. Nothing found. And http response is "200".
I had a look at log files. Nothing found. And http response is "200".
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 5 months ago #207111
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic I'm stuck with the API (remotecontrol) of LimeSurvey
Silly question surely : remote control is activated ?
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- DidierH
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
3 years 5 months ago #207118
by DidierH
Yes...Remotecontrol is enabled.
Activated RPC Interface : JSON-RPC
Publish API in /admin/remotecontrol : YES
Devine Access-Control_allow_origin header : NO
(no difference if yes, obviously)
Are there some specific php modules that should be activated too ? Something else I have to think about ?
Replied by DidierH on topic I'm stuck with the API (remotecontrol) of LimeSurvey
Yes...Remotecontrol is enabled.
Activated RPC Interface : JSON-RPC
Publish API in /admin/remotecontrol : YES
Devine Access-Control_allow_origin header : NO
(no difference if yes, obviously)
Are there some specific php modules that should be activated too ? Something else I have to think about ?
The topic has been locked.
- DidierH
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
3 years 5 months ago #207136
by DidierH
Replied by DidierH on topic I'm stuck with the API (remotecontrol) of LimeSurvey
I finally found the error. Stupid me : I just had to scrupulously respect JSON-RPC.
Instead of this :
{"method": "get_session_key", "params": {"username": "my_user_name", "password": "my_password","plugin":"Authdb"}}
I had to write :
{"method": "get_session_key", "params": ["my_user_name","my_password","Authdb"],"id":1}
And it works...
Thank you for your help.
Instead of this :
{"method": "get_session_key", "params": {"username": "my_user_name", "password": "my_password","plugin":"Authdb"}}
I had to write :
{"method": "get_session_key", "params": ["my_user_name","my_password","Authdb"],"id":1}
And it works...
Thank you for your help.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
3 years 5 months ago #207145
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic I'm stuck with the API (remotecontrol) of LimeSurvey
Thanks ,
Yes, josn api 1 : forums.limesurvey.org/forum/french-forum...tion-de-l-api#207010
You just need to add the id and fix the array ?
Can you try with
{"method": "get_session_key", "params": ["username": "my_user_name", "password": "my_password","plugin":"Authdb"],"id":1}
?
If you fopund time to add some elements on manual.limesurvey.org/RemoteControl_2_API#Example_and_helper it can be really great :)
Yes, josn api 1 : forums.limesurvey.org/forum/french-forum...tion-de-l-api#207010
You just need to add the id and fix the array ?
Can you try with
{"method": "get_session_key", "params": ["username": "my_user_name", "password": "my_password","plugin":"Authdb"],"id":1}
?
If you fopund time to add some elements on manual.limesurvey.org/RemoteControl_2_API#Example_and_helper it can be really great :)
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.