Mapping activities to programs | Community
Skip to main content
Harrison_Van_Oo
Level 2
June 26, 2019
Question

Mapping activities to programs

  • June 26, 2019
  • 2 replies
  • 4716 views

Is it possible to tie a Marketo "Activity" to a particular "Program"? For example, by querying the /rest/v1/activities.jsonendpoint, you might receive a response like this within the list of results:

 

{
  "id": 1843265,
  "marketoGUID": "1843265",
  "leadId": 72788,
  "activityDate": "2019-03-01T00:02:36Z",
  "activityTypeId": 100087,
  "primaryAttributeValueId": 17275,
  "primaryAttributeValue": "Email name 123",
  "attributes": [
    {
      "name": "Asset ID",
      "value": 2290
    },
    {
      "name": "Asset Type",
      "value": "Email"
    },
    {
      "name": "Campaign ID",
      "value": 2458
    },
    ...
  ]
}

 

None of the provided IDs in this response seem to be tied to a Program. Am I missing something?

2 replies

Jackie_Potts
Level 6
June 26, 2019

Program operations are listed under assets - https://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/. Maybe this will help you get to what you need.

Harrison_Van_Oo
Level 2
June 26, 2019

Thank you, Jackie. I would certainly need to use that endpoint as well, but the issue is that the /rest/v1/activities.json endpoint does not provide any program ID that corresponds to the "id" field provided by the /rest/asset/v1/programs.json endpoint (as far as I can tell). This means that I cannot tie an activity to the program it ocurred in.

Is there a field provided in the /rest/v1/activities.json response that does map to Program ID and I'm just missing it? For example, does primaryAttributeValueId refer to the Program ID?

Jackie_Potts
Level 6
June 26, 2019

I am not sure. Do either of these help you? If not, maybe another with more experience in this area can help you out.

Jep_Castelein2
Level 10
June 26, 2019

Sanford's approach uses the primaryAttributeValue, assuming the Email lives inside the Program and assuming there are no periods in the Program or Email name. You can also consider this approach: https://nation.marketo.com/thread/50537-api-questions-engagement-programs-activity