- Posts: 66
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
API and CURL
- baxterdmutt
- Topic Author
- Offline
- Senior Member
Less
More
5 months 2 weeks ago #251894
by baxterdmutt
API and CURL was created by baxterdmutt
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.2.9
Own server
==================
I need to generate a token using the API and
I followed the how to from here and it works great:
forums.limesurvey.org/forum/can-i-do-thi...s-to-a-survey#149782
But I need to generate the token from a different domain(albeit the same server) and I can’t get this to work.
I’m definitely not a developer so that’s why I need help. My understanding is that if I’m effectively on a different domain, I would need to use CURL. I looked at samples but just got confused. Can someone help me please. Or should this work as it is described in the above post and I’m just doing something wrong.
Thanks
Your LimeSurvey version: 6.2.9
Own server
==================
I need to generate a token using the API and
I followed the how to from here and it works great:
forums.limesurvey.org/forum/can-i-do-thi...s-to-a-survey#149782
But I need to generate the token from a different domain(albeit the same server) and I can’t get this to work.
I’m definitely not a developer so that’s why I need help. My understanding is that if I’m effectively on a different domain, I would need to use CURL. I looked at samples but just got confused. Can someone help me please. Or should this work as it is described in the above post and I’m just doing something wrong.
Thanks
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 months 2 weeks ago #251898
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 API and CURL
It's not on LimeSurvey server, it's on the second server.
If it's a debian: apt install php-curl must do the trick (and check if server web access are not disable).
Need more information on the secondary server.
If it's a debian: apt install php-curl must do the trick (and check if server web access are not disable).
Need more information on the secondary server.
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.
Please Log in to join the conversation.
- baxterdmutt
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 66
- Thank you received: 3
5 months 2 weeks ago #251959
by baxterdmutt
Replied by baxterdmutt on topic API and CURL
I know how to install curl. What I don’t know is how can I do the “require_once” for the api client file when it’s on a remote server. What I thought I would need is curl to call the api if Limesurvey is on a different server. I don’t know how to do that.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 months 2 weeks ago #251961
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic API and CURL
Have you tried copying the jsonRPCClient.php and jsonRPCServer.php files to the same directory as your PHP file on your remote server?
This works for me with a simple direct call for the file.
This works for me with a simple direct call for the file.
Code:
require_once 'jsonRPCClient.php';
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 months 2 weeks ago #251962
by DenisChenu
See manual.limesurvey.org/RemoteControl_2_API#PHP_Example using composer
It's on the secondary server. It's an example …
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 API and CURL
Where did you see it was on remote server ?I know how to install curl. What I don’t know is how can I do the “require_once” for the api client file when it’s on a remote server. What I thought I would need is curl to call the api if Limesurvey is on a different server. I don’t know how to do that.
See manual.limesurvey.org/RemoteControl_2_API#PHP_Example using composer
It's on the secondary server. It's an example …
Code:
// without composer this line can be used // require_once 'path/to/your/rpcclient/jsonRPCClient.php'; // with composer support just add the autoloader include_once 'vendor/autoload.php';
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.
Please Log in to join the conversation.
- baxterdmutt
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 66
- Thank you received: 3
5 months 2 weeks ago - 5 months 2 weeks ago #251965
by baxterdmutt
Replied by baxterdmutt on topic API and CURL
I think I know what I’m needing to do and it has nothing to do with CURL. At least I think this is right. I just need to put “application/libraries/jsonRPCClient.php”
on the server that I’m calling the API from. and then require it locally.
on the server that I’m calling the API from. and then require it locally.
Last edit: 5 months 2 weeks ago by baxterdmutt.
Please Log in to join the conversation.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
5 months 2 weeks ago #251966
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic API and CURL
Yes, that's exactly what I suggested.I think I know what I’m needing to do and it has nothing to do with CURL. At least I think this is right. I just need to put “application/libraries/jsonRPCClient.php”
on the server that I’m calling the API from. and then require it locally.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Please Log in to join the conversation.
- baxterdmutt
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 66
- Thank you received: 3
5 months 2 weeks ago #251973
by baxterdmutt
Replied by baxterdmutt on topic API and CURL
Yes, This is what I ended up doing. ThanksHave you tried copying the jsonRPCClient.php and jsonRPCServer.php files to the same directory as your PHP file on your remote server?
This works for me with a simple direct call for the file.
Code:require_once 'jsonRPCClient.php';
Please Log in to join the conversation.
- baxterdmutt
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 66
- Thank you received: 3
5 months 2 weeks ago #251981
by baxterdmutt
Replied by baxterdmutt on topic API and CURL
I’d like to apologize for wasting everyone’s time with this one. I feel a bit stupid that I couldn’t figure out to just move jsonRPCClient.php to the server I was calling from. In the immortal words of Homer Simpson…Doh!
It’s working beautifully now. Thanks to everyone.
It’s working beautifully now. Thanks to everyone.
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
5 months 2 weeks ago #251983
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 API and CURL
No one is stupid when they ask for help. Only those who don't ask are.
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 following user(s) said Thank You: baxterdmutt
Please Log in to join the conversation.