| 
Welcome, Guest

TOPIC: [SOLVED] CBsubs url post integration

[SOLVED] CBsubs url post integration 11 months 4 weeks ago #234056

  • activha
  • activha
  • OFFLINE
  • Platinum Boarder
    Platinum Boarder
  • Posts: 402
  • Karma: -
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
Last Edit: 11 months 3 weeks ago by krileon.
The administrator has disabled public write access.

CBsubs url post integration 11 months 4 weeks ago #234079

  • krileon
  • krileon
  • OFFLINE
  • Administrator
    Administrator
  • Posts: 37660
  • Karma: 1079
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 Tutorials + Search the forums
CB links: Documentation - Tutorials - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Advanced, Professional, Developer, or CBSubs 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 Advanced, 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.
--
If you use Community Builder, please post a rating and a review at the Joomla! Extensions Directory.
The administrator has disabled public write access.

CBsubs url post integration 11 months 4 weeks ago #234085

  • activha
  • activha
  • OFFLINE
  • Platinum Boarder
    Platinum Boarder
  • Posts: 402
  • Karma: -
Yes this is the correct URL but without mod rewrite, using index.php

I'll test with auto action to debug
The administrator has disabled public write access.

CBsubs url post integration 11 months 3 weeks ago #234281

  • activha
  • activha
  • OFFLINE
  • Platinum Boarder
    Platinum Boarder
  • Posts: 402
  • Karma: -
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 ?
The administrator has disabled public write access.

CBsubs url post integration 11 months 3 weeks ago #234287

  • krileon
  • krileon
  • OFFLINE
  • Administrator
    Administrator
  • Posts: 37660
  • Karma: 1079
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 Tutorials + Search the forums
CB links: Documentation - Tutorials - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
If you are a Advanced, Professional, Developer, or CBSubs 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 Advanced, 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.
--
If you use Community Builder, please post a rating and a review at the Joomla! Extensions Directory.
The administrator has disabled public write access.

CBsubs url post integration 11 months 3 weeks ago #234289

  • activha
  • activha
  • OFFLINE
  • Platinum Boarder
    Platinum Boarder
  • Posts: 402
  • Karma: -
http will do it for now :-)

Thanks for helping
The administrator has disabled public write access.
Time to create page: 0.296 seconds