{"_id":"57ed14040e3cfa1900289dc1","version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":26,"createdAt":"2015-02-23T17:30:32.501Z","releaseDate":"2015-02-23T17:30:32.501Z","categories":["54eb63b959b1172100334faf","54eb63b959b1172100334fb0","54eb63b959b1172100334fb1","54eb63b959b1172100334fb2","54ed8dd4ab373e2300f50eae","54ed99b2ab373e2300f50ede","55153a6de68daa2f00cff838","551546edbc466623002afe72","5515472ac28d6125001b8884","55154749c28d6125001b8885","555d9b4106dfec0d00d38ea7","5613e06e433e5735007c7708","5624bbb785a31117001c5403","56669e857cc81e0d00253f8e","568b8d837a42220d00498311","56a632277ef6620d00e2f18a","56d8147c3eb4dd0b00201aac","57a9ce2fac6db30e000d7efd","57a9cf4e944ea60e00dc3f74","58172386715dce0f00da4aa0","582dc59ee1b8692300c0dd03","589b19b4fec2730f0082e040","58b04a023529383900a759b5","58b92d1598157a0f004869bf","592e7685c58275000f20174f","59392839e376d4002f8a0474","59393064e376d4002f8a05a1","5947ae0d4005e2000f3a4fec","594a74df1d1de5001ab3517a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"project":"54eb50e5615ffc1900305a16","parentDoc":null,"__v":0,"category":{"_id":"56669e857cc81e0d00253f8e","project":"54eb50e5615ffc1900305a16","__v":8,"pages":["568ceacb8a7ca5190039643a","5693a7995f1c951900644b25","5698e793d36db20d00ddba45","56a0ce7441766e0d00b28cf8","56a0d36544f3d80d00a2c242","56a0d3e0aca0730d003e3475","56a5ecf7b91d8d0d008349cc","56d595dba0b5600b000b1e75"],"version":"54eb63b859b1172100334fae","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-12-08T09:10:29.254Z","from_sync":false,"order":6,"slug":"omni-channel-messaging","title":"OMNI channel messaging"},"user":"54eb4fdedf7add210007b29b","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-29T13:15:48.533Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":10,"body":"## Why OMNI?\n\nConsider the following scenario: a travel agency has a large number of customers that are receiving SMS message notifications when their itinerary changes, flight gets delayed or canceled and different booking reservations are confirmed. While an SMS is a very convenient way to get notified, this channel might not be all that reliable when your customers are traveling all around the world. People sometimes switch their phones off because of the roaming charges, or purchase local SIM cards so they have local network prices and data packages. And finally, spending time on the road means they can run out of battery life. \n\nThis is not the only scenario in which SMS message is not the most efficient option for reaching your customers so a backup option should be introduced. While most customers can still be reached over SMS, other communication channels like email could fill in the gaps.\n\n## Solution\n\nThis is where our Omni solution fits in perfectly. We can set it up in a way that all SMS messages that don’t get delivered in a given time frame to customer devices, **fall back on email** which will then be sent instead and wait for the customers safely in their inbox. Fallback logic happens automatically so the travel agency would still send only one message.\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Email setup\",\n  \"body\": \"Learn more about email and its initial account setup: [Email introduction](/docs/email-introduction)\"\n}\n[/block]\nHere is what we are going to go over in this tutorial:\n\n1.  Creating an Omni scenario in which we will define order of communication channels and sender information.\n2.  We will use this scenario to deliver an SMS message first. If the SMS is not delivered within 3 minutes, we will send the message over email.\n3.  In the end, we will acquire message logs and examine how the message was delivered.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 1: Creating an Omni scenario\"\n}\n[/block]\nThe first step is to create an **Omni scenario**. In the Omni scenario configuration you need to define the steps which will be sequentially executed.  The key parameters are the **`channel`** and **`from`**, respectively identifying the communication channels and senders for each communication channel.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /omni/1/scenarios HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{\\n  \\\"name\\\": \\\"SMS with e-mail fallback\\\",\\n  \\\"flow\\\": [\\n    {\\n      \\\"from\\\": \\\"Travel agency\\\",\\n      \\\"channel\\\": \\\"SMS\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"info:::at:::travelagency.com\\\",\\n      \\\"channel\\\": \\\"EMAIL\\\"\\n    }\\n  ],\\n  \\\"default\\\": false\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## Response format \n\nIf successful, response header HTTP status code will be `200 OK` and the scenario will be created, as shown in the example below.\n\nIf you try to create the scenario without authorization, you will receive the `401 Unauthorized` error.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"key\\\": \\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n  \\\"name\\\":\\\"SMS with e-mail fallback\\\",\\n  \\\"flow\\\": [\\n    {\\n      \\\"from\\\": \\\"Travel agency\\\",\\n      \\\"channel\\\": \\\"SMS\\\"\\n    },\\n    {\\n      \\\"from\\\": \\\"info@travelagency.com\\\",\\n      \\\"channel\\\": \\\"EMAIL\\\"\\n    }    \\n  ],\\n  \\\"default\\\": false\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe **`key`**parameter needs to be stored as it will be used when sending the message. In case you missed it in response, it can be acquired again by calling the [Scenario: Get method](/docs/omni-get-scenario) \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 2: Omni message sending\"\n}\n[/block]\nOnce you’ve created an Omni scenario  (identified by the **`key`** parameter) as described in the previous chapter, you are ready to send your Omni messages through defined SMS and Email communication channels. Firstly, the SMS message will be sent on the defined `phoneNumber`. If for some reason the message is not delivered, the message will then be sent to email as defined in previously created scenario.\n\nThe parameters that should be set are the scenario `key`, `phoneNumber`, `emailAddress` and specific `text` for each communication channels, as shown below.\n\nTo make this example more interesting, let's say that instead of a single traveler, the travel agency needs to send messages to a happy couple (John and Jane Smith) on their honeymoon.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /omni/1/advanced HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{ \\n  \\\"scenarioKey\\\": \\\"AD9E01A5DC7BEE2C2B828D208182A611\\\",\\n  \\\"destinations\\\":[ \\n    { \\n      \\\"to\\\": {\\n        \\\"phoneNumber\\\": \\\"385974241491\\\",\\n        \\\"emailAddress\\\": \\\"john.smith@gmail.com\\\"\\n      }\\n    },\\n    { \\n      \\\"to\\\": {\\n        \\\"phoneNumber\\\": \\\"385972135566111111111\\\",\\n        \\\"emailAddress\\\": \\\"jane.smith@gmail.com\\\"\\n      }\\n    }\\n  ],\\n  \\\"sms\\\": {\\n    \\\"text\\\": \\\"Hello, we are happy to confirm your reservation for the safari trip.\\\",\\n    \\\"validityPeriod\\\":3\\n  },\\n  \\\"email\\\": {\\n    \\\"subject\\\": \\\"Reservation confirmed!\\\",\\n    \\\"text\\\": \\\"Hello, we are happy to confirm your reservation for the safari trip.\\\"\\n   } \\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nIn this example we can see that message can be sent to one or many recipients listed in `destinations` collection. `validityPeriod` is expressed in minutes. If message is not delivered in 3 minutes, an email will be sent as a backup option.\n\n## Response format \n\nIf request was successful, response header HTTP status code will be `200 OK` and the message will be sent.\n\nIf you try to send the message without authorization, you will receive the `401 Unauthorized` error .\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/json\\n\\n{\\n  \\\"bulkId\\\": \\\"b608b611-0fd4-4594-9dea-39656caae30d\\\",\\n  \\\"messages\\\": [\\n    {\\n      \\\"to\\\": {\\n        \\\"phoneNumber\\\": \\\"385974241491\\\",\\n        \\\"emailAddress\\\": \\\"john.smith@gmail.com\\\"\\n      },\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 1,\\n        \\\"groupName\\\": \\\"PENDING\\\",\\n        \\\"id\\\": 7,\\n        \\\"name\\\": \\\"PENDING_ENROUTE\\\",\\n        \\\"description\\\": \\\"Message sent to next instance\\\"\\n      },\\n      \\\"messageId\\\": \\\"05396f95-856d-47e8-bfe7-8ecaff9caa1f\\\"\\n    },\\n    {\\n      \\\"to\\\": {\\n        \\\"phoneNumber\\\": \\\"385972135566111111111\\\",\\n        \\\"emailAddress\\\": \\\"jane.smith@gmail.com\\\"\\n      },\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 1,\\n        \\\"groupName\\\": \\\"PENDING\\\",\\n        \\\"id\\\": 7,\\n        \\\"name\\\": \\\"PENDING_ENROUTE\\\",\\n        \\\"description\\\": \\\"Message sent to next instance\\\"\\n      },\\n      \\\"messageId\\\": \\\"055d6674-096d-4c5e-b0d9-8285f0fd1b55\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"Note that the response does not provide info on if and how the message was delivered. It merely states that the message has been accepted by our server and will be processed according to the created Omni scenario.\"\n}\n[/block]\nDetailed information about delivery will be available in message log. The easiest way to get the message log for the request is to save the `bulkId` value from the response which can later be used to easily filter out the logs.\n\nBesides single `bulkId`, each message has its own unique `messageId`. Message ID can be used to identify failover messages when examining logs. \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Step 3: Getting message logs\"\n}\n[/block]\nMessage logs can be accessed without any filters but such query could potentially return logs of all  messages sent in last 48 hours. By introducing `bulkId` as the filter parameter we can get logs for this specific request.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /omni/1/logs?bulkid=b608b611-0fd4-4594-9dea-39656caae30d HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/json\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nHere is the returned response:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/json\\n\\n{\\n  \\\"results\\\": [\\n    {\\n      \\\"bulkId\\\": \\\"b608b611-0fd4-4594-9dea-39656caae30d\\\",\\n      \\\"messageId\\\": \\\"055d6674-096d-4c5e-b0d9-8285f0fd1b55\\\",\\n      \\\"to\\\": \\\"jane.smith@gmail.com\\\",\\n      \\\"from\\\": \\\"info@travelagency.com\\\",\\n      \\\"text\\\": \\\"Hello, we are happy to confirm your reservation for the safari trip.\\\",\\n      \\\"sentAt\\\": \\\"2016-09-29T14:58:32.117+0000\\\",\\n      \\\"doneAt\\\": \\\"2016-09-29T14:58:32.747+0000\\\",\\n      \\\"messageCount\\\": 1,\\n      \\\"price\\\": {\\n        \\\"pricePerMessage\\\": 0,\\n        \\\"currency\\\": \\\"EUR\\\"\\n      },\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 3,\\n        \\\"groupName\\\": \\\"DELIVERED\\\",\\n        \\\"id\\\": 5,\\n        \\\"name\\\": \\\"DELIVERED_TO_HANDSET\\\",\\n        \\\"description\\\": \\\"Message delivered to handset\\\"\\n      },\\n      \\\"channel\\\": \\\"EMAIL\\\"\\n    },\\n    {\\n      \\\"bulkId\\\": \\\"b608b611-0fd4-4594-9dea-39656caae30d\\\",\\n      \\\"messageId\\\": \\\"055d6674-096d-4c5e-b0d9-8285f0fd1b55\\\",\\n      \\\"to\\\": \\\"385972135566111111111\\\",\\n      \\\"from\\\": \\\"Travel agency\\\",\\n      \\\"text\\\": \\\"Hello, we are happy to confirm your reservation for the safari trip.\\\",\\n      \\\"sentAt\\\": \\\"2016-09-29T14:58:32.070+0000\\\",\\n      \\\"doneAt\\\": \\\"2016-09-29T14:58:32.073+0000\\\",\\n      \\\"messageCount\\\": 1,\\n      \\\"mccMnc\\\": \\\"21910\\\",\\n      \\\"price\\\": {\\n        \\\"pricePerMessage\\\": 0,\\n        \\\"currency\\\": \\\"EUR\\\"\\n      },\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 5,\\n        \\\"groupName\\\": \\\"REJECTED\\\",\\n        \\\"id\\\": 52,\\n        \\\"name\\\": \\\"REJECTED_DESTINATION\\\",\\n        \\\"description\\\": \\\"Invalid destination address.\\\",\\n        \\\"action\\\": \\\"Check to parameter.\\\"\\n      },\\n      \\\"channel\\\": \\\"SMS\\\"\\n    },\\n    {\\n      \\\"bulkId\\\": \\\"b608b611-0fd4-4594-9dea-39656caae30d\\\",\\n      \\\"messageId\\\": \\\"05396f95-856d-47e8-bfe7-8ecaff9caa1f\\\",\\n      \\\"to\\\": \\\"385974241491\\\",\\n      \\\"from\\\": \\\"Travel agency\\\",\\n      \\\"text\\\": \\\"Hello, we are happy to confirm your reservation for the safari trip.\\\",\\n      \\\"sentAt\\\": \\\"2016-09-29T14:58:32.013+0000\\\",\\n      \\\"doneAt\\\": \\\"2016-09-29T14:58:32.697+0000\\\",\\n      \\\"messageCount\\\": 1,\\n      \\\"mccMnc\\\": \\\"21901\\\",\\n      \\\"price\\\": {\\n        \\\"pricePerMessage\\\": 0,\\n        \\\"currency\\\": \\\"EUR\\\"\\n      },\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 3,\\n        \\\"groupName\\\": \\\"DELIVERED\\\",\\n        \\\"id\\\": 5,\\n        \\\"name\\\": \\\"DELIVERED_TO_HANDSET\\\",\\n        \\\"description\\\": \\\"Message delivered to handset\\\"\\n      },\\n      \\\"channel\\\": \\\"SMS\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nIn our case **three** returned log records have the same bulk ID. Two out of three messages have the same messageId because, as you can see, Jane Smith supplied an invalid phone number (too many digits) so an SMS could not be delivered (see message `status` and `channel`). This is why we have additional message log with the same `messageId` confirming that email, as a secondary delivery method, has been successfully delivered. John had no problem receiving the SMS message on his phone, as we can see in the last recorded log.","excerpt":"This page will describe simple methods which will allow You to send messages and retrieve message logs using Email and SMS communication channels.","slug":"omni-channel-email-example","type":"basic","title":"OMNI channel: Email example"}

OMNI channel: Email example

This page will describe simple methods which will allow You to send messages and retrieve message logs using Email and SMS communication channels.

## Why OMNI? Consider the following scenario: a travel agency has a large number of customers that are receiving SMS message notifications when their itinerary changes, flight gets delayed or canceled and different booking reservations are confirmed. While an SMS is a very convenient way to get notified, this channel might not be all that reliable when your customers are traveling all around the world. People sometimes switch their phones off because of the roaming charges, or purchase local SIM cards so they have local network prices and data packages. And finally, spending time on the road means they can run out of battery life. This is not the only scenario in which SMS message is not the most efficient option for reaching your customers so a backup option should be introduced. While most customers can still be reached over SMS, other communication channels like email could fill in the gaps. ## Solution This is where our Omni solution fits in perfectly. We can set it up in a way that all SMS messages that don’t get delivered in a given time frame to customer devices, **fall back on email** which will then be sent instead and wait for the customers safely in their inbox. Fallback logic happens automatically so the travel agency would still send only one message. [block:callout] { "type": "info", "title": "Email setup", "body": "Learn more about email and its initial account setup: [Email introduction](/docs/email-introduction)" } [/block] Here is what we are going to go over in this tutorial: 1. Creating an Omni scenario in which we will define order of communication channels and sender information. 2. We will use this scenario to deliver an SMS message first. If the SMS is not delivered within 3 minutes, we will send the message over email. 3. In the end, we will acquire message logs and examine how the message was delivered. [block:api-header] { "type": "basic", "title": "Step 1: Creating an Omni scenario" } [/block] The first step is to create an **Omni scenario**. In the Omni scenario configuration you need to define the steps which will be sequentially executed. The key parameters are the **`channel`** and **`from`**, respectively identifying the communication channels and senders for each communication channel. [block:code] { "codes": [ { "code": "POST /omni/1/scenarios HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n \"name\": \"SMS with e-mail fallback\",\n \"flow\": [\n {\n \"from\": \"Travel agency\",\n \"channel\": \"SMS\"\n },\n {\n \"from\": \"info@travelagency.com\",\n \"channel\": \"EMAIL\"\n }\n ],\n \"default\": false\n}", "language": "json" } ] } [/block] ## Response format If successful, response header HTTP status code will be `200 OK` and the scenario will be created, as shown in the example below. If you try to create the scenario without authorization, you will receive the `401 Unauthorized` error. [block:code] { "codes": [ { "code": "{\n \"key\": \"AD9E01A5DC7BEE2C2B828D208182A611\",\n \"name\":\"SMS with e-mail fallback\",\n \"flow\": [\n {\n \"from\": \"Travel agency\",\n \"channel\": \"SMS\"\n },\n {\n \"from\": \"info@travelagency.com\",\n \"channel\": \"EMAIL\"\n } \n ],\n \"default\": false\n}", "language": "json" } ] } [/block] The **`key`**parameter needs to be stored as it will be used when sending the message. In case you missed it in response, it can be acquired again by calling the [Scenario: Get method](/docs/omni-get-scenario) [block:api-header] { "type": "basic", "title": "Step 2: Omni message sending" } [/block] Once you’ve created an Omni scenario (identified by the **`key`** parameter) as described in the previous chapter, you are ready to send your Omni messages through defined SMS and Email communication channels. Firstly, the SMS message will be sent on the defined `phoneNumber`. If for some reason the message is not delivered, the message will then be sent to email as defined in previously created scenario. The parameters that should be set are the scenario `key`, `phoneNumber`, `emailAddress` and specific `text` for each communication channels, as shown below. To make this example more interesting, let's say that instead of a single traveler, the travel agency needs to send messages to a happy couple (John and Jane Smith) on their honeymoon. [block:code] { "codes": [ { "code": "POST /omni/1/advanced HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{ \n \"scenarioKey\": \"AD9E01A5DC7BEE2C2B828D208182A611\",\n \"destinations\":[ \n { \n \"to\": {\n \"phoneNumber\": \"385974241491\",\n \"emailAddress\": \"john.smith@gmail.com\"\n }\n },\n { \n \"to\": {\n \"phoneNumber\": \"385972135566111111111\",\n \"emailAddress\": \"jane.smith@gmail.com\"\n }\n }\n ],\n \"sms\": {\n \"text\": \"Hello, we are happy to confirm your reservation for the safari trip.\",\n \"validityPeriod\":3\n },\n \"email\": {\n \"subject\": \"Reservation confirmed!\",\n \"text\": \"Hello, we are happy to confirm your reservation for the safari trip.\"\n } \n}", "language": "json" } ] } [/block] In this example we can see that message can be sent to one or many recipients listed in `destinations` collection. `validityPeriod` is expressed in minutes. If message is not delivered in 3 minutes, an email will be sent as a backup option. ## Response format If request was successful, response header HTTP status code will be `200 OK` and the message will be sent. If you try to send the message without authorization, you will receive the `401 Unauthorized` error . [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"bulkId\": \"b608b611-0fd4-4594-9dea-39656caae30d\",\n \"messages\": [\n {\n \"to\": {\n \"phoneNumber\": \"385974241491\",\n \"emailAddress\": \"john.smith@gmail.com\"\n },\n \"status\": {\n \"groupId\": 1,\n \"groupName\": \"PENDING\",\n \"id\": 7,\n \"name\": \"PENDING_ENROUTE\",\n \"description\": \"Message sent to next instance\"\n },\n \"messageId\": \"05396f95-856d-47e8-bfe7-8ecaff9caa1f\"\n },\n {\n \"to\": {\n \"phoneNumber\": \"385972135566111111111\",\n \"emailAddress\": \"jane.smith@gmail.com\"\n },\n \"status\": {\n \"groupId\": 1,\n \"groupName\": \"PENDING\",\n \"id\": 7,\n \"name\": \"PENDING_ENROUTE\",\n \"description\": \"Message sent to next instance\"\n },\n \"messageId\": \"055d6674-096d-4c5e-b0d9-8285f0fd1b55\"\n }\n ]\n}", "language": "json" } ] } [/block] [block:callout] { "type": "info", "body": "Note that the response does not provide info on if and how the message was delivered. It merely states that the message has been accepted by our server and will be processed according to the created Omni scenario." } [/block] Detailed information about delivery will be available in message log. The easiest way to get the message log for the request is to save the `bulkId` value from the response which can later be used to easily filter out the logs. Besides single `bulkId`, each message has its own unique `messageId`. Message ID can be used to identify failover messages when examining logs. [block:api-header] { "type": "basic", "title": "Step 3: Getting message logs" } [/block] Message logs can be accessed without any filters but such query could potentially return logs of all messages sent in last 48 hours. By introducing `bulkId` as the filter parameter we can get logs for this specific request. [block:code] { "codes": [ { "code": "GET /omni/1/logs?bulkid=b608b611-0fd4-4594-9dea-39656caae30d HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json", "language": "json" } ] } [/block] Here is the returned response: [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"results\": [\n {\n \"bulkId\": \"b608b611-0fd4-4594-9dea-39656caae30d\",\n \"messageId\": \"055d6674-096d-4c5e-b0d9-8285f0fd1b55\",\n \"to\": \"jane.smith@gmail.com\",\n \"from\": \"info@travelagency.com\",\n \"text\": \"Hello, we are happy to confirm your reservation for the safari trip.\",\n \"sentAt\": \"2016-09-29T14:58:32.117+0000\",\n \"doneAt\": \"2016-09-29T14:58:32.747+0000\",\n \"messageCount\": 1,\n \"price\": {\n \"pricePerMessage\": 0,\n \"currency\": \"EUR\"\n },\n \"status\": {\n \"groupId\": 3,\n \"groupName\": \"DELIVERED\",\n \"id\": 5,\n \"name\": \"DELIVERED_TO_HANDSET\",\n \"description\": \"Message delivered to handset\"\n },\n \"channel\": \"EMAIL\"\n },\n {\n \"bulkId\": \"b608b611-0fd4-4594-9dea-39656caae30d\",\n \"messageId\": \"055d6674-096d-4c5e-b0d9-8285f0fd1b55\",\n \"to\": \"385972135566111111111\",\n \"from\": \"Travel agency\",\n \"text\": \"Hello, we are happy to confirm your reservation for the safari trip.\",\n \"sentAt\": \"2016-09-29T14:58:32.070+0000\",\n \"doneAt\": \"2016-09-29T14:58:32.073+0000\",\n \"messageCount\": 1,\n \"mccMnc\": \"21910\",\n \"price\": {\n \"pricePerMessage\": 0,\n \"currency\": \"EUR\"\n },\n \"status\": {\n \"groupId\": 5,\n \"groupName\": \"REJECTED\",\n \"id\": 52,\n \"name\": \"REJECTED_DESTINATION\",\n \"description\": \"Invalid destination address.\",\n \"action\": \"Check to parameter.\"\n },\n \"channel\": \"SMS\"\n },\n {\n \"bulkId\": \"b608b611-0fd4-4594-9dea-39656caae30d\",\n \"messageId\": \"05396f95-856d-47e8-bfe7-8ecaff9caa1f\",\n \"to\": \"385974241491\",\n \"from\": \"Travel agency\",\n \"text\": \"Hello, we are happy to confirm your reservation for the safari trip.\",\n \"sentAt\": \"2016-09-29T14:58:32.013+0000\",\n \"doneAt\": \"2016-09-29T14:58:32.697+0000\",\n \"messageCount\": 1,\n \"mccMnc\": \"21901\",\n \"price\": {\n \"pricePerMessage\": 0,\n \"currency\": \"EUR\"\n },\n \"status\": {\n \"groupId\": 3,\n \"groupName\": \"DELIVERED\",\n \"id\": 5,\n \"name\": \"DELIVERED_TO_HANDSET\",\n \"description\": \"Message delivered to handset\"\n },\n \"channel\": \"SMS\"\n }\n ]\n}", "language": "json" } ] } [/block] In our case **three** returned log records have the same bulk ID. Two out of three messages have the same messageId because, as you can see, Jane Smith supplied an invalid phone number (too many digits) so an SMS could not be delivered (see message `status` and `channel`). This is why we have additional message log with the same `messageId` confirming that email, as a secondary delivery method, has been successfully delivered. John had no problem receiving the SMS message on his phone, as we can see in the last recorded log.