Retrieve insights data using msdyn_RetrieveKPIValuesForGDPR action

Applies to Dynamics 365 for Customer Engagement version 9.1.0.

Use the msdyn_RetrieveKPIValuesForGDPR action to programmatically retrieve profiles, interactions, and KPIs stored in Azure service that is used to compute and store data for an contact, lead, opportunity, or systemuser. This action is useful for responding to data requests in order to fulfill the GDPR compliance in Dynamics 365 Sales Insights.

Note

Action parameters

The msdyn_RetrieveKPIValuesForGDPR action expects the following input parameters:

Name Type Description
CRMRecord mscrm.crmbaseentity Entity type for which you want to retrieve the data. Required.

You can specify one of the following values:

  • Microsoft.Dynamics.CRM.contact
  • Microsoft.Dynamics.CRM.lead
  • Microsoft.Dynamics.CRM.opportunity
  • Microsoft.Dynamics.CRM.systemuser

Depending on the specified entity type, you must specify contactid, leadid, opportunityid, or systemuserid as the second key to identify the entity record you want to retrieve data for. See Example later in this topic.

Action return type

The msdyn_RetrieveKPIValuesForGDPR action returns the following value:

Name Type Description
msdyn_RetrieveKPIValuesForGDPRResponse ComplexType Contains the response from the msdyn_RetrieveKPIValuesForGDPR action. It contains the following property that contain the structured data of the type:
Name Type Description
Response Edm.String List of data as an escaped JSON array.

Example

Request

POST [Organization URI]/api/data/v9.0/msdyn_RetrieveKPIValuesForGDPR HTTP/1.1
Accept: application/json
Content-Type: application/json; charset=utf-8
OData-MaxVersion: 4.0
OData-Version: 4.0
  
{
  "CRMRecord": {
    "@odata.type": "Microsoft.Dynamics.CRM.contact",
    "contactid": "bf1b1e9a-6e28-e811-a94e-000d3a365e68"
  }
}  

Response

The response contains a JSON object with a Response property containing the list of data stored in Azure service that is used to compute and store data.

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.msdyn_RetrieveKPIValuesForGDPRResponse",
   "Response": {\"EntityId\": \"bf1b1e9a-6e28-e811-a94e-000d3a365e68\",\"Daily UI KPIs\": \"Some Values\",\"Lifetime UI KPIs\": \"Some Values\",\"Most Contacted KPIs\": \"Some Values\",\"Health KPIs\": \"Some Values\"}]"
}

See also