[SOLVED] CBsubs url post integration

Hello

We have a problem making url integration work with liveagent form qualityunit with the following.

We want to call an API working like this : (see example on API docs

Example of calling POST request

//next example will insert new conversation
$service_url = 'http://example.com/api/conversations';
$curl = curl_init($service_url);
$curl_post_data = array(
        'message' => 'test message',
        'useridentifier' => 'agent@example.com',
        'department' => 'departmentId001',
        'subject' => 'My first conversation',
        'recipient' => 'recipient@example.com',
        'apikey' => 'key001'
);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
$curl_response = curl_exec($curl);
if ($curl_response === false) {
    $info = curl_getinfo($curl);
    curl_close($curl);
    die('error occured during curl exec. Additioanl info: ' . var_export($info));
}
curl_close($curl);
$decoded = json_decode($curl_response);
if (isset($decoded->response->status) && $decoded->response->status == 'ERROR') {
    die('error occured: ' . $decoded->response->errormessage);
}
echo 'response ok!';
var_export($decoded->response);

and we have set up the integration as post like this :
https://ourwebsite.com/support/api/index.php?handler=conversations
message=[PLAN_NAME]
useridentifier=email@ourwebsite.com
subject=oursubject
department=Department001
recipient=[EMAIL]
do_not_send_mail=Y
apikey=xxxxxxx

However this does not work with CBsubs.

Is this integration compatible with the above suggested post code ?
Do we have to set fields between quotes or something else ?

Thanks for helping

According to their documentation your POST URL isn't correct. It should be in the below format.

http://example.com/api/conversations

The URL integration just makes HTTP calls so it should be working fine. Maybe test your usage with CB Auto Actions and its Request action on the after login trigger then enable its debugging parameter so it can output the results of the HTTP request to let you know what part failed.



Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Yes this is the correct URL but without mod rewrite, using index.php

I'll test with auto action to debug

After debugging it seems that url integration does not work with https protocol. All is ok with standard http protocol

I dont know if it comes from CBSubs ? or from LiveAgent ?

Your idea ?

It currently uses our Snoopy library instead of using CURL directly. When using an HTTPS URL it needs to use "exec", which is probably disabled by your host. So you'll need to use HTTP or enable usage of exec for now.



Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM EST to 4:00 PM EST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

http will do it for now :-)

Thanks for helping

Time to create page: 0.260 seconds
Facebook Twitter Google LinkedIn