agilecrm / php-api

PHP Client to Access Agile Functionality
25 stars 33 forks source link

Set owner on contact creation? #6

Open ahansson89 opened 8 years ago

ahansson89 commented 8 years ago

Is it possible to define the owner when creating a contact?

graut commented 8 years ago

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("kol@gmail.com"), // 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

adsherpa commented 5 years ago

@graut How about changing owner of company? Is this possible and if so what is the call structure?

rammohan-agile commented 5 years ago

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

adsherpa commented 5 years ago

Thank you @rammohan-agile Looks like that works for company. How do we do the same for Deal owner change?

Thank you,

rammohan-agile commented 5 years ago

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

rammohan-agile commented 5 years ago

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.

adsherpa commented 5 years ago

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

rammohan-agile commented 5 years ago

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.

adsherpa commented 5 years ago

hi @rammohan-agile thank you for your prompt reply. Here is my scenario