# mParticle

> Send events and user attributes, read user profiles, and manage apps and audiences in mParticle.

App · 22 actions. Web page: https://docs.lodol.com/docs/integrations/mparticle

## Actions

### Add a platform to an app

Add a platform to an app. Its new key and secret are in the answer, the only time the secret is shown.

**Inputs**

- App (`app_id`, text, required): The app.
- Platform (`os`, text, required): The platform to add. One of: `iOS`, `tvOS`, `Android`, `MobileWeb`, `Roku`, `Alexa`, `SmartTV`, `FireTV`, `Xbox`.
- Profile merging (`profile_merging`, true/false): Merge user profiles on this platform.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "access_keys": [
          {
            "data_type": "example",
            "key": "example",
            "secret": "example"
          }
        ],
        "application_id": 1,
        "crash_handling": "example",
        "created_on": "example",
        "last_modified_on": "example",
        "network_performance": "example",
        "os": "example",
        "profile_merging": true,
        "push_attribution_timer": 1,
        "social_mode": "example"
      }
    ],
    "dataType": "example"
  }
}
```

### Create an app

Create an app with one or more platforms. Each new platform's key and secret are in the answer, the only time the secret is shown.

**Inputs**

- Name (`name`, text, required): The app's name.
- Platforms (`platforms`, list, required): The platforms the app runs on. One or more of: `iOS`, `tvOS`, `Android`, `MobileWeb`, `Roku`, `Alexa`, `SmartTV`, `FireTV`, `Xbox`.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_on": "example",
        "data_type": "example",
        "id": 1,
        "last_modified_on": "example",
        "name": "example",
        "platforms": [
          {
            "access_keys": [
              {
                "data_type": "example",
                "key": "example",
                "secret": "example"
              }
            ],
            "application_id": 1,
            "crash_handling": "example",
            "created_on": "example",
            "last_modified_on": "example",
            "network_performance": "example",
            "os": "example",
            "profile_merging": true,
            "push_attribution_timer": 1,
            "social_mode": "example"
          }
        ]
      }
    ],
    "dataType": "example"
  }
}
```

### Delete an app

Delete an app. Remove its platforms first: an app with platforms can't be deleted.

**Inputs**

- App (`app_id`, text, required): The app.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "app_id": "example",
    "deleted": true
  }
}
```

### Delete an audience

Delete a real-time audience. It stops being sent to its outputs.

**Inputs**

- Audience (`audience_id`, text, required): The audience.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "audience_id": "example",
    "deleted": true
  }
}
```

### Find a user profile

Find a user's profile by an identity, such as their customer ID. The identity type must be one your identity strategy never changes.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace.
- Return (`fields`, list, required): The parts of the profile to return. One or more of: `user_identities` (User identities), `user_attributes` (User attributes), `audience_memberships` (Audience memberships), `device_identities` (Device identities), `attribution`, `partner_identities` (Partner identities).
- Identity type (`identity_type`, text, required): The kind of identity, such as customer_id. One of: `customer_id` (Customer id), `email`, `other`, `other_id_2` (Other id 2), `other_id_3` (Other id 3), `other_id_4` (Other id 4), `mobile_number` (Mobile number).
- Identity value (`identity_value`, text, required): The user's value for that identity.
- Environment (`environment_type`, text): Whether to look in live data or test data. Live data if left empty. One of: `production`, `development`.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "attribution": [
      {}
    ],
    "audience_memberships": [
      {
        "audience_id": 1,
        "audience_name": "example",
        "expiration_timestamp_ms": 1
      }
    ],
    "created_timestamp_ms": 1,
    "device_identities": [
      {
        "encoding": "example",
        "type": "example",
        "value": "example"
      }
    ],
    "is_opted_out": true,
    "last_stored_timestamp_ms": 1,
    "mpid": "example",
    "partner_identities": {},
    "user_attributes": {},
    "user_identities": [
      {
        "encoding": "example",
        "type": "example",
        "value": "example"
      }
    ]
  }
}
```

### Get a calculated attribute

Get a calculated attribute and its definition.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace.
- Calculated attribute ID (`calculated_attribute_id`, number, required): The calculated attribute's ID, from List calculated attributes.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "activated_by": "example",
    "activated_on": "example",
    "active_definition": {},
    "audience_count": 1,
    "created_by": "example",
    "created_on": "example",
    "description": "example",
    "draft_definition": {},
    "id": 1,
    "last_modified_by": "example",
    "last_modified_on": "example",
    "name": "example"
  }
}
```

