0

I'm trying to adapt https://github.com/Marketo/REST-Sample-Code/blob/master/php/LeadDatabase/Leads/SyncLeads.php for my own needs. I want to be able to update a lead's status from "Registered" to "Attended" using the REST API. (The Marketo Events app does this when someone is checked into an event.)

However, when I try sending something like:

{"input":[{"email":"asdfasdf@qwerqwer.org",
           "membership":{"progressionStatus":"Attended"}}]}

I get back:

{"requestId":"168be#15868ee5bff",
 "result":[{"status":"skipped","reasons":[
     {"code":"1006","message":"Field 'membership' not found"}]}],
 "success":true}

I understand the message just fine -- 'membership' isn't a field, therefore it can't be updated this way. But is there another way to update the progressionStatus using the API?

Blazemonger
  • 90,923
  • 26
  • 142
  • 180

2 Answers2

1

You need to be looking at that lead's membership of the program - see this method for more information: http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/changeLeadProgramStatusUsingPOST

michaelroper
  • 293
  • 1
  • 6
  • The documentation appears to be incomplete -- see `changeLeadProgramStatusRequest`? There's no guidance for what `LeadLookupInputData` should look like. – Blazemonger Nov 16 '16 at 16:51
1

Try to use this format:

{
    'status': 'Member',
    'input': [
        {'id': 23},
        {'id': 445}
    ]
}

You have to use the Marketo Lead ID (not email) and you can only specify 1 status value per API call. Max batch size is 300 Lead IDs.

Jep
  • 384
  • 3
  • 7