Updating Fields create/update leads endpoint

Anonymous
Not applicable

Updating Fields create/update leads endpoint

Hi,

I am able to access the create/update fields endpoint.  However, there are certain fields that I am unable to update.  

For example in marketoI have a field called "Phone", but the lead does not update.  Other fields do update, so it is working.  Below is a snippet of my code:

$add_lead_url = "https://***.mktorest.com/rest/v1/leads.json?access_token=". $this->mk_access_token;
 
 
echo $add_lead_url;
$email = $entry[11];
$firstName = $entry[1];
$lastName = $entry[2];
$company = $entry[3];
$phone = $entry[10];
 
 
$data = array( 
  'action' => 'createOrUpdate', 
  'lookupField' => 'email', 
  'input' => array(array(
    'email' => $email, 
    'firstName' => $firstName, 
    'lastName' => $lastName, 
    'company' => $company, 
  'phone' => $phone
  )
)
);
 
$options = array(
'http' => array(
    'method'  => 'POST',
    'content' => json_encode($data),
    'header'=> "Content-Type: application/json\r\n" .
          "Accept: application/json\r\n"
),
);
 
$context  = stream_context_create($options);
$result = file_get_contents($add_lead_url, false, $context); 


Thanks,

 

Dan

Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: Updating Fields create/update leads endpoint

This might be a formatting issue.  I woud try these variations:

'123-456-7890'
'1234567890'

Kenny_Elkington
Marketo Employee

Re: Updating Fields create/update leads endpoint

In addition to what Murtza suggested, you may want to check field management to see that the field is not blocked from updates.