php-api
php-api copied to clipboard
Set owner on contact creation?
Is it possible to define the owner when creating a contact?
Hi @ahansson89,
It is not possible while creating contact.
But you can do at next step after creating contact as per your requirements.
======================code for changing ================
$form_fields = array( 'owner_email' => urlencode("[email protected]"), // Owner email you want to change 'contact_id' => urlencode("5740243672104960") // Contact id of which you want to change owner ); $fields_string1 = ''; foreach ($form_fields as $key => $value) { $fields_string1 .= $key . '=' . $value . '&'; }
$updatedContact = curl_wrap("contacts/change-owner", rtrim($fields_string1, '&'), "POST", "application/x-www-form-urlencoded");
echo $updatedContact;
=======================code end==================
for more details : https://github.com/agilecrm/rest-api#118-change-contact-owner
Please contact Agile CRM if need any further help. Thanks
@graut How about changing owner of company? Is this possible and if so what is the call structure?
Hi @adsherpa in Postman you can try like Below select Basic Auth give user name and Password {domain}.agilecrm.com/dev/api/contacts/change-owner/{new_owner_id}/{company_id}
Request type : PUT
Form data(body) : { "id":{company_id} }
for more details : https://github.com/agilecrm/rest-api#118-change-contact-owner
Hope This Help You, Please contact Agile CRM if need any further help. Thanks
Thank you @rammohan-agile Looks like that works for company. How do we do the same for Deal owner change?
Thank you,
Hi @adsherpa for Deal Owner Chnage , in Postman you can try like Below select Basic Auth give user name and Password
https://{domain}.agilecrm.com/dev/api/opportunity/change-owner/{new_owner_id}/{deal_id}
Request type : PUT
Form data(body) : { "id":{deal_id} }
for more details : https://github.com/agilecrm/rest-api#31-listing-deals
Hope This Help You, Please contact Agile CRM if need any further help. Thanks
hi @adsherpa and @ahansson89 Hope above solutions will solve your issues , please let me know if You people have Query's .
Thanks
Agile Support Team.
Hi @rammohan-agile Thank you very much for those replies with the solution. Yes, they are helpful. I do have questions regarding merging company and contacts. Should I create new issue or can you reopen this? Let me know, I think new issue maybe appropriate since it is different action. Thank you
Hi @aDaneInSpain Can you give us clarity of your Question so we can give better solution, let us know what you are expecting ? . for example if you expecting add existing company to a new contact please follow below url https://github.com/agilecrm/php-api/issues/12
Thanks Agile Support Team.
hi @rammohan-agile thank you for your prompt reply. Here is my scenario
- In our system we have say 3 company and each has users under them. All three are also in agilecrm as three separate company and users under each of them as contacts that matches our internal system.
- Now they want to merge all 3 company under one (first one). And move all users under one company.
- We have that feature that allows companies and underlying data such as users and data be merge under one company.
- Now we would like to do the same in agilecrm so we can merge those 3 companies under one (e.g. first company) and move all contacts from other two to this one. I know if agilecrm there is merge duplicate feature through agilecrm portal. I wanted to see if this is available via api as well so I can do the same using api call. Hope this clarifies, let me know.