Data Subject Request API Version 1 and 2
Data Subject Request API Version 3
Platform API Overview
Accounts
Apps
Audiences
Calculated Attributes
Data Points
Feeds
Field Transformations
Services
Users
Workspaces
Warehouse Sync API Overview
Warehouse Sync API Tutorial
Warehouse Sync API Reference
Data Mapping
Warehouse Sync SQL Reference
Warehouse Sync Troubleshooting Guide
ComposeID
Warehouse Sync API v2 Migration
Bulk Profile Deletion API Reference
Calculated Attributes Seeding API
Data Planning API
Custom Access Roles API
Group Identity API Reference
Pixel Service
Profile API
Events API
mParticle JSON Schema Reference
IDSync
AMP SDK
Initialization
Configuration
Network Security Configuration
Event Tracking
User Attributes
IDSync
Screen Events
Commerce Events
Location Tracking
Media
Kits
Application State and Session Management
Data Privacy Controls
Error Tracking
Opt Out
Push Notifications
WebView Integration
Logger
Preventing Blocked HTTP Traffic with CNAME
Linting Data Plans
Troubleshooting the Android SDK
API Reference
Upgrade to Version 5
Cordova Plugin
Identity
Direct URL Routing FAQ
Web
Android
iOS
Initialization
Configuration
Event Tracking
User Attributes
IDSync
Screen Tracking
Commerce Events
Location Tracking
Media
Kits
Application State and Session Management
Data Privacy Controls
Error Tracking
Opt Out
Push Notifications
Webview Integration
Upload Frequency
App Extensions
Preventing Blocked HTTP Traffic with CNAME
Linting Data Plans
Troubleshooting iOS SDK
Social Networks
iOS 14 Guide
iOS 15 FAQ
iOS 16 FAQ
iOS 17 FAQ
iOS 18 FAQ
API Reference
Upgrade to Version 7
Getting Started
Identity
Upload Frequency
Getting Started
Opt Out
Initialize the SDK
Event Tracking
Commerce Tracking
Error Tracking
Screen Tracking
Identity
Location Tracking
Session Management
Initialization
Content Security Policy
Configuration
Event Tracking
User Attributes
IDSync
Page View Tracking
Commerce Events
Location Tracking
Media
Kits
Application State and Session Management
Data Privacy Controls
Error Tracking
Opt Out
Custom Logger
Persistence
Native Web Views
Self-Hosting
Multiple Instances
Web SDK via Google Tag Manager
Preventing Blocked HTTP Traffic with CNAME
Facebook Instant Articles
Troubleshooting the Web SDK
Browser Compatibility
Linting Data Plans
API Reference
Upgrade to Version 2 of the SDK
Getting Started
Identity
Web
Alexa
Overview
Step 1. Create an input
Step 2. Verify your input
Step 3. Set up your output
Step 4. Create a connection
Step 5. Verify your connection
Step 6. Track events
Step 7. Track user data
Step 8. Create a data plan
Step 9. Test your local app
Overview
Step 1. Create an input
Step 2. Verify your input
Step 3. Set up your output
Step 4. Create a connection
Step 5. Verify your connection
Step 6. Track events
Step 7. Track user data
Step 8. Create a data plan
Overview
Step 1. Create an input
Step 2. Verify your input
Step 3. Set up your output
Step 4. Create a connection
Step 5. Verify your connection
Step 6. Track events
Step 7. Track user data
Step 8. Create a data plan
Step 1. Create an input
Step 2. Create an output
Step 3. Verify output
Node SDK
Go SDK
Python SDK
Ruby SDK
Java SDK
Introduction
Outbound Integrations
Firehose Java SDK
Inbound Integrations
Compose ID
Glossary
Data Hosting Locations
Migrate from Segment to mParticle
Migrate from Segment to Client-side mParticle
Migrate from Segment to Server-side mParticle
Segment-to-mParticle Migration Reference
Rules Developer Guide
API Credential Management
The Developer's Guided Journey to mParticle
Create an Input
Start capturing data
Connect an Event Output
Create an Audience
Connect an Audience Output
Transform and Enhance Your Data
The new mParticle Experience
The Overview Map
Introduction
Data Retention
Connections
Activity
Live Stream
Data Filter
Rules
Tiered Events
mParticle Users and Roles
Analytics Free Trial
Troubleshooting mParticle
Usage metering for value-based pricing (VBP)
Introduction
Sync and Activate Analytics User Segments in mParticle
User Segment Activation
Welcome Page Announcements
Project Settings
Roles and Teammates
Organization Settings
Global Project Filters
Portfolio Analytics
Analytics Data Manager Overview
Events
Event Properties
User Properties
Revenue Mapping
Export Data
UTM Guide
Data Dictionary
Query Builder Overview
Modify Filters With And/Or Clauses
Query-time Sampling
Query Notes
Filter Where Clauses
Event vs. User Properties
Group By Clauses
Annotations
Cross-tool Compatibility
Apply All for Filter Where Clauses
Date Range and Time Settings Overview
Understanding the Screen View Event
Analyses Introduction
Getting Started
Visualization Options
For Clauses
Date Range and Time Settings
Calculator
Numerical Settings
Assisted Analysis
Properties Explorer
Frequency in Segmentation
Trends in Segmentation
Did [not] Perform Clauses
Cumulative vs. Non-Cumulative Analysis in Segmentation
Total Count of vs. Users Who Performed
Save Your Segmentation Analysis
Export Results in Segmentation
Explore Users from Segmentation
Getting Started with Funnels
Group By Settings
Conversion Window
Tracking Properties
Date Range and Time Settings
Visualization Options
Interpreting a Funnel Analysis
Group By
Filters
Conversion over Time
Conversion Order
Trends
Funnel Direction
Multi-path Funnels
Analyze as Cohort from Funnel
Save a Funnel Analysis
Explore Users from a Funnel
Export Results from a Funnel
Saved Analyses
Manage Analyses in Dashboards
Dashboards––Getting Started
Manage Dashboards
Dashboard Filters
Organize Dashboards
Scheduled Reports
Favorites
Time and Interval Settings in Dashboards
Query Notes in Dashboards
User Aliasing
The Demo Environment
Keyboard Shortcuts
Analytics for Marketers
Analytics for Product Managers
Compare Conversion Across Acquisition Sources
Analyze Product Feature Usage
Identify Points of User Friction
Time-based Subscription Analysis
Dashboard Tips and Tricks
Understand Product Stickiness
Optimize User Flow with A/B Testing
User Segments
IDSync Overview
Use Cases for IDSync
Components of IDSync
Store and Organize User Data
Identify Users
Default IDSync Configuration
Profile Conversion Strategy
Profile Link Strategy
Profile Isolation Strategy
Best Match Strategy
Aliasing
Overview
Create and Manage Group Definitions
Introduction
Catalog
Live Stream
Data Plans
Blocked Data Backfill Guide
Predictive Attributes Overview
Create Predictive Attributes
Assess and Troubleshoot Predictions
Use Predictive Attributes in Campaigns
Predictive Audiences Overview
Using Predictive Audiences
Introduction
Profiles
Warehouse Sync
Data Privacy Controls
Data Subject Requests
Default Service Limits
Feeds
Cross-Account Audience Sharing
Approved Sub-Processors
Import Data with CSV Files
CSV File Reference
Glossary
Video Index
Single Sign-On (SSO)
Setup Examples
Introduction
Introduction
Introduction
Rudderstack
Google Tag Manager
Segment
Advanced Data Warehouse Settings
AWS Kinesis (Snowplow)
AWS Redshift (Define Your Own Schema)
AWS S3 Integration (Define Your Own Schema)
AWS S3 (Snowplow Schema)
BigQuery (Snowplow Schema)
BigQuery Firebase Schema
BigQuery (Define Your Own Schema)
GCP BigQuery Export
Snowflake (Snowplow Schema)
Snowplow Schema Overview
Snowflake (Define Your Own Schema)
Aliasing
Data Master is underpinned by the Data Planning API. This guide covers the underlying data model and describes how you can use Data Master programmatically via an HTTP API. Some example use cases you can achieve with the Data Planning API are:
The following diagram shows the relationship structure defined by the Data Planning API:
Each Data Point is composed of two key elements, a “criteria” used to match the Data Point within an incoming data stream, and “schema” that is used to validate the contents of the Data Point:
_Ref
, _RecursiveRef
, _RecursiveAnchor
, PatternProperties
, AllOf
, AnyOf
, OneOf
, If
, Not
, Else
, Then
, Dependencies
, DependentRequired
, DependentSchemas
.The Data Planning HTTP API can be used from one of mParticle’s helper SDKs. These SDKs take care of authentication and implement the HTTP contract for you:
You can use the Open API specification (also known as Swagger) below to generate helper SDKs (using Swagger Codegen or OpenAPI Generator) for the Data Planning API:
You can also get started quickly with a Postman collection:
Calls to the Data Planning API are authenticated via mParticle access token, which are based on the JSON Web Token standard. If you’re using one of the helper SDKs, this is taken care of for you.
Name | Type | Description |
---|---|---|
client_id | string |
Your client ID issued by mParticle |
client_secret | string |
Your client secret issued by mParticle |
audience | string |
Set to https://api.mparticle.com |
grant_type | string |
Set to client_credentials |
$ curl --location --request POST 'https://sso.auth.mparticle.com/oauth/token' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_id": "{{client_id}}",
"client_secret": "{{client_secret}}",
"audience": "https://api.mparticle.com",
"grant_type": "client_credentials"
}'
{
"access_token": "YWIxMjdi883GHBBDnjsdKAJQxNjdjYUUJABbg6hdI.8V6HhxW-",
"expires_in" : 28800,
"token_type": "Bearer"
}
Subsequent requests to the HTTP API should be authorized by setting the Authorization
header to the value of access_token
:
Authorization: Bearer YWIxMjdi883GHBBDnjsdKAJQxNjdjYUUJABbg6hdI.8V6HhxW-
Name | Type | Description |
---|---|---|
workspace_id | integer |
The ID of the workspace containing your data plans |
curl --location --request GET 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans' \
--header 'Authorization: Bearer {{jwt_token}}'
import { DataPlanService } from '@mparticle/data-planning-node';
const dataPlanService = new DataPlanService({
workspaceId: '{{workspace_id}}',
clientId: '{{client_id}}',
clientSecret: '{{client_secret}}',
});
const dataPlans = await dataPlanService.getDataPlans();
[
{
"data_plan_id": "mobile_data_plan",
"data_plan_name": "Mobile Data Plan",
"data_plan_description": "This is an example data plan description.",
"data_plan_versions": [
{
"version": 1,
"data_plan_id": "mobile_data_plan",
"version_description": "This is my first version!",
"activated_environment": "production",
"created_on": "2019-11-24T14:45:03.013",
"created_by": "developers@mparticle.com",
"last_modified_on": "2019-11-24T18:58:58.233",
"last_modified_by": "developers@mparticle.com"
},
{
"version": 2,
"data_plan_id": "mobile_data_plan",
"version_description": "This is the second version of my plan!",
"activated_environment": "production",
"created_on": "2019-11-24T19:02:26.013",
"created_by": "developers@mparticle.com",
"last_modified_on": "2019-11-24T19:03:13.913",
"last_modified_by": "developers@mparticle.com"
}
],
"created_on": "2019-11-24T14:45:03.007",
"created_by": "developers@mparticle.com",
"last_modified_on": "2020-04-07T14:22:57.777",
"last_modified_by": "developers@mparticle.com"
},
{
"data_plan_id": "foo_bar",
"data_plan_name": "foo bar",
"data_plan_description": "foo_bar",
"data_plan_versions": [
{
"version": 1,
"data_plan_id": "foo_bar",
"activated_environment": "none",
"created_on": "2019-11-25T16:53:16.027",
"created_by": "developers@mparticle.com",
"last_modified_on": "2020-01-14T14:52:11.43",
"last_modified_by": "developers@mparticle.com"
},
{
"version": 2,
"data_plan_id": "foo_bar",
"activated_environment": "none",
"created_on": "2020-04-07T14:28:14.903",
"created_by": "developers@mparticle.com"
}
],
"created_on": "2019-11-25T16:53:16.023",
"created_by": "developers@mparticle.com"
}
]
Name | Type | Description |
---|---|---|
workspace_id | integer |
The ID of the workspace containing your data plans |
curl --location --request POST 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans' \
--header 'Authorization: Bearer {{jwt_token}}' \
--data-raw '{
"data_plan_id": "example_data_plan",
"data_plan_name": "Mobile Data Plan",
"data_plan_description": "This is an example data plan description.",
"data_plan_versions": [
{
"version": 1,
"data_plan_id": "mobile_data_plan",
"activated_environment": "none",
"version_document": {
"data_points": [
{
"description": "My first data point",
"match": {
"type": "custom_event",
"criteria": {
"event_name": "My Custom Event Name",
"custom_event_type": "other"
}
},
"validator": {
"type": "json_schema",
"definition": {
"properties": {
"data": {
"additionalProperties": true,
"properties": {
"custom_attributes": {
"additionalProperties": false,
"properties": {
"foo": {
"type": "number"
}
},
"required": [
"foo"
]
}
},
"required": [
"custom_attributes"
]
}
}
}
}
}
]
}
}
]
}'
import { DataPlanService } from '@mparticle/data-planning-node';
import { ActivatedEnvironment } from '@mparticle/data-planning-models';
const dataPlanService = new DataPlanService({
workspaceId: '{{workspace_id}}',
clientId: '{{client_id}}',
clientSecret: '{{client_secret}}',
});
const plan = {
data_plan_id: 'example_data_plan',
data_plan_name: 'My Example Data Plan',
data_plan_description: 'This is an example data plan description.',
data_plan_versions: []
}
const version = {
version: 1,
version_description: 'This is an example version description.',
activated_environment: ActivatedEnvironment.Development,
version_document: {
data_points: []
}
};
const datapoint = {
description: "My first data point",
match: {
type: "custom_event",
criteria: {
event_name: "My Custom Event Name",
custom_event_type: "other"
}
},
validator: {
type: "json_schema",
definition: {
properties: {
data: {
additionalProperties: true,
properties: {
custom_attributes: {
additionalProperties: false,
properties: {
foo: {
type: "number"
}
},
required: [
"foo"
]
}
},
required: [
"custom_attributes"
]
}
}
}
}
};
plan.data_plan_versions.push(version);
version.version_document.data_points.push(datapoint);
const createdPlan = await dataPlanService.createDataPlan(plan)
.catch(err => {
console.log(err.status);
console.log(err.response.data);
}
);
{
"data_plan_id": "example_data_plan",
"data_plan_name": "Mobile Data Plan",
"data_plan_description": "This is an example data plan description.",
"data_plan_versions": [
{
"version": 1,
"data_plan_id": "example_data_plan",
"activated_environment": "none",
"created_on": "2020-04-19T14:45:44.403",
"created_by": "client_id:rWW4wEjzksyjcCJXh8RGKrIPwPhHCjLF",
"version_document": {
"data_points": [
{
"description": "My first data point",
"match": {
"type": "custom_event",
"criteria": {
"event_name": "My Custom Event Name",
"custom_event_type": "other"
}
},
"validator": {
"type": "json_schema",
"definition": {
"properties": {
"data": {
"additionalProperties": true,
"properties": {
"custom_attributes": {
"additionalProperties": false,
"properties": {
"foo": {
"type": "number"
}
},
"required": [
"foo"
]
}
},
"required": [
"custom_attributes"
]
}
}
}
}
}
]
}
}
],
"created_on": "2020-04-19T14:45:44.39",
"created_by": "client_id:rWW4wEjzksyjcCJXh8RGKrIPwPhHCjLF"
}
Name | Type | Description |
---|---|---|
workspace_id | integer |
The ID of the workspace containing your data plans |
plan_id | string |
The ID of the Data Plan to retrieve |
curl --location --request GET 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans/{{plan_id}}' \
--header 'Authorization: Bearer {{jwt_token}}'
import { DataPlanService } from '@mparticle/data-planning-node';
const dataPlanService = new DataPlanService.DataPlanService({
workspaceId: '{{workspace_id}}',
clientId: '{{client_id}}',
clientSecret: '{{client_secret}}',
});
const dataPlan = await dataPlanService.getDataPlans("example_data_plan_id");
The response will contain the entire Data Plan including all versions. See above for a full JSON example.
Name | Type | Description |
---|---|---|
workspace_id | integer |
The ID of the workspace containing your data plans |
plan_id | string |
The ID of the Data Plan to retrieve |
curl --location --request PATCH 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans/{{plan_id}}' \
--header 'Authorization: Bearer {{jwt_token}}' \
--data-raw '{
"data_plan_description": "This is an updated description..."
}'
import { DataPlanService } from '@mparticle/data-planning-node';
const dataPlanService = new DataPlanService.DataPlanService({
workspaceId: '{{workspace_id}}',
clientId: '{{client_id}}',
clientSecret: '{{client_secret}}',
});
//provide any fields you'd like to update
const updatedPlan = {
data_plan_description: "This is an updated description"
};
const updatedDataPlan = await dataPlanService.updateDataPlan("example_data_plan", updatedPlan)
.catch(err => {
console.log(err.status);
console.log(err.response.data);
}
);
The response will contain the entire Data Plan including all versions. See above for a full JSON example.
Name | Type | Description |
---|---|---|
plan_id | string |
The ID of the data plan to delete |
curl --location --request DELETE 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans/{{plan_id}}' \
--header 'Authorization: Bearer {{jwt_token}}' \
import { DataPlanService } from '@mparticle/data-planning-node';
const dataPlanService = new DataPlanService({
workspaceId: '{{workspace_id}}',
clientId: '{{client_id}}',
clientSecret: '{{client_secret}}',
});
const deleteDataPlan = await dataPlanService.deleteDataPlan("example_data_plan_id");
A successful request results in an empty 204 response.
Name | Type | Description |
---|---|---|
workspace_id | integer |
The ID of the workspace containing your data plans |
curl --location --request POST 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans/{{plan_id}}/versions' \
--header 'Authorization: Bearer {{jwt_token}}' \
--data-raw '{
"version": 2,
"version_document": {
"data_points": [
{
"description": "My first data point",
"match": {
"type": "custom_event",
"criteria": {
"event_name": "My Custom Event Name",
"custom_event_type": "other"
}
},
"validator": {
"type": "json_schema",
"definition": {
"properties": {
"data": {
"additionalProperties": true,
"properties": {
"custom_attributes": {
"additionalProperties": false,
"properties": {
"foo": {
"type": "number"
}
},
"required": ["foo"]
}
},
"required": [
"custom_attributes"
]
}
}
}
}
}
]
},
"activated_environment": "development"
}'
import { DataPlanService } from '@mparticle/data-planning-node';
import { ActivatedEnvironment } from '@mparticle/data-planning-models';
const dataPlanService = new DataPlanService({
workspaceId: '{{workspace_id}}',
clientId: '{{client_id}}',
clientSecret: '{{client_secret}}',
});
const version = {
version: 1,
version_description: 'This is an example version description.',
activated_environmment: ActivatedEnvironment.Development,
version_document: {
data_points: []
}
};
const datapoint = {
description: "My first data point",
match: {
type: "custom_event",
criteria: {
event_name: "My Custom Event Name",
custom_event_type: "other"
}
},
validator: {
type: "json_schema",
definition: {
properties: {
data: {
additionalProperties: true,
properties: {
custom_attributes: {
additionalProperties: false,
properties: {
foo: {
type: "number"
}
},
required: [
"foo"
]
}
},
required: [
"custom_attributes"
]
}
}
}
}
};
version.version_document.data_points.push(datapoint);
const createdPlanVersion = await dataPlanService.createDataPlanVersion("example_data_plan_id", 2)
.catch(err => {
console.log(err.status);
console.log(err.response.data);
}
);
The response will contain the entire Data Plan Version including all versions. See above for a full JSON example.
Name | Type | Description |
---|---|---|
workspace_id | integer |
The ID of the workspace containing your data plans |
plan_id | string |
The ID of the Data Plan to retrieve |
version | integer |
The version of the Data Plan to retrieve |
curl --location --request GET 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans/{{plan_id}}/versions/{{version}}' \
--header 'Authorization: Bearer {{jwt_token}}'
import { DataPlanService } from '@mparticle/data-planning-node';
const dataPlanService = new DataPlanService.DataPlanService({
workspaceId: '{{workspace_id}}',
clientId: '{{client_id}}',
clientSecret: '{{client_secret}}',
});
const dataPlanVersion = await dataPlanService.getDataPlanVersion("example_data_plan_id", 1)
.catch(err => {
console.log(err.status);
console.log(err.response.data);
}
);
The response will contain the entire Data Plan version. See above for a full JSON example.
Name | Type | Description |
---|---|---|
workspace_id | integer |
The ID of the workspace containing your data plans |
plan_id | string |
The ID of the Data Plan to retrieve |
version | integer |
The version of the Data Plan to retrieve |
curl --location --request PATCH 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans/{{plan_id}}/versions/{{version}}' \
--header 'Authorization: Bearer {{jwt_token}}' \
--data-raw '{
"version": 2,
"version_document": {
"data_points": [
{
"description": "My first data point, updated",
"match": {
"type": "custom_event",
"criteria": {
"event_name": "My Custom Event Name",
"custom_event_type": "other"
}
},
"validator": {
"type": "json_schema",
"definition": {
"properties": {
"data": {
"additionalProperties": true,
"properties": {
"custom_attributes": {
"additionalProperties": false,
"properties": {
"foo": {
"type": "number"
}
},
"required": [
"foo"
]
}
},
"required": [
"custom_attributes"
]
}
}
}
}
}
]
},
"activated_environment": "development"
}'
const dataPlanService = new DataPlanService.DataPlanService({
workspaceId: '{{workspace_id}}',
clientId: '{{client_id}}',
clientSecret: '{{client_secret}}',
});
const dataPlanVersionUpdate = {
datapoints: [{
description: "My first data point",
match: {
type: "custom_event",
criteria: {
event_name: "My Custom Event Name",
custom_event_type: "other"
}
},
validator: {
type: "json_schema",
definition: {
properties: {
data: {
additionalProperties: true,
properties: {
custom_attributes: {
additionalProperties: false,
properties: {
foo: {
type: "number"
}
},
required: [
"foo"
]
}
},
required: [
"custom_attributes"
]
}
}
}
}
},
{
description: "My second data point",
match: {
type: "custom_event",
criteria: {
event_name: "My Custom Event Name",
custom_event_type: "other"
}
},
validator: {
type: "json_schema",
definition: {
properties: {
data: {
additionalProperties: true,
properties: {
custom_attributes: {
additionalProperties: false,
properties: {
foo: {
type: "number"
}
},
required: [
"foo"
]
}
},
required: [
"custom_attributes"
]
}
}
}
}
}]
}
const updatePlanVersion = await dataPlanService.updateDataPlanVersion("example_data_plan_id, 2, dataPlanVersionUpdate)
.catch(err => {
console.log(err.status);
console.log(err.response.data);
}
);
The response will contain the entire Data Plan version. See above for a full JSON example.
Name | Type | Description |
---|---|---|
workspace_id | integer |
The ID of the workspace containing your data plan |
plan_id | string |
The ID of the data plan |
version | integer |
The version of the data plan to delete |
curl --location --request DELETE 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans/{{plan_id}}/versions/{{version}}' \
--header 'Authorization: Bearer {{jwt_token}}' \
import { DataPlanService } from '@mparticle/data-planning-node';
const dataPlanService = new DataPlanService({
workspaceId: '{{workspace_id}}',
clientId: '{{client_id}}',
clientSecret: '{{client_secret}}',
});
const deleteDataPlanVersion = await dataPlanService.deleteDataPlanVersion("example_data_plan_id", example_version);
A successful request results in an empty 204 response.
To validate an event batch using the Data Planning API, submit a POST request to https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans/validate
, including the JSON formatted event batch you want to validate.
Name | Type | Description |
---|---|---|
workspace_id | integer |
The ID of the workspace containing the data plan version |
curl --location --request POST 'https://api.mparticle.com/platform/v2/workspaces/{{workspace_id}}/plans/validate' \
--header 'Authorization: Bearer {{jwt_token}}' \
--data-raw '{
"document": {
"data_points": [
{
"match": {
"type": "product_impression",
"criteria": {}
},
"validator": {
"type": "json_schema",
"definition": {}
},
"description": "cupidatat"
},
{
"match": {
"type": "custom_event",
"criteria": {
"event_name": "foo-location",
"custom_event_type": "location"
}
},
"validator": {
"type": "json_schema",
"definition": {}
},
"description": "esse proident officia sint"
}
],
"transformations": {
"transformation_id": 70840265.76408121,
"transformation_name": "sunt veniam esse ipsum",
"error_pointer": "enim eiusmod dolore in",
"validation_error_types": [
"unplanned"
],
"schema_keywords": [
"additionalProperties"
],
"json_patch": [
{
"op": "remove",
"from": "incididunt Ut",
"path": "dolor sed officia",
"value": "eu Excepteur exercitation esse"
}
],
"description": "nostrud sunt nulla"
}
},
"batch": {
"environment": "production",
"source_request_id": "ut",
"context": {
"data_plan": {
"plan_id": "aliqua",
"plan_version": 97521295
}
},
"events": [
{
"data": {
"timestamp_unixtime_ms": 79305770,
"source_message_id": "aute nisi",
"session_id": 56869342,
"session_uuid": "do anim",
"session_start_unixtime_ms": -2126166,
"event_start_unixtime_ms": 54299226,
"custom_attributes": {
"dolor__": "incididunt laboris amet elit",
"occaecat41f": "velit aliquip minim do"
},
"location": {
"latitude": {}
},
"device_current_state": {
},
"is_goal_defined": false,
"lifetime_value_change": true,
"lifetime_value_attribute_name": "anim mollit dolore",
"data_connection_type": "Duis sed sint",
"event_num": -85280667,
"view_controller": "fugiat irure velit",
"is_main_thread": false,
"canonical_name": "elit reprehenderit",
"event_system_notification_info": {
"type": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
}
},
"event_type": "profile"
},
{
"data": {
"timestamp_unixtime_ms": -27715666,
"source_message_id": "ut commodo",
"session_id": 58812755,
"session_uuid": "in nisi exercitation",
"session_start_unixtime_ms": -74726957,
"event_start_unixtime_ms": -99542442,
"custom_attributes": {
"nisi_0": "occaecat quis Lorem"
},
"location": {
},
"device_current_state": {
},
"is_goal_defined": true,
"lifetime_value_change": true,
"lifetime_value_attribute_name": "commodo Ut aliqua",
"data_connection_type": "id offici",
"event_num": 36874422,
"view_controller": "veniam",
"is_main_thread": false,
"canonical_name": "magna est fugiat in",
"event_system_notification_info": {
"type": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
}
},
"event_type": "screen_view"
}
],
"device_info": {
},
"application_info": {
"application_name": "est magna ad dolor",
"application_version": "cillum Excepteur",
"application_build_number": "magna labore nostrud",
"install_referrer": "exercit",
"package": "Ut aliquip fugiat cillum",
"os": "Unknown",
"apple_search_ads_attributes": {
"enim_ee6": {
"tempor_db": "sint c",
"labore_7d": "non dolore",
"in_4b": "nisi id deserunt exe"
},
"incididunt289": {
"aute_93": "mollit nostrud",
"reprehenderitd1": "nulla incididunt adipisicing sint"
}
}
},
"user_attributes": {
"fugiatd": {}
},
"deleted_user_attributes": [
"ullamco amet",
"enim"
],
"user_identities": {
"other": "non in",
"customer_id": "non laborum incididunt",
"facebook": "tempor incididunt velit",
"twitter": "Lorem velit anim",
"google": "ad consectetur",
"microsoft": "do quis pariatur",
"yahoo": "ex qui",
"email": "est labore",
"alias": "ea Excepteur esse incididunt"
},
"api_key": "in dolore Ut",
"api_keys": [
"culpa labore amet eu",
"aute in do Ut amet"
],
"ip": "iru",
"integration_attributes": {
"cupidatat_7": {
"cupidatat_7bd": "consectetur"
},
"proidentf": {
"pariatur_4": "offici"
}
},
"partner_identity": "cupidatat aute",
"source_info": {
"channel": "native",
"partner": "id ame",
"replay_request_id": "sint irure et",
"replay_job_id": "sed esse",
"is_historical": false
},
"mp_deviceid": "Excepteur dolor",
"attribution_info": {
"service_provider": "voluptate minim",
"publisher": "cill",
"campaign": "officia cillum esse"
},
"timestamp_unixtime_ms": 84190753,
"batch_id": -72216633,
"mpid": -724884,
"sdk_version": "anim cupidatat magna Lorem",
"consent_state": {
"gdpr": {
"regulation": "ut cupidatat",
"document": "labore in",
"consented": true,
"timestamp_unixtime_ms": -70914984,
"location": "consectetur magna qui incididunt",
"hardware_id": "non sit"
}
},
"job_id": "sint nulla incididunt do"
}
}'
import { DataPlanService } from '@mparticle/data-planning-node';
const dataPlanService = new DataPlanService();
// Fetch Data Plan Version asynchronously
const dataPlanVersion = await dataPlanService
.getVersionDocument(<organizationId>, <accountId>, 'my_custom_data_plan, <workspaceId>, 3, <token>);
const batchValidationResults = dataPlanService.validateBatch(batch, dataPlanVersion.version_document);
const eventValidationResults = dataPlanService.validateEvent(event, dataPlanVersion.version_document);
A successful request will receive a 200 OK response with the JSON formatted validation results, including any validation errors.
{
"results": [
{
"data": {
"match": {
"type": "product_impression",
"criteria": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"validation_errors": [
{
"validation_error_type": "unknown",
"key": "event name or attribute name",
"error_pointer": "#/data/custom_attributes/foo-attr-1",
"expected": "null for unplanned entities, the entity name for missing required entities, a data type (e.g. \"number\") for invalid data types, etc",
"actual": "the entity name for unplanned entities, null for missing required entities, a data type (e.g. \"string\") for invalid data types, etc",
"action_expected": "drop_batch",
"schema_keyword": "unevaluatedItems"
},
{
"validation_error_type": "missing_required",
"key": "event name or attribute name",
"error_pointer": "#/data/custom_attributes/foo-attr-1",
"expected": "null for unplanned entities, the entity name for missing required entities, a data type (e.g. \"number\") for invalid data types, etc",
"actual": "the entity name for unplanned entities, null for missing required entities, a data type (e.g. \"string\") for invalid data types, etc",
"action_expected": "drop_attribute",
"schema_keyword": "$ref"
}
],
"validated_event_id": -86884668.51948906,
"validated_source_message_id": "nostrud in",
"executed_transformations": {
"transformation_id": 97592156.55532053,
"transformation_status": "failure",
"transformation_error_type": "events_schema_violated",
"transformation_error_message": "pariatur enim",
"transformation_error_pointer": "adipi"
},
"timestamp_unixtime_ms": 17037035,
"event_id": -42247328,
"source_message_id": "e",
"session_id": 23278782,
"session_uuid": "aute fugiat",
"session_start_unixtime_ms": -6796583,
"event_start_unixtime_ms": 2872240,
"custom_attributes": {
"enimdcc": "dolor veniam ullamco",
"labore_3": "incididunt cillum"
},
"location": {
"latitude": 31814706.829063505,
"longitude": 63133216.60368088,
"accuracy": -11147420.056862295
},
"device_current_state": {
"time_since_start_ms": 40749038,
"battery_level": -44992792.32572158,
"data_connection_type": "Lorem fugiat",
"data_connection_type_detail": "anim cillum cupidatat",
"gps_state": true,
"total_system_memory_usage_bytes": -91208220,
"disk_space_free_bytes": 55999300,
"external_disk_space_free_bytes": -60627957,
"cpu": "eu laborum",
"system_memory_available_bytes": -39377379.67096515,
"system_memory_low": true,
"system_memory_threshold_bytes": 57785935.21112856,
"application_memory_available_bytes": 19617182.87110643,
"application_memory_max_bytes": -85980007.07383266,
"application_memory_total_bytes": -59964684.77254946,
"device_orientation": "portrait",
"status_bar_orientation": "portrait"
},
"is_goal_defined": false,
"lifetime_value_change": false,
"lifetime_value_attribute_name": "veniam",
"data_connection_type": "anim tempor elit",
"event_num": -33080120,
"view_controller": "enim aliquip",
"is_main_thread": true,
"canonical_name": "enim ea sint",
"event_system_notification_info": {
"type": "gdpr_change"
}
}
},
{
"data": {
"match": {
"type": "user_attributes",
"criteria": {
"value": "<Error: Too many levels of nesting to fake this schema>"
}
},
"validation_errors": [
{
"validation_error_type": "unplanned",
"key": "event name or attribute name",
"error_pointer": "#/data/custom_attributes/foo-attr-1",
"expected": "null for unplanned entities, the entity name for missing required entities, a data type (e.g. \"number\") for invalid data types, etc",
"actual": "the entity name for unplanned entities, null for missing required entities, a data type (e.g. \"string\") for invalid data types, etc",
"action_expected": "allow",
"schema_keyword": "examples"
}
],
"validated_event_id": -68430764.95735234,
"validated_source_message_id": "eu velit sit aliqua",
"executed_transformations": {
"transformation_id": -33544224.17781522,
"transformation_status": "unchanged",
"transformation_error_type": "unrecognized_data_point",
"transformation_error_message": "Lorem",
"transformation_error_pointer": "commodo nostrud ut reprehenderit do"
},
"timestamp_unixtime_ms": -69435754,
"event_id": -76370058,
"source_message_id": "velit sed laborum",
"session_id": -97492351,
"session_uuid": "sed",
"session_start_unixtime_ms": -50784535,
"event_start_unixtime_ms": 57530189,
"custom_attributes": {
"eiusmod_30": "tempor nostrud nisi",
"dolorccb": "pariatur in",
"eiusmod94": "culpa exercitation tempor deserunt"
},
"location": {
"latitude": 95229562.92556664,
"longitude": -96622601.0764705,
"accuracy": 36701747.652133465
},
"device_current_state": {
"time_since_start_ms": 11072060,
"battery_level": -84232337.02036467,
"data_connection_type": "in eiusmod in ex dolore",
"data_connection_type_detail": "ullamco dolor ex aute occa",
"gps_state": false,
"total_system_memory_usage_bytes": 3388989,
"disk_space_free_bytes": 64499047,
"external_disk_space_free_bytes": 85198972,
"cpu": "culpa exerc",
"system_memory_available_bytes": 10853264.360540748,
"system_memory_low": false,
"system_memory_threshold_bytes": 39663588.05889803,
"application_memory_available_bytes": -18402065.272555396,
"application_memory_max_bytes": -28878159.212003946,
"application_memory_total_bytes": 16887590.291536763,
"device_orientation": "LandscapeLeft",
"status_bar_orientation": "landscape"
},
"is_goal_defined": false,
"lifetime_value_change": false,
"lifetime_value_attribute_name": "adipisicing veniam",
"data_connection_type": "enim",
"event_num": -93170864,
"view_controller": "irure ipsum ullamco",
"is_main_thread": false,
"canonical_name": "velit consectetur",
"event_system_notification_info": {
"type": "gdpr_change"
}
}
}
],
"batch": {}
}
results: [
{
data: {
match: {
type: 'screen_view',
criteria: {
screen_name: 'Test Screen View',
},
},
validation_errors: [
{
error_pointer: '#/data',
key: 'data',
expected: 'custom_flags',
schema_keyword: 'required',
validation_error_type: 'missing_required',
},
],
},
event_type: 'validation_result',
},
],
The following rate limits are enforced for all requests to the Data Planning API regardless of the data localization pod used.
Resource | Limits | Details |
---|---|---|
Requests per minute per account | 3000 requests per minute | This limit applies to all GET, POST, and PATCH API actions. |
Requests per minute per organization | 6000 requests per minute | This limit applies to all GET, POST, and PATCH API actions. |
Was this page helpful?