Mapping activities to programs | Community
Skip to main content
Harrison_Van_Oo
Level 2
Jun 26, 2019 2:06 PM UTC
Question

Mapping activities to programs

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?

9 replies

Jep_Castelein2
Level 10
Jun 26, 2019 11:17 PM UTC

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

Translate
Jackie_Potts
Level 6
Jun 26, 2019 3:58 PM UTC

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.

Translate
Harrison_Van_Oo
Level 2
Jun 26, 2019 4:08 PM UTC

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?

Translate
Jackie_Potts
Level 6
Jun 26, 2019 4:29 PM UTC

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

Translate