Open mccrodp opened 8 years ago
Correct me if I am wrong but from what I have seen this module is only dealing with one lead at a time so aggregation for getting all activities could be possible without too much effort. Another option is adding a setting for available activities (kinda like available fields) in the marketo_ma settings form.
Hey Jaesin. Actually this feature I was not using in my client project at all, so it was just ported to REST in code and minimally tested. I'd have to take a closer look to see about 1 lead at a time, but I imagine so and if that's what you came across also, it probably is.
So, for 1 lead it would be something like: get lead id call, get paging token call, get activity types call, then x bundles of 10 activities. I definitely think reducing the number of activity types to "enabled activities" similar to the field definitions / enabled fields is the way to go. We reworked that completely in marketo_rest
current implementation to allow for mapping the field names. Did you do something similar in D8 to allow for using Munchkin API field naming alongside REST? I'm not sure if something similar to that is needed for Activity Types, perhaps not if they are just ID -> Display Name rather than : ID - REST - SOAP - Display Name.
I'd have to look again at the API and module for all of the above, probably won't be for a week now anyway.
Needs testing with real data This method is implemented but not tests as I need to have the test user have performed activities. This needs to be simulated to return real data, at the moment there is no
result
in the response as I imagine there are no activities performed.Needs improvement (as this was ported directly from SOAP API / Marketo MA module) The SOAP API provided
getLeadActivity
: http://developers.marketo.com/documentation/soap/getleadactivity/ This allowed users to obtain all activities as it states: "If you want all activity types, a blank value needs to be passed.""This is not the case in the closest equivalent in REST API: http://developers.marketo.com/documentation/rest/get-lead-activities It states that we can only request lead activity data by activity type in bundles of 10: "Comma-separated list of activity ids, max 10" We also have to have called for a paging token, lead ids, activity types, so all of these calls if requesting on 60 activity types is a total of 3 + (6 x 10) REST API calls; it's pretty heavy even in the tests.
So, this module should re-think it's use of the method
getLeadActivity
/getAllLeadActivities
.