Using lead ids for a custom activity

LeaCharnley
Level 2

Using lead ids for a custom activity

How does the back end code for a custom activity gain a lead id for an existing lead record in Marketo? My dev and I have scoured loads of documentation, but all the examples we've seen only show a lead id hard-coded in. How can the API retrieve this information?

Thanks

Lea Charnley
1 REPLY 1
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Using lead ids for a custom activity

I'm assuming you're talking about the Add Custom Activities endpoint. FYR, custom activities are created using Add/Create Activities POST API call -- this API endpoint use the leadid as the primary arrtibute to associate the CA records to the know people in the Marketo database. Activities are always related back to the lead record via the leadId, corresponding to the Id field of the record. You either need to hard code it or GET using the leads API endpoint first and then use it in the add activities POST endpoint