Send a mobile app message to multiple devices using a lookup key field

The Push to Contact API allows an API developer to send app messages to mobile devices, using various formats to address the devices in your mobile database. Here is an excerpt of the Push to Contact API showing the various addressing formats.

PushContact

AttributeRequiredDescriptionData type
contactIDNoAcoustic Campaign recipientId takes precedence over LookUpKeyFieldsLong
LookUpKeyFieldsNolist of lookup key fields to find contact. For Push, the Mobile user Id can be specified without specifying the column nameArray[LookUpkeyField]
channel (DeviceLookup)NoLookup key fields to find a specific devicemodel
personalizationNoMap of key value pairs for personalizationMap ad

One of the simplest means of addressing users is to use the lookup key fields used to in the setup of the mobile enabled database i.e. the mobile user id field. To do this we would use the following JSON within the request packet:

{
  "contacts": [
    {
      "lookupKeyFields": [
        {
          "channel": "PUSH",
          "value": "E0DfBHIxMhXsezOx"
        }
      ]
    }
  ]
}

In this format the system will only search the mobile user id lookupkey field, so this could offer some performance improvements.

Now to send to multiple devices with one API call, you would need to use the following format in your contacts section.

{
  "contacts": [
    {
      "lookupKeyFields": [
        {
          "name": "Mobile User ID",
          "value": "k1qxl1FI6mSKmA7U"
        }
      ]
    },
    {
      "lookupKeyFields": [
        {
          "name": "Mobile User ID",
          "value": "sSj1DCwGhjeRWhI4"
        }
      ]
    }
  ]
}

We could then also change the format of this call to use the ‘channel’:’PUSH’ variation instead of adding the name of the mobile user id field. You should now be able to address multiple devices using this format:

{
  "contacts": [
    {
      "lookupKeyFields": [
        {
          "channel": "PUSH",
          "value": "k1qxl1FI6mSKmA7U"
        }
      ]
    },
    {
      "lookupKeyFields": [
        {
          "channel": "PUSH",
          "value": "sSj1DCwGhjeRWhI4"
        }
      ]
    }
  ]
}