Answer the question
In order to leave comments, you need to log in
How to find field IDs in custom_fields in amocrm?
I add a deal to UNPARSED from the form, and in the contact of the deal I need to specify the phone, but in all the examples that I found, the field ID is indicated, but how can I find out this ID?
I also need to specify the order address, email and order details (product/material, quantity).
Here's my code:
// Create a new ticket in the unparsed when added from a web form
$incomingLead = new AmoIncomingLeadForm();
// Set required parameters
$incomingLead->setIncomingLeadInfo([
'form_id' => 1,
'form_page' => ' https://site.com ',
'form_name' => 'Test ticket'
]);
// Adding deal parameters
$lead = new AmoLead([
'name' => 'New order from the site'
]);
$lead->setCustomFields([ 25475362 => '#1543252' ]);
$incomingLead->addIncomingLead($lead);
// Add contact parameters
$contact = new AmoContact([
'name' => 'Hans-Dietrich Genscher'
]);
$contact->setCustomFields([
255114 => ,
'value' => '[email protected]',
'enum' => 'WORK'
]]
]);
$incomingLead->addIncomingContact($contact);
// Add company parameters
$incomingLead->addIncomingCompany([
'name' => 'Freie Demokratische Partei'
]);
// Save the ticket
$incomingLead->save();
A deal is created in the unparsed, but the phone and email are naturally not saved, because. id is invalid. How can I find out these id?
PS And is it possible to do without adding a company in my case? You only need to save contact information and order details.
Answer the question
In order to leave comments, you need to log in
Thanks for your input, but I figured it out myself.
All the necessary IDs can be found by requesting account information indicating with.
I have so:
print_r(AmoAPI::getAccount($with = 'custom_fields'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question