如何通过GetLeadsByProgramID端点获取单个项目中某条线索的状态?
How to Get a Single Lead's Status in a Specific Marketo Program via REST API
Great question! You absolutely can target just one lead's program status instead of pulling all leads in the program. Here are two straightforward methods to do this:
Method 1: Filter the GetLeadsByProgramID Endpoint
You can repurpose the existing GetLeadsByProgramID endpoint by adding filters to narrow down to your target lead, plus specify only the fields you need to keep the response lean.
Request Details:
- HTTP Method: GET
- URL Structure:
/rest/v1/programs/{PROGRAM_ID}/leads.json?access_token={YOUR_ACCESS_TOKEN}&filterType=id&filterValues={LEAD_ID}&fields=programStatus - Key Parameters:
filterType=id: Tells Marketo to filter leads by their unique numeric IDfilterValues={LEAD_ID}: Replace with the ID of the lead you want to checkfields=programStatus: Restricts the response to only return the program status field (avoids pulling unnecessary lead attributes)
Example Response Snippet:
{ "requestId": "abc123", "result": [ { "id": 12345, "programStatus": "Accepted" } ], "success": true }
Method 2: Use the Dedicated Get Lead's Program Statuses Endpoint
Marketo has a purpose-built endpoint to fetch all program statuses for a single lead, and you can filter it to only return the status for your target program. This is often more direct if you're starting from a lead ID rather than a program ID.
Request Details:
- HTTP Method: GET
- URL Structure:
/rest/v1/leads/{LEAD_ID}/programStatuses.json?access_token={YOUR_ACCESS_TOKEN}&programId={PROGRAM_ID} - Key Parameters:
programId={PROGRAM_ID}: Filters the response to only include the status from your specific program
Example Response Snippet:
{ "requestId": "def456", "result": [ { "programId": 7890, "programName": "Webinar Q3 2024", "programStatus": "Registered", "statusDate": "2024-05-20T14:30:00Z" } ], "success": true }
Important Notes:
- Ensure your API user has Read Lead and Read Program permissions in Marketo—missing these will trigger authorization errors.
- Double-check that
PROGRAM_IDandLEAD_IDare numeric values (Marketo's API relies on IDs, not names or emails, for these entities). - If the response returns
success: false, check theerrorsarray for specific details on what went wrong (e.g., invalid ID, permission issues).
内容的提问来源于stack exchange,提问作者Brijesh Shetty
相关产品推荐
相关产品推荐

