Skip to main content
July 25, 2014
Question

Updating Fields create/update leads endpoint

  • July 25, 2014
  • 2 replies
  • 787 views
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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

July 25, 2014
This might be a formatting issue.  I woud try these variations:

'123-456-7890'
'1234567890'

Kenny_Elkington
Adobe Employee
Adobe Employee
July 25, 2014
In addition to what Murtza suggested, you may want to check field management to see that the field is not blocked from updates.