Cordial's powerful real-time segmentation and personalization is inherently reliant on the data you make available in the platform. As the developer, it's your job to get relevant data flowing into the platform to enable the marketer to build dynamic, personalized messages for your customers.
API First and Developer Friendly
The Cordial platform was built with the developer in mind. A robust RESTful API is available that gives you access to practically all of the platform's functionality using industry standard GET, POST, PUT, and DELETE calls.
Cordial also provides a suite of JavaScript listeners that can be embedded on your website for a seamless flow of real-time data to your account.
About the Data
Cordial uses a document-based and search-based database to store all data in the following set of collections.
Collection | Description |
---|---|
Contact Collection | Stores data specific to a contact including channels, attributes, list membership and cart items. |
Events (Contact Activities) Collection | Stores event data specific to messages (opens, clicks, etc.) or any custom named event. |
Product Collection | Stores data from a product catalog. Typically developers will update this collection on a nightly or weekly basis. This data can be used to embellish an email, but is not used for audience search. |
Orders Collection | Stores order data. This can hold specific order details and can be used for building an audience. |
Supplements Collection | Stores additional data (store locations, coupon codes, message content, etc.) that doesn’t fit into one of the above collections. |
Watch the Data Overview video to learn more:
RESTful API
Cordial's API gives you access to practically all of the platform's functionality, such as importing and exporting contacts, event, order, product, and message data—as well as sending batch and triggered messages and other job-related activities. Below are some recommended links to get you started with Cordial's API:
In our documentation, we have grouped API calls according to the following resources:
- Contact Management
- Orders, Products, and Supplements
- Message Creation and Delivery
- Operations Related
API Testing
For testing and documentation needs, we built a custom implementation of Swagger to test all available API calls. Learn about using swagger to access and test cordial APIs here.
Or jump right in here: https://api.cordial.io/docs/v2. You'll first need to generate an API key.
Embedded JavaScript Listeners
To transfer one-way data using a client-side approach, we built JavaScript listeners that can be embedded on a website to identify visitors and pass contact profile data, custom named events, orders, and cart items to your account.
Note: Our JavaScript listeners also store certain anonymous data about a site visitor and then pass that data to the appropriate collection once the contact is identified.
Learn more about embedded JavaScript listeners here.
Watch the JavaScript video to learn more:
Recommended Data Integrations
Your industry and marketing strategy will determine how you collect and store data. Here are some suggestions to help you get started.
- Contact attribute data: Contact data is paramount to any marketing strategy and can be passed to Cordial using the following methods:
- Via the API using the POST /contacts and POST /contactimports.
- Via javascript using the cordial.contact() method.
- Contact Activity Events: Events (also referred to as contact activities) such as cart abandon and browse abandon are essential to triggered messaging strategies. They can be sent to Cordial:
- Via the API using the POST /contactactivities call.
- Via JS using the cordial.event() method for custom named events.
- Cart Items: Cordial stores cart items in the contact collection and can be used for populating message content in cart abandonment messages. Cart items can be passed using the following:
- Via the API using POST /contacts/{primary_key}/cart or POST /contacts/{primary_key}/cartitems.
- Via JS using cordial.cartitem()
- Order Data: Order data can be utilized in the content of a message as well as to build an audience. It is used in replenishment campaigns, order surveys, and order confirmation messages—and can be sent using the API or JS. When using order data for sending order confirmation messages, we recommend using the API method.
- Via the API using the POST /orders call.
- Via JS using the cordial.order() method.
- Product Data: Product data is used in message content and should be updated on a recurring basis to maintain a current catalog.
- Via the API using the POST /products and POST /productimports calls.
Note: Product data is also updated in the product collection when it is passed along with order data.
- Via the API using the POST /products and POST /productimports calls.
Additional Resources
- JSON validator: JSONLint is an awesome tool for checking your JSON for errors when making API calls. Sometimes it's just a misplaced comma that is causing the problem!
- HTML, JS, and JSON beautifier: jsbeautifier.org will beautify your code and make it easier to read.
- DNS lookup: whatsmydns.net/#NS checks the current IP address of your domain name and DNS record information against multiple name servers located in different parts of the world.
- Postman: An alternative to Swagger for testing API calls is Postman.
Comments
0 comments
Please sign in to leave a comment.