{"_id":"5639e0f91846790d0089529a","user":"54eb4fdedf7add210007b29b","version":{"_id":"54eb63b859b1172100334fae","project":"54eb50e5615ffc1900305a16","forked_from":"54eb63a1867e1917009b711d","__v":27,"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","5954bc387a147f001b918915"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"project":"54eb50e5615ffc1900305a16","__v":16,"parentDoc":null,"category":{"_id":"551546edbc466623002afe72","pages":["551549c0bc466623002afe76","55154afbc859ac2f0001b486","55154daec859ac2f0001b48b","55154f36bc466623002afe7c","551550c5e68daa2f00cff84c","551551d4f854a31900368737","551552e7c859ac2f0001b494","551be4e3a0ee622b0087f69e","5527acc447b71d0d0044e6cd","552f84ad633a5b0d00e99daf","5537533df162750d00bbf7d0","554b3ffd6b448d0d00646d79","55506416fa289c0d0075e4f0","5550aaea00420e0d00d13113","55545865b450630d00041d80","55546906f9a7871700ef8e3c","555c4bf87e271d0d00f3c8c4","5564318c1fa8002300ea4bb0","556ffbd5910c090d00c432b6","557019f4cc189a21001ab258","55703aefcc189a21001ab2a3","5575a3c60b81dc230069c910","558ab69575eaf50d004e4cf3","55b0b41fb3171b3700b1539a","55ba2e48d72d1e1900276ac1","55ba45c804775a2f00628101","55c0b789344dc40d00f55933","55c0b8c837298d0d00088d88","55c0c095344dc40d00f55960","55d43e05b49ab11900328e2e","55d72c8c60fc730d00fc2738","55e6c564d678ad17001589ac","55e9b7780c9b420d0042b275","55f7cf2de32e9b0d00a2d4b6","56094efea7b2590d0089eb95","5613cdbeecbebc21003fa179","5613d8de6a092921004c30b8","5613de7c443514170060dbb6","5613e02823ecf6350009eefc","5613e4271db46e2100e142ad","5614d73c8113d20d00082e3e","561e11ae50e0a62100955946","561e2008efcf8217003adf77","5620f184b244890d001868e0","5620feb740e2c30d0002a899","562105ce40e2c30d0002a8a3","56210b3340e2c30d0002a8b3","56210c74b244890d0018690e","56249a0372ac510d00e49149","56249df185a31117001c53de","56249f0c85a31117001c53e1","5624a9e7c4bf501700bc5ec8","5624b29806e8040d005ed6a0","562507435a86b42300946324","563877854bfb360d00a463c1","5639e0f91846790d0089529a","565327d17d29410d004a0835","565457df04feff210074b17d","56545821ec189235002967af","565485099c4c6d0d00aeda02","5666f1f1f672550d000851ad","566abc7b74d574170070b700","566ad3c7c7c3cd1700265d14","566aede7b5ccc20d00817f71","566aef3147ebaf1900fe65d6"],"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","__v":65,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-03-27T12:02:53.314Z","from_sync":false,"order":11,"slug":"advanced-tutorials","title":"Advanced tutorials"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-04T10:42:01.280Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":true,"order":19,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Tutorial summary\"\n}\n[/block]\nThis tutorial provides you instructions for integrating full Messaging suite into your processes using Infobip HTTP API*:\n\n- **Sending of** [Fully featured textual messages](doc:fully-featured-textual-message) that will give you added flexibility and various functionalities\n- **Receiving of** [real time Intermediate Delivery Reports](doc:intermediate-delivery-reports) on your Notify URL\n- **Receiving of** [Final Delivery Reports](doc:notify-url) on your Notify URL\n- **Real time** [Conversion tracking rates and analytics](#conversion-tracking-solution) for any on-going process\n\n**To get familiar with Infobip SMS HTTP API, please visit our [Getting started tutorial](doc:getting-started).* \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Send SMS\"\n}\n[/block]\nIn order to start sending your SMS messages, you’ll need to create a HTTP POST request to `https://api.infobip.com/sms/1/text/advanced`\n\nYour **Header** should contain [**authorization**](http://dev.infobip.com/docs/getting-started#authorization) and [**content type**](http://dev.infobip.com/docs/getting-started#content-type--accept-header).\n\n- Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\n- Content-Type: application/json\n\nHere is the example how to **Send SMS**, set parameter to receive **Intermediate** and **Final delivery report**, and how to set **SMS tracking** for Conversion rates.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /sms/1/text/advanced HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\n\\n{\\n   \\\"messages\\\":[\\n      {\\n         \\\"from\\\":\\\"InfoSMS\\\",\\n         \\\"destinations\\\":[\\n            {\\n               \\\"to\\\":\\\"41793026731\\\"\\n            }\\n         ],\\n         \\\"text\\\":\\\"Your PIN code is 1a2B3c. Enjoy our app!\\\",\\n         \\\"intermediateReport\\\":true,\\n         \\\"notifyUrl\\\":\\\"http://www.example.com/sms/advanced\\\"\\n      }\\n    ],\\n   \\\"tracking\\\":{\\n         \\\"track\\\":\\\"SMS\\\",\\n         \\\"type\\\":\\\"One_Time_Pin\\\"\\n   }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nAs a response you should receive a **`200 OK`** status with message details in the response body:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/json\\n\\n{\\n  \\\"bulkId\\\": \\\"1446634544520356423\\\",\\n  \\\"messages\\\": [\\n    {\\n      \\\"to\\\": \\\"41793026731\\\",\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 1,\\n        \\\"groupName\\\": \\\"PENDING\\\",\\n        \\\"id\\\": 7,\\n        \\\"name\\\": \\\"PENDING_ENROUTE\\\",\\n        \\\"description\\\": \\\"Message sent to next instance\\\"\\n      },\\n      \\\"smsCount\\\": 1,\\n      \\\"messageId\\\": \\\"8ef699bc-d4c6-4cf6-8d6e-9a9aa62ad93a\\\"\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nOne of the parameter received in the response is **`messageId`** that used for **[Submitting Conversion rates to Infobip platform](#conversion-tracking-process)**.\n\n*For further explanation and examples for sending messages, visit this [Documentation page](http://dev.infobip.com/docs/fully-featured-textual-message).*\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Intermediate delivery reports\"\n}\n[/block]\n**Intermediate delivery reports** can be used for receiving a real time information about your messages. \n\nAs soon as any non-permanent GSM error has been received (i.e. **`EC_ABSENT_SUBSCRIBER`**) by the Infobip system, it will be forwarded to the specified Notify URL* on your callback server. Besides GSM errors, we will also send you the real-time pricing information, message status, and network and country codes.\n\n**Notify URL*** is set as one of the parameters of the [Fully featured textual message](doc:fully-featured-textual-message) API method.\n\nFind out more about Intermediate delivery reports on this [Documentation page](http://dev.infobip.com/docs/intermediate-delivery-reports). For more information regarding **GSM error codes** and **message statuses**, check out [Response codes](doc:response-codes) page.\n\nBelow is an example of **Intermediate delivery report** that will be pushed to your callback server:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"results\\\": [\\n    {\\n      \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\\n      \\\"messageId\\\": \\\"c9823180-94d4-4ea0-9bf3-ec907e7534a6\\\",\\n      \\\"to\\\": \\\"41793026731\\\",\\n      \\\"sentAt\\\": \\\"2015-10-04T13:01:52.933+0000\\\",\\n      \\\"doneAt\\\": \\\"2015-10-04T13:02:00.134+0000\\\",\\n      \\\"smsCount\\\": 1,\\n      \\\"price\\\": {\\n        \\\"pricePerMessage\\\": 0.0001000000,\\n        \\\"currency\\\": \\\"EUR\\\"\\n      },\\n      \\\"status\\\": {\\n        \\\"groupId\\\": 3,\\n        \\\"groupName\\\": \\\"PENDING\\\",\\n        \\\"id\\\": 1,\\n        \\\"name\\\": \\\"PENDING_WAITING_DELIVERY\\\",\\n        \\\"description\\\": \\\"Message sent, waiting for delivery report\\\"\\n      },\\n      \\\"error\\\": {\\n        \\\"groupId\\\": 1,\\n        \\\"groupName\\\": \\\"HANDSET_ERRORS\\\",\\n        \\\"id\\\": 27,\\n        \\\"name\\\": \\\"EC_ABSENT_SUBSCRIBER\\\",\\n        \\\"description\\\": \\\"Absent Subscriber\\\",\\n        \\\"permanent\\\": false\\n      }\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Final Delivery reports\"\n}\n[/block]\nAs soon as final delivery reports for sent messages have been received by the Infobip system, they will be forwarded to specified Notify URL on your callback server.\n\nYou will receive the result on your Notify URL, which will have the same structure as the intermediate delivery report:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"results\\\": [\\n    {\\n      \\\"bulkId\\\": \\\"BULK-ID-123-xyz\\\",\\n      \\\"messageId\\\": \\\"MESSAGE-ID-123-xyz\\\",\\n      \\\"to\\\": \\\"41793026727\\\",\\n      \\\"sentAt\\\": \\\"2015-06-04T13:01:52.937+0000\\\",\\n      \\\"doneAt\\\": \\\"2015-06-04T13:02:01.204+0000\\\",\\n      \\\"smsCount\\\": 1,\\n      \\\"price\\\": {\\n        \\\"pricePerMessage\\\": 0.0001000000,\\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      \\\"error\\\": {\\n        \\\"groupId\\\": 0,\\n        \\\"groupName\\\": \\\"OK\\\",\\n        \\\"id\\\": 0,\\n        \\\"name\\\": \\\"NO_ERROR\\\",\\n        \\\"description\\\": \\\"No Error\\\",\\n        \\\"permanent\\\": false\\n      }\\n    }\\n  ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Conversion tracking solution\"\n}\n[/block]\nWhen you're conducting an SMS campaign, one of the most important things is to track its performance and measure your user conversion rates. For example, if you are sending one-time PINs over SMS, it’s really important to track conversion rates so you can optimise your flow and processes.\n\nConversion tracking has to be **initiated** every time your process starts and also has to be **ended** when the conversion happens. Only once this loop has been closed, we consider it as a successful conversion.\n\n## Initiate Conversion tracking process\n\n**SMS tracking solution**  will automatically track every message sent over the Infobip platform. Just set the **`track`** parameter, put the **`type`** of your campaign and SMS tracking will be done automatically.\n\nThese features are set in the **`tracking`** objects when **[Sending an SMS message](#send-sms)**.\n\n## Conversion rate submission\n\nWhen a user successfully performs the action after receiving the SMS, for example enters one-time PIN in your app, you can send that info to us so we can measure **Conversion rates**. \n\nFor Conversion rate submission, you need to provide only the `messageId` received after **[Sending SMS message](#send-sms)**. The `messageId` has to be submitted to our endpoint as conversion happens.\n\nEndpoint for submitting the conversion rates: **`https://api.infobip.com/ct/1/log/end/{messageId}`**.\n\n### **Example:** Submitting the **`messageId`** for converted messages\n\nThis example shows you how to submit the messageId when the conversion happens. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /ct/1/log/end/9304a5a3ab19-1ca1-be74-76ad87651ed25f35 HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nAs a response, you will receive a **`processKey`** that is used for [getting conversion rates and statistics](doc:getting-conversion-rate-and-statistics):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n \\t\\t\\\"processKey\\\": \\\"A37D448C1ACCA02FABA745522558326C\\\" \\n} \",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n-----\n### **Next:** [Get your conversion rate and statistics](doc:getting-conversion-rate-and-statistics)\nAfter you have successfully submitted the messageId to our platform, you can easily get conversion rate for your processes.","excerpt":"Tutorial that will help you getting started with our full Messaging suite.","slug":"messaging-suite","type":"basic","title":"Messaging suite"}

Messaging suite

Tutorial that will help you getting started with our full Messaging suite.

[block:api-header] { "type": "basic", "title": "Tutorial summary" } [/block] This tutorial provides you instructions for integrating full Messaging suite into your processes using Infobip HTTP API*: - **Sending of** [Fully featured textual messages](doc:fully-featured-textual-message) that will give you added flexibility and various functionalities - **Receiving of** [real time Intermediate Delivery Reports](doc:intermediate-delivery-reports) on your Notify URL - **Receiving of** [Final Delivery Reports](doc:notify-url) on your Notify URL - **Real time** [Conversion tracking rates and analytics](#conversion-tracking-solution) for any on-going process **To get familiar with Infobip SMS HTTP API, please visit our [Getting started tutorial](doc:getting-started).* [block:api-header] { "type": "basic", "title": "Send SMS" } [/block] In order to start sending your SMS messages, you’ll need to create a HTTP POST request to `https://api.infobip.com/sms/1/text/advanced` Your **Header** should contain [**authorization**](http://dev.infobip.com/docs/getting-started#authorization) and [**content type**](http://dev.infobip.com/docs/getting-started#content-type--accept-header). - Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== - Content-Type: application/json Here is the example how to **Send SMS**, set parameter to receive **Intermediate** and **Final delivery report**, and how to set **SMS tracking** for Conversion rates. [block:code] { "codes": [ { "code": "POST /sms/1/text/advanced HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\n\n{\n \"messages\":[\n {\n \"from\":\"InfoSMS\",\n \"destinations\":[\n {\n \"to\":\"41793026731\"\n }\n ],\n \"text\":\"Your PIN code is 1a2B3c. Enjoy our app!\",\n \"intermediateReport\":true,\n \"notifyUrl\":\"http://www.example.com/sms/advanced\"\n }\n ],\n \"tracking\":{\n \"track\":\"SMS\",\n \"type\":\"One_Time_Pin\"\n }\n}", "language": "json" } ] } [/block] As a response you should receive a **`200 OK`** status with message details in the response body: [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"bulkId\": \"1446634544520356423\",\n \"messages\": [\n {\n \"to\": \"41793026731\",\n \"status\": {\n \"groupId\": 1,\n \"groupName\": \"PENDING\",\n \"id\": 7,\n \"name\": \"PENDING_ENROUTE\",\n \"description\": \"Message sent to next instance\"\n },\n \"smsCount\": 1,\n \"messageId\": \"8ef699bc-d4c6-4cf6-8d6e-9a9aa62ad93a\"\n }\n ]\n}", "language": "json" } ] } [/block] One of the parameter received in the response is **`messageId`** that used for **[Submitting Conversion rates to Infobip platform](#conversion-tracking-process)**. *For further explanation and examples for sending messages, visit this [Documentation page](http://dev.infobip.com/docs/fully-featured-textual-message).* [block:api-header] { "type": "basic", "title": "Intermediate delivery reports" } [/block] **Intermediate delivery reports** can be used for receiving a real time information about your messages. As soon as any non-permanent GSM error has been received (i.e. **`EC_ABSENT_SUBSCRIBER`**) by the Infobip system, it will be forwarded to the specified Notify URL* on your callback server. Besides GSM errors, we will also send you the real-time pricing information, message status, and network and country codes. **Notify URL*** is set as one of the parameters of the [Fully featured textual message](doc:fully-featured-textual-message) API method. Find out more about Intermediate delivery reports on this [Documentation page](http://dev.infobip.com/docs/intermediate-delivery-reports). For more information regarding **GSM error codes** and **message statuses**, check out [Response codes](doc:response-codes) page. Below is an example of **Intermediate delivery report** that will be pushed to your callback server: [block:code] { "codes": [ { "code": "{\n \"results\": [\n {\n \"bulkId\": \"BULK-ID-123-xyz\",\n \"messageId\": \"c9823180-94d4-4ea0-9bf3-ec907e7534a6\",\n \"to\": \"41793026731\",\n \"sentAt\": \"2015-10-04T13:01:52.933+0000\",\n \"doneAt\": \"2015-10-04T13:02:00.134+0000\",\n \"smsCount\": 1,\n \"price\": {\n \"pricePerMessage\": 0.0001000000,\n \"currency\": \"EUR\"\n },\n \"status\": {\n \"groupId\": 3,\n \"groupName\": \"PENDING\",\n \"id\": 1,\n \"name\": \"PENDING_WAITING_DELIVERY\",\n \"description\": \"Message sent, waiting for delivery report\"\n },\n \"error\": {\n \"groupId\": 1,\n \"groupName\": \"HANDSET_ERRORS\",\n \"id\": 27,\n \"name\": \"EC_ABSENT_SUBSCRIBER\",\n \"description\": \"Absent Subscriber\",\n \"permanent\": false\n }\n }\n ]\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Final Delivery reports" } [/block] As soon as final delivery reports for sent messages have been received by the Infobip system, they will be forwarded to specified Notify URL on your callback server. You will receive the result on your Notify URL, which will have the same structure as the intermediate delivery report: [block:code] { "codes": [ { "code": "{\n \"results\": [\n {\n \"bulkId\": \"BULK-ID-123-xyz\",\n \"messageId\": \"MESSAGE-ID-123-xyz\",\n \"to\": \"41793026727\",\n \"sentAt\": \"2015-06-04T13:01:52.937+0000\",\n \"doneAt\": \"2015-06-04T13:02:01.204+0000\",\n \"smsCount\": 1,\n \"price\": {\n \"pricePerMessage\": 0.0001000000,\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 \"error\": {\n \"groupId\": 0,\n \"groupName\": \"OK\",\n \"id\": 0,\n \"name\": \"NO_ERROR\",\n \"description\": \"No Error\",\n \"permanent\": false\n }\n }\n ]\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Conversion tracking solution" } [/block] When you're conducting an SMS campaign, one of the most important things is to track its performance and measure your user conversion rates. For example, if you are sending one-time PINs over SMS, it’s really important to track conversion rates so you can optimise your flow and processes. Conversion tracking has to be **initiated** every time your process starts and also has to be **ended** when the conversion happens. Only once this loop has been closed, we consider it as a successful conversion. ## Initiate Conversion tracking process **SMS tracking solution** will automatically track every message sent over the Infobip platform. Just set the **`track`** parameter, put the **`type`** of your campaign and SMS tracking will be done automatically. These features are set in the **`tracking`** objects when **[Sending an SMS message](#send-sms)**. ## Conversion rate submission When a user successfully performs the action after receiving the SMS, for example enters one-time PIN in your app, you can send that info to us so we can measure **Conversion rates**. For Conversion rate submission, you need to provide only the `messageId` received after **[Sending SMS message](#send-sms)**. The `messageId` has to be submitted to our endpoint as conversion happens. Endpoint for submitting the conversion rates: **`https://api.infobip.com/ct/1/log/end/{messageId}`**. ### **Example:** Submitting the **`messageId`** for converted messages This example shows you how to submit the messageId when the conversion happens. [block:code] { "codes": [ { "code": "POST /ct/1/log/end/9304a5a3ab19-1ca1-be74-76ad87651ed25f35 HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json", "language": "json" } ] } [/block] As a response, you will receive a **`processKey`** that is used for [getting conversion rates and statistics](doc:getting-conversion-rate-and-statistics): [block:code] { "codes": [ { "code": "{\n \t\t\"processKey\": \"A37D448C1ACCA02FABA745522558326C\" \n} ", "language": "json" } ] } [/block] ----- ### **Next:** [Get your conversion rate and statistics](doc:getting-conversion-rate-and-statistics) After you have successfully submitted the messageId to our platform, you can easily get conversion rate for your processes.