Best practices for Message Center message removal

This best practices guide is designed to outline some steps that can be taken to ensure your Message Center messages display as expected, are removed from devices automatically once they are no longer applicable, and gives you access to the necessary information for a manual message removal.

Testing on a device

Testing on a device can be helpful in avoiding typos, ensuring the message displays as expected, and confirming links are properly configured prior to the message reaching your audience. When removing a Message Center message, a test device can be used to confirm a successful removal. See our documentation on Test Devices for more information on identifying and setting up your devices.

Using an expiry

For time-sensitive messages include an expiry time, which automatically removes messages from user's inbox at the specified time. This is useful in case an error was made or anything that renders an existing message obsolete or inaccurate. Below is an example of a Message Center message that pushes to local time and includes an expiry.

{  
   "schedule":{  
      "local_scheduled_time":"2018-01-17T12:00:00"
   },
   "push":{  
      "audience":"all",
      "device_types":[  
         "ios",
         "android"
      ],
      "notification":{  
         "alert":"Taco Tuesday"
      },
      "message":{  
         "title":"Taco Tuesday",
         "body": "<html><h1>Let's Eat!</h1></html>",
         "content_type":"text/html",
         "expiry":"2018-01-25T12:00:00"
      }
   }
}

 

Logging all API requests and responses

Please log your full API requests and our API responses to you. The response includes both the Push ID and Message ID which are necessary for Message Center message removal. Below is an example of a standard response.


{
    "ok": true,
    "operation_id": "fe60a5e1-b4a0-49e3-b6b3-97649d39e88f",
    "push_ids": [
        "RnYGTkZZTfKkdVCazctmXQ"
    ],
    "message_ids": [
        "RnYGTkZZTfKkdVCazctmXQ"
    ],
    "content_urls": []
}

 

For messages that push to local time, a Push ID is assigned to each time zone. This means that for each push to local time message there can be up to 42 Push IDs. To remove a local delivery message the Push ID for each time zone is required. Below is an example of a response for a push to local time message.

 

{
    "ok": true,
    "operation_id": "b7e227d3-e0d8-4f18-844e-1e66531f9b07",
    "schedule_urls": [
        "https://go.urbanairship.com/api/schedules/d93631a3-1d98-4b92-b3ec-0335161df879"
    ],
    "schedule_ids": [
        "d93631a3-1d98-4b92-b3ec-0335161df879"
    ],
    "schedules": [
        {
            "url": "https://go.urbanairship.com/api/schedules/d93631a3-1d98-4b92-b3ec-0335161df879",
            "schedule": {
                "local_scheduled_time": "2017-01-15T12:00:00"
            },
            "push": {
                "audience": "all",
                "device_types": [
                    "ios",
                    "android"
                ],
                "notification": {
                    "alert": "Taco Tuesday"
                },
                "message": {
                    "title": "Taco Tuesday",
                    "body": "<html><h1>Let's Eat!</h1></html>",
                    "content_type": "text/html",
                    "content_encoding": "utf-8",
                    "expiry": "2017-01-27T12:00:00"
                }
            },
            "push_ids": [
                "4dT0YF_gTKSdBA9ERJWZfA",
                "Ckb2koGwQTKcaEagIjDiJw",
                "Ftt9L2S5S4-Zj-ddUdxdRg",
                "UcBhzSueQQK82R7M4_dlag",
                "WRlo0LIkQ12fUztt-VWXBg",
                "1xG0bIjmQfOdeZcNxWNpDQ",
                "S2e5vU56R8yNBJ0tFq9VeQ",
                "5mCBmBZvRnykYHPRqkErzg",
                "kseS5qgKTs2cvQg3AExVcg",
                "cIolwZ-XQo2qk6ApSv5fSA",
                "wCxpUC_QQZuZ2imtk-ElIg",
                "-WWYmNcUQVKYhQmFO34Mow",
                "rl83oStGROWiavp2zT6V-g",
                "9JxIsMngQKm-f08p1P2BGg",
                "zbmYXUFDSCO_kRq30S5CDA",
                "NI5v_5o5RFeDox-pd3gwLA",
                "IcCBj6uwSEKXWW2inkJkbQ",
                "I1kFg9msQpSvfF0n4dfYqw",
                "8mfY0xGmQX6aEmT1FtRUkw",
                "bkhjjKxEQMadtV0T-L1Nbw",
                "FivrhUBUQVqWxlHoQlTJJQ",
                "ZpF3YiItR5icjahCO8V8cQ",
                "IRbpajNvTsWbpNq9eLHMqw",
                "GwpZv87kRnmfsSjzgpUMfQ",
                "7tELsqWySBexOcm81HxAhg",
                "Qo4lAJRQRBm4Nvkb2486Fw",
                "Im4yhpYqQNai9opbS5voFQ",
                "IJAQ4_xyQ9WIEzw05glt4Q",
                "E1Sdy2uKRmyTMSRG9ymlrA",
                "JsjFhyI1RSOYsRjitJ1FkA",
                "9gIj_AE3QRyYozszn0KMog",
                "UcQgquc0SJqAtUte05jQIg",
                "yT1hZ_rnTqGUfnQAFZT8IQ",
                "ZPcUhlmtTXO8SIM8kGM5Yg",
                "DmqFgab0Re6aLDlhVNWolA",
                "Q8khuMCMTgS1j06vB1H8HQ",
                "NOQC47gdQyOgpYimIifXNQ",
                "UVyfHSxMRuudB8oThmNAxw",
                "AzVyvxTjT5Cthpi1i4aIqg",
                "XUIj1-ohR32dVmWT4UvcLw",
                "fglT1_URQ4mecyjp1R2GwQ",
                "bPLEC3uDQiymXat57U8jFg"
            ]
        }
    ]
}

The Push IDs for local delivery messages created via the Go Dashboard can be retrieved via the Schedules API prior to the message being sent. Read our documentation on Schedules.

Related Content: