MobileCommons - Civis Integration
The MobileCommons integration in Platform allows users to import data from MobileCommons into a Civis table and export data from Platform into MobileCommons. This integration uses the MobileCommons API. Generally, each resource in the integration corresponds with an endpoint in the MobileCommons API.
If you’re interested in using this integration, please request access by submitting a ticket from the Help widget in Platform. Once you have access, you can create your script in Platform by navigating to Code → Scripts → More Script Templates and search for "Civis to MobileCommons" or 12841.
Civis to MobileCommons Export
Custom Script
The Civis to MobileCommons export script runs as a templated custom script in the Civis Platform. The script accepts the following parameters:
MOBILECOMMONS (required)
The user's MobileCommons API key saved in Platform as a Civis custom credential. Different from the Company Key (below).
CUSTOM_HOSTNAME
A custom MobileCommons API hostname. For most clients the default value of secure.mcommons.com should be used.
EXPORT_TYPE (required)
The MobileCommons resource to export. One of add_group_member, remove_group_member, profile_update, profile_opt_out, send_message, send_mms, schedule_broadcast, reschedule_broadcast, unschedule_broadcast, add_tag, remove_tag, edit_attachment, clear_conversation, profile_update, attribute. A detailed description of each resource is provided below (MobileCommons Export Resources).
COMPANY
An optional string identifying the company within MobileCommons. Will be used to authorize the credential passed.
CLUSTER (required)
The cluster in Platform that contains the table or view to be exported to MobileCommons.
CLUSTER_CREDENTIAL (required)
A valid credential for the Platform cluster chosen.
QUEUE_TABLE (required)
The schema which to export data from Platform to MobileCommons. Required table fields are listed below.
RESPONSE_TABLE
Optional table in Platform to store MobileCommons API responses. Will be stored in the same cluster as the export data table or view.
EXISTING_TABLE_ROWS (required)
One of drop, append, truncate, merge, will determine how existing table rows in the response table in Civis Platform will be handled when running additional syncs.
MobileCommons Export Resources
The following resources are available for exporting data from Civis Platform to MobileCommons. To create new resources in Mobile commons the following fields are accepted.
Add Group Member
To add one or more profiles to a group. The following fields are accepted:
- group_id (required)
- phone_number (required, can include multiple, comma-separated, numbers)
Remove Group Member
To remove one or more profiles from a group. The following fields are accepted:
- group_id (required)
- phone_number (required, can include multiple, comma-separated, numbers)
Profile Update
To create or update a profile. The following fields are accepted:
- phone_number (required)
- email
- postal_code
- first_name
- last_name
- street1
- street2
- city
- state
- country
- Custom Column (Any custom column name)
- opt_in_path_id: This will subscribe the user to this campaign and send the message flow in this opt-in path. The value should be your opt-in path key.
Profile Opt-Out
Opt a profile out of one or more campaigns and subscriptions
- phone_number (required)
- campaign_id - Campaign to opt out of (Defaults to all campaigns)
- subscription_id - Subscription to opt out of (Defaults to all subscriptions.)
Send Message
Send a message as part of a campaign.
- campaign_id (required)
- body (required)
- phone_number (required)
- attachment_id
- previous_id
Send MMS
Send a multimedia message as part of a campaign.
- campaign_id (required)
- body (required)
- phone_number (required)
- attachment_id
- uploaded_attachment
Schedule Broadcast
Schedule a campaign broadcast.
- campaign_id (required)
- body (required)
- time (ISO-8601 format, e.g. 2008-12-31T12:34:56)
Reschedule Broadcast
- broadcast_id (required)
- time (required) (ISO-8601 format, e.g. 2008-12-31T12:34:56)
Unschedule Broadcast
To cancel a scheduled broadcast
- broadcast_id (required)
Add Tag
To add a tag.
- tag (required)
At least one of the following:
- campaign_id
- optin_path_id
- mconnect_id
- broadcast_id
Remove Tag
To remove a tag.
- tag (required)
At least one of the following:
- campaign_id
- optin_path_id
- mconnect_id
- broadcast_id
Edit Attachment
- attachment_id (required)
- name (required)
Clear Conversation
- campaign_id (required)
- phone_number (required)
Profile Update Attribute
To update an attribute of an existing profile (will not create a new profile)
- phone_number (required)
- attribute (required)*
- attribute_value (required)
- save_behavior (required)**
*attribute must be one of first_name, last_name, email, street1, street2, city, state, country, constituent_id, or the custom fields
**save_behavior must be one of always_create or create_if_key_value_not_exists
Comments
0 comments
Please sign in to leave a comment.