API questions: Programs and Lead Activity

Grégoire_Miche2
Level 10

Re: API questions: Programs and Lead Activity

Hi Dan,

In the activity, you will need to look at the "program status was changed" activity. In this activity type, you will get the Old Status and the New Status.

Another API endpoint (/rest/v1/leads/programs/{programId}.json) can provide the list of leads in a program with their membership status in the program. But this is not an activity related endpoint.

-Greg

Dan_Stevens_
Level 10 - Champion Alumni

Re: API questions: Programs and Lead Activity

Thanks Greg.  However, I don't see a "program status was changed" here:

pastedImage_0.png

SanfordWhiteman
Level 10 - Community Moderator

Re: API questions: Programs and Lead Activity

But Dan, you don't see any of the activity type ids in the generic response model page. That's because they're described in the types.json ednpoint.. Then they're returned in the activities.json endpoint when you actually execute a query.

Dan_Stevens_
Level 10 - Champion Alumni

Re: API questions: Programs and Lead Activity

OK, so here's the types.json:

pastedImage_0.png

I'm still not seeing a "program status was changed".  Or would that be the "description"?  And if so, where would we lookup the "old status" and "new status" that Greg refers to?

SanfordWhiteman
Level 10 - Community Moderator

Re: API questions: Programs and Lead Activity

You have to query the types.json endpoint to see the types fleshed out.  The generic model here doesn't show you a response, it shows you the schema (or scaffolding, or object structure) used by any response.

Grégoire_Miche2
Level 10

Re: API questions: Programs and Lead Activity

Hi Dan,

The Types endpoint will give you the type details (or meta data). The Attributes array n the type will describe the details you ca get for each type. Typically, for the "program status was changed" some of the attributes will be "old status", "new status", "program ID", etc...

Then the activities endpoint, as you can see, also has an "Attributes" array that will contains the actual values. The tricky part is that the list of attributes is different between each activity types. And your client fetching the data needs to call the "type" end point first to get a description of these attributes array so that it can parse them.

-Greg

Dan_Stevens_
Level 10 - Champion Alumni

Re: API questions: Programs and Lead Activity

Thanks Greg.  Both you and Sandy have been extremely helpful thus far.  As I'm sure you've concluded, this is the first time our development team has used the API to pull in the required data needed to build out our enhanced BI environment.  So I doubt we're making the most efficient API call strategy - especially given the large amounts of data, with a 10,000 limit each day.  Just out of curiosity, are you familiar with the Data Loader for Marketo: Extract Marketo data to database | Data Loader for Marketo ?  Unfortunately I learned about this after our team was well into the dev effort.  I wonder if DLM has what we're looking for already pre-built - and something we can plug-n-play into our SQL Server environment.

VIvian Wu

SanfordWhiteman
Level 10 - Community Moderator

Re: API questions: Programs and Lead Activity

I tried an early version that required SOAP (i.e. root) access... I'm sure you know how I feel about that. Heard that requirement has been removed, but I haven't retested.

In theory, a packaged solution benefits from cases introduced by their userbase, ending up with a better-rounded product than you could build yourself. In practice, in this particular area... not so much.

So I definitely wouldn't shy away from building this in-house, but I think your developers need to get on the Community themselves. With respect, the questions they're relaying don't make a lot of sense if they've been spending real time on this.

Anonymous
Not applicable

Re: API questions: Programs and Lead Activity

Hi Dan Stevens​,

This report seems to be created by Program Membership Analysis from RCE. To pull this data, you will need to retrieve program members (includes program status), and combine them with programs (includes program attributes) and leads (includes lead information) to build this report.

DLM allows you to extract Program Member data to your database, and will only grab the updated data, so you utilize your API calls effectively.

Here is an article about Program Member data and relevant analysis for your reference.

Program Membership data and analysis

You can also generate this report with lead activities (Change Status in Progression), but it may take more effort to filter the data in current status and delete non-use data, because it contains all history of status change.

Best Regards,

Vivian

SanfordWhiteman
Level 10 - Community Moderator

Re: API questions: Programs and Lead Activity

DLM allows you to extract Program Member data to your database, and will only grab the updated data, so you utilize your API calls effectively.

If you're doing accurate incremental updates of Program Members, then you must be using the Activity Log, as discussed above. There's no other way to do this losslessly.