### Get a feed

Get a partner feed's settings.

**Inputs**

- Feed ID (`feed_id`, text, required): The feed's ID, from List feeds.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_on": "example",
        "data_type": "example",
        "id": "example",
        "is_debug": true,
        "module_name": "example",
        "name": "example",
        "os": "example",
        "profile_protection_type": "example",
        "settings": [
          {
            "name": "example",
            "value": "example"
          }
        ]
      }
    ],
    "dataType": "example"
  }
}
```

### Get a user profile

Get a user's profile by mParticle ID: identities, attributes and audiences.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace.
- mParticle ID (`mpid`, text, required): The user's mParticle ID (MPID).
- Return (`fields`, list, required): The parts of the profile to return. One or more of: `user_identities` (User identities), `user_attributes` (User attributes), `audience_memberships` (Audience memberships), `device_identities` (Device identities), `attribution`, `partner_identities` (Partner identities).

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "attribution": [
      {}
    ],
    "audience_memberships": [
      {
        "audience_id": 1,
        "audience_name": "example",
        "expiration_timestamp_ms": 1
      }
    ],
    "created_timestamp_ms": 1,
    "device_identities": [
      {
        "encoding": "example",
        "type": "example",
        "value": "example"
      }
    ],
    "is_opted_out": true,
    "last_stored_timestamp_ms": 1,
    "mpid": "example",
    "partner_identities": {},
    "user_attributes": {},
    "user_identities": [
      {
        "encoding": "example",
        "type": "example",
        "value": "example"
      }
    ]
  }
}
```

### Get an app

Get an app and its platforms.

**Inputs**

- App (`app_id`, text, required): The app.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_on": "example",
        "data_type": "example",
        "id": 1,
        "last_modified_on": "example",
        "name": "example",
        "platforms": [
          {
            "access_keys": [
              {
                "data_type": "example",
                "key": "example",
                "secret": "example"
              }
            ],
            "application_id": 1,
            "crash_handling": "example",
            "created_on": "example",
            "last_modified_on": "example",
            "network_performance": "example",
            "os": "example",
            "profile_merging": true,
            "push_attribution_timer": 1,
            "social_mode": "example"
          }
        ]
      }
    ],
    "dataType": "example"
  }
}
```

### List a workspace's audiences

List the active real-time audiences of one workspace.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace.

**Outputs**

- `data` (list): The response from mParticle.

**Example output**

```json
{
  "data": [
    {
      "added_last_24_hours": 1,
      "connected_outputs": [
        {
          "data_type": "example",
          "provider_name": "example"
        }
      ],
      "created_by": "example",
      "created_on": "example",
      "dropped_last_24_hours": 1,
      "external_name": "example",
      "id": 1,
      "is_calculated": true,
      "last_modified_by": "example",
      "last_modified_on": "example",
      "name": "example",
      "size": 1,
      "status": "example",
      "workspaces": [
        {
          "created_on": "example",
          "data_type": "example",
          "id": "example",
          "name": "example"
        }
      ]
    }
  ]
}
```

### List accounts

List the accounts the credentials can reach.

**Inputs**: None.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_on": "example",
        "data_type": "example",
        "id": 1,
        "last_modified_on": "example",
        "name": "example"
      }
    ],
    "dataType": "example"
  }
}
```

### List apps

List the account's apps and their platforms.

