API3
tom at May 5th, 2016 06:06 — #1
Hi,
I was wondering if there is any sample code regarding how to create an action for a contact using the API in PHP. The samples I have found only show how to create a contact. Any help on this topic would be greatly appreciated.
Thanks!
cillian at May 5th, 2016 11:04 — #2
Hi Tom,
Thanks for getting in touch with your query.
Unfortunately we do not have any examples of how to create using PHP. Now I am no PHP expert, nor have I tested this but I think it may look at little something like this:
// Create Action
echo "Creating action...\n";
$new_action = make_api_call('actions.json', 'POST', array('contact_id' => 'XYZ...', 'date' => 'yyyy-MM-dd', 'text' => 'Next action text here'), $uid, $key);
This should at least get you started!
All the best,
Cillian
tom at May 6th, 2016 04:04 — #3
Hi Cillian,
Thanks for the help it's much appreciated!
Many thanks,
Tom.
tom at May 6th, 2016 04:12 — #4
Hi Cillian,
This seems to be a great starting point but is there a way to get the contact_id automatically without having to type it in manually for each new contact.
Thanks,
Tom.
cillian at May 6th, 2016 07:27 — #5
Hello,
Please check the updated PHP sample:
https://github.com/OnePageCRM/php-sample/
All the best,
Cillian
tom at May 6th, 2016 07:43 — #6
Hi Cillian,
Thanks that solved my problem!
Many thanks,
Niall.
Powered by Discourse, best viewed with JavaScript enabled