Re: Has anyone successfully pushed membership details into Marketo with the "Push Lead" endpoint (REST API)?

Demand_Gen5
Level 1

Has anyone successfully pushed membership details into Marketo with the "Push Lead" endpoint (REST API)?

We're performing an instance-to-instance migration and at the point where we're migrating Program Membership details.  However, the Push Lead endpoint is not accepting the membership details.  If I remove the membership details, the lead is added to the Program just fine, but the required details are not represented in Marketo of course.

Per the API documentation(https://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads... ), the details I want in Marketo are to be provided under a "membership" key/section of the input.  However, when I provide this info, I receive the following error:

{"status": "skipped", "reasons": [{"code": "1006", "message": "Field 'membership' not found"}]}

These are the input details that are failing (formatted with hard returns for easier reading in this text box):

{'id': 2194844, 
'membership': {'progressionStatus': 'Downloaded', 'isExhausted': False, 'acquiredBy': False,
               'reachedSuccess': True, 'membershipDate': '2017-08-02T11:18:48Z'}}

Simplifying the payload to the data below works just fine, but it's a just a partial solution:

{'id': 2194844}

Anyone have any tips or tricks to get the endpoint to recognize the membership data?

Many thanks in advance!

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Has anyone successfully pushed membership details into Marketo with the "Push Lead" endpoint (REST API)?

The Advanced Editor has a syntax highlighter, please use that.

And no, you can't force values like "isExhausted" in this manner. You can set the Program Status.

Demand_Gen5
Level 1

Re: Has anyone successfully pushed membership details into Marketo with the "Push Lead" endpoint (REST API)?

Thanks, Sanford, but the API documentation states otherwise.  

It describes the payload as below and IsExhausted is mentioned as an optional parameter.

PushLeadToMarketoRequest {

input (Array[Lead], optional),
lookupField (string, optional),
partitionName (string, optional),
programName (string, optional),
programStatus (string, optional),
reason (string, optional),
source (string, optional)

}
Lead {

id (integer, optional😞 Unique integer id of a lead record ,
membership (ProgramMembership, optional😞 Membership data for the parent program. Only returned via Get Leads By Program Id ,
reason (Reason, optional😞 Reason object describing why an operation did not succeed for a record ,
status (string, optional😞 Status of the operation performed on the record

}
ProgramMembership {

acquiredBy (boolean, optional😞 Whether the lead was acquired by the parent program ,
isExhausted (booleanoptional😞 Whether the lead is currently exhausted in the stream, if applicable,
membershipDate (string😞 Date the lead first became a member of the program,
nurtureCadence (string, optional😞 Cadence of the parent stream if applicable,
progressionStatus (string😞 Program status of the lead in the parent program,
reachedSuccess (boolean, optional😞 Whether the lead is in a success-status in the parent program,
stream (string, optional😞 Stream that the lead is a member of, if the parent program is an engagement program

}

SanfordWhiteman
Level 10 - Community Moderator

Re: Has anyone successfully pushed membership details into Marketo with the "Push Lead" endpoint (REST API)?

This has to be a doc bug. ProgramMembership and Reason may be defined (sub)schemas, but they don't belong here, nor are they necessarily writable (they could belong in a response model only).

If you take the PushLeadToMarketoRequest model on its own, it doesn't contain the other schemas (even if the example value does).