TOPIC:

Post data to Dolibarr CRM 1 week 2 days ago #261619

  • Topic Author
  • unratgeber
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 12
  • Thanks: 0
I Mirko,

thank you very much! I just have written you an email.

cu after my holiday.

Kind regards

Please Log in or Create an account to join the conversation.

Post data to Dolibarr CRM 1 week 2 days ago #261620

  • Mirec's Avatar
  • Mirec
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 454
  • Karma: 2
  • Thanks: 19
Hi,

ok, super! :)

Regards,
Mirko

Please Log in or Create an account to join the conversation.

Post data to Dolibarr CRM 4 days 16 hours ago #261716

  • Mirec's Avatar
  • Mirec
  • Offline
  • Gold Breezer
  • Gold Breezer
  • Posts: 454
  • Karma: 2
  • Thanks: 19
Hi,

I have good news for you I solved all issues with API call now you can send the data that you want in your Dolibarr CRM.

In the attached file, I sent you an example that works.
Please download->unzip->and install it (BF->Configuration->Package Installer->select this xml file->Install Package).

Here is an explanation below :

In your Form GO->Advenced ->More Option-> Submit Pieces ->End Submit select type 'Custom' and below in code box inser code:
$this->execPieceByName('ff_InitLib');

$httpheader = ['DOLAPIKEY: XXX'];
$url = "API URL";

$data = array('name' => ff_getSubmit('name'));

//$data = array('name' => ff_getSubmit('name'), 'name_alias' => ff_getSubmit('name_alias'));  //example how send more then one value 

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_HTTPHEADER, $httpheader);

$result = curl_exec($curl);
curl_close($curl);

// for debugging remove the comments
//print_r  ($result);

//exit;



Explanation of code:

in this part of code
$httpheader = ['DOLAPIKEY: xxx'];
$url = "API URL";
you should insert key and API URL.

in this part of code:
'name' => ff_getSubmit('name');
instead ('name') insert the name of your element whose value you want to send to API.
If you want to send more fields, repeat action.

I asked the API to send me the received values ​​:

{ "entity": "1", "name": "mirkotest22", "name_alias": "", "address": "", "zip": null, "town": null, "status": "1", "state_id": "0", "state_code": null, "state": null, "phone": null, "fax": null, "email": null, "socialnetworks": [], "url": null, "barcode": null, "idprof1": "", "idprof2": ""...................................................................................} ]


and this is the last record send to API, as you see, here is the variable 'name' where I sent value ' "mirkotest22",'.
It works well.

I embedded my example names 'API Call' on your TEST server that you shared with me and allowed me access. You can test.

When you back from holiday, please test and let me know the result! :)
If you have more questions, feel free to ask!
Regards,
Mirko
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: Post by Mirec.
Moderators: ForumSupport
Time to create page: 0.049 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!