**Inputs**: None.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_on": "example",
        "data_type": "example",
        "id": 1,
        "last_modified_on": "example",
        "name": "example",
        "platforms": [
          {
            "access_keys": [
              {
                "data_type": "example",
                "key": "example",
                "secret": "example"
              }
            ],
            "application_id": 1,
            "crash_handling": "example",
            "created_on": "example",
            "last_modified_on": "example",
            "network_performance": "example",
            "os": "example",
            "profile_merging": true,
            "push_attribution_timer": 1,
            "social_mode": "example"
          }
        ]
      }
    ],
    "dataType": "example"
  }
}
```

### List audiences

List the account's active real-time audiences, with their size and outputs.

**Inputs**: None.

**Outputs**

- `data` (list): The response from mParticle.

**Example output**

```json
{
  "data": [
    {
      "added_last_24_hours": 1,
      "connected_outputs": [
        {
          "data_type": "example",
          "provider_name": "example"
        }
      ],
      "created_by": "example",
      "created_on": "example",
      "dropped_last_24_hours": 1,
      "external_name": "example",
      "id": 1,
      "is_calculated": true,
      "last_modified_by": "example",
      "last_modified_on": "example",
      "name": "example",
      "size": 1,
      "status": "example",
      "workspaces": [
        {
          "created_on": "example",
          "data_type": "example",
          "id": "example",
          "name": "example"
        }
      ]
    }
  ]
}
```

### List calculated attributes

List a workspace's calculated attributes, optionally by name.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace.
- Name (`name`, text): Only the calculated attribute with this name.

**Outputs**

- `data` (list): The response from mParticle.

**Example output**

```json
{
  "data": [
    {
      "activated_by": "example",
      "activated_on": "example",
      "active_definition": {},
      "audience_count": 1,
      "created_by": "example",
      "created_on": "example",
      "description": "example",
      "draft_definition": {},
      "id": 1,
      "last_modified_by": "example",
      "last_modified_on": "example",
      "name": "example"
    }
  ]
}
```

### List dashboard users

List the people who can sign in to the account.

**Inputs**: None.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "data_type": "example",
        "email": "example",
        "first_name": "example",
        "last_name": "example"
      }
    ],
    "dataType": "example"
  }
}
```

### List feeds

List the partner feeds (inputs from other services) of a workspace.

**Inputs**

- Workspace (`workspace_id`, text, required): The workspace.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_on": "example",
        "data_type": "example",
        "id": "example",
        "is_debug": true,
        "module_name": "example",
        "name": "example",
        "os": "example",
        "profile_protection_type": "example",
        "settings": [
          {
            "name": "example",
            "value": "example"
          }
        ]
      }
    ],
    "dataType": "example"
  }
}
```

### List services

List the services (outputs) mParticle can forward data to, with their settings.

**Inputs**: None.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "data_type": "example",
        "name": "example",
        "settings": [
          {
            "description": "example",
            "is_required": true,
            "name": "example",
            "type": "example"
          }
        ]
      }
    ],
    "dataType": "example"
  }
}
```

### List workspaces

List the workspaces in the account.

**Inputs**: None.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_on": "example",
        "data_type": "example",
        "id": "example",
        "name": "example"
      }
    ],
    "dataType": "example"
  }
}
```

### Remove a platform from an app

Remove a platform from an app. Data sent with its key stops being accepted.

**Inputs**

- App (`app_id`, text, required): The app.
- Platform (`os`, text, required): The platform to remove. One of: `iOS`, `tvOS`, `Android`, `MobileWeb`, `Roku`, `Alexa`, `SmartTV`, `FireTV`, `Xbox`.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "app_id": "example",
    "deleted": true
  }
}
```

### Rename an app

Change an app's name.

**Inputs**

- App (`app_id`, text, required): The app.
- Name (`name`, text, required): The app's new name.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "name": "example"
  }
}
```

### Send an event

Send a custom event for a user, with any user attributes to update at the same time.

**Inputs**

- Event name (`event_name`, text, required): The event's name, such as Signed Up.
- Event type (`custom_event_type`, text): The kind of event, which mParticle uses to group events. One of: `other`, `navigation`, `location`, `search`, `transaction`, `user_content` (User content), `user_preference` (User preference), `social`, `media`, `attribution`.
- Event attributes (`custom_attributes`, object): The event's attributes, by name, such as plan.
- Customer ID (`customer_id`, text): The user's customer ID.
- Email (`email`, text): The user's email address.
- mParticle ID (`mpid`, text): The user's mParticle ID (MPID), if known.
- User attributes (`user_attributes`, object): User attributes to set, by name, such as $FirstName or plan.
- Environment (`environment`, text): Whether this is live data or a test. One of: `production`, `development`.
- Request ID (`source_request_id`, text): A unique ID for this request, so a repeat is only counted once.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "accepted": true
  }
}
```

### Update user attributes

Set attributes on a user's profile without sending an event.

**Inputs**

- Customer ID (`customer_id`, text): The user's customer ID.
- Email (`email`, text): The user's email address.
- mParticle ID (`mpid`, text): The user's mParticle ID (MPID), if known.
- User attributes (`user_attributes`, object, required): The attributes to set, by name, such as $FirstName or plan.
- Environment (`environment`, text): Whether this is live data or a test. One of: `production`, `development`.

**Outputs**

- `data` (object): The response from mParticle.

**Example output**

```json
{
  "data": {
    "accepted": true
  }
}
```
