Retrieve interactions for a contact using code

Use the msdyncrm_LoadInteractionsPublic action to programmatically retrieve interactions for a contact. This action is useful for responding to get-my-data requests in order to fulfill the General Data Protection Regulation (GDPR) compliance.


You can also generate request and response classes for this action to include in your application code. More information: Generate early-bound types for an action

Action parameters

The msdyncrm_LoadInteractionsPublic action expects the following input parameters:

Name Type Description
ContactId Edm.String ID of the contact record to retrieve the interactions for. Required.
DateFrom Edm.String Start date in the MM-DD-YYYY format from which you want to retrieve interactions. Optional.
DateTo Edm.String End date in the MM-DD-YYYY format until which you want to retrieve interactions. Optional.
InteractionType Edm.String Type of interaction to be retrieved. Required.
You can specify one of the following values:
  • ActivityContactBlocked
  • ActivityContactDispatched
  • ActivityContactProcessingFailed
  • CreateCrmActivityContactProcessed
  • CreateCustomChannelActivityContactProcessed
  • CustomChannelResponse
  • CustomerJourneyContactRecordUpdated
  • EmailBlockBounced
  • EmailBlocked
  • EmailClicked
  • EmailContainsBlacklistedLinks
  • EmailDelivered
  • EmailFeedbackLoop
  • EmailForwarded
  • EmailHardBounced
  • EmailOpened
  • EmailSendingFailed
  • EmailSent
  • EmailSoftBounced
  • EmailSubscriptionSubmit
  • EventCheckIn
  • EventRegistration
  • FormSubmitted
  • FormVisited
  • InvalidRecipientAddress
  • InvalidSenderAddress
  • LeadScoreBoost
  • OutOfEmailCredits
  • PassThroughActivityContactProcessed
  • RedirectLinkClicked
  • SchedulerActivityContactProcessed
  • SegmentRelationshipEdited
  • SegmentSubscribed
  • SegmentUnsubscribed
  • SplitterActivityContactProcessed
  • SurveyResponse
  • TriggerActivityContactProcessed
  • TriggerCrmWorkflowActivityContactProcessed
  • WebsiteClicked
  • WebsiteVisited
Top Edm.Int32 Optional. Non-negative integer that limits the number of interactions returned for a contact record. Optional.
SkipToken Edm.String Identifies a starting point in the collection of interactions returned for a contact record. Optional.

Action return type

The msdyncrm_LoadInteractionsPublic action returns the following value:

Name Type Description
msdyncrm_LoadInteractionsPublicResponse ComplexType Contains the response from msdyncrm_LoadInteractionsPublic action. It contains the following properties that contain the structured data of the type:
Name Type Description
Data Edm.String List of interactions as an escaped JSON array.
NextSkipToken Edm.String Identifies the next cursor or bookmark in the collection of interactions returned for a contact record.



POST [Organization URI]/api/data/v9.0/msdyncrm_LoadInteractionsPublic HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
OData-MaxVersion: 4.0
OData-Version: 4.0
    "InteractionType": "WebsiteClicked",
    "ContactId": "0dbe0fa3-8e18-e811-a951-000d3a37caec",


The response contains a JSON object with a Data property containing the full list of interactions.

HTTP/1.1 200 OK  
Content-Type: application/json; odata.metadata=minimal  
OData-Version: 4.0

    "@odata.context":"[Organization URI]/api/data/v9.0/$metadata#Microsoft.Dynamics.CRM.msdyncrm_LoadInteractionsPublicResponse",

See also

Data protection and the GDPR