1. Home
  2. Advanced
  3. API
  4. Sending Checkbox or Multiselect data into Jetpack CRM via API

Sending Checkbox or Multiselect data into Jetpack CRM via API

Notice: We hope to start work on a new API (v3) soon, but in the meantime we’re sharing some useful tips on how to get the most out of the current Jetpack CRM API. You can read more about the CRM API here, and see the current API docs here.

Posting checkbox data into Jetpack CRM (via API)

From v4.0.7 of Jetpack CRM you can provide data for Checkbox custom fields in a number of ways. This version brings a better way of processing inbound data which makes setting these fields very easy.

Before we get started, this guide is for:

  • Those who are using Jetpack CRM to add contacts or other CRM objects
  • Have a custom field with the type of Checkbox

How to pass Checkbox custom field data into the API:

When sending data into your CRM API you can now pass checkbox/multiselect options by providing them as an ARRAY or a CSV String. Both represent “What’s selected”.

So here’s an example using custom fields and Contacts.

If you had a custom field setup as follows:

You could send the following to the API (as JSON):

{
  "email" : "example@email.com",
  "status" : "Customer",
  "fname" : "Example",
  "lname" : "Customer",
  "tags" :  ["New Theme" , "Email Campaign"],
  "food-type": "Vegetarian,Vegan",
  "meal-choice": ["Starter","Main"]
}

Note how you could pass Starter,Main or array('Starter','Main') for the second custom field, and both would work. We provide coverage for both formats.

When we send that into the API we then get a new contact added as follows:

Again, this is a small snippet designed to help our developer users until we release API v3.

You can read more about the CRM API here, and see the current API docs here.

Updated on November 4, 2020

Was this article helpful?

Related Articles

Still not found an answer?
If you've searched the knowledge base and still can't find a solution, please submit a ticket.
CONTACT SUPPORT