{"__v":26,"_id":"5515424bc28d6125001b887b","category":{"__v":8,"_id":"54eb63b959b1172100334faf","pages":["54eb63b959b1172100334fb4","54eb63b959b1172100334fb5","54eb63b959b1172100334fb6","551539c3c859ac2f0001b46b","55153c3ac28d6125001b886d","55153e1fc859ac2f0001b470","5515424bc28d6125001b887b","55154597f854a3190036872d","551547cdbc466623002afe73","56c06e1ccfc5470d0018915d"],"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-23T16:10:14.298Z","from_sync":false,"order":0,"slug":"getting-started","title":"Getting started"},"parentDoc":null,"project":"54eb50e5615ffc1900305a16","user":"54eb4fdedf7add210007b29b","version":{"__v":19,"_id":"54eb63b859b1172100334fae","forked_from":"54eb63a1867e1917009b711d","project":"54eb50e5615ffc1900305a16","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"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-03-27T11:43:07.732Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"Logs with sent SMS message history can be requested for all messages by using a single request: `GET https://api.infobip.com/sms/1/logs`.\nUnlike delivery reports, these logs can be requested as many times as you want.\n\nLet's see what happens when you request all of your logs, without any query parameter:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /sms/1/logs HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/json\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nAs a response, you will get the following result:\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\\\":\\\"bafdeb3d-719b-4cce-8762-54d47b40f3c5\\\",\\n         \\\"messageId\\\":\\\"07e03aae-fabc-44ad-b1ce-222e14094d70\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"from\\\":\\\"InfoSMS\\\",\\n         \\\"text\\\":\\\"Test SMS.\\\",\\n         \\\"sentAt\\\":\\\"2015-02-23T17:41:11.833+0100\\\",\\n         \\\"doneAt\\\":\\\"2015-02-23T17:41:11.843+0100\\\",\\n         \\\"smsCount\\\":1,\\n         \\\"mccmnc\\\":\\\"22801\\\",\\n         \\\"price\\\":{  \\n            \\\"pricePerMessage\\\":0.01,\\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         \\\"bulkId\\\":\\\"06479ba3-5977-47f6-9346-fee0369bc76b\\\",\\n         \\\"messageId\\\":\\\"1f21d8d7-f306-4f53-9f6e-eddfce9849ea\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"from\\\":\\\"InfoSMS\\\",\\n         \\\"text\\\":\\\"Test SMS.\\\",\\n         \\\"sentAt\\\":\\\"2015-02-23T17:40:31.773+0100\\\",\\n         \\\"doneAt\\\":\\\"2015-02-23T17:40:31.787+0100\\\",\\n         \\\"smsCount\\\":1,\\n         \\\"mccmnc\\\":\\\"22801\\\",\\n         \\\"price\\\":{  \\n            \\\"pricePerMessage\\\":0.01,\\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]\nLogs carry similar information as delivery reports, with some added fields.\nIf you need detailed information regarding these response fields, check out this [page](doc:message-logs).\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Important:\",\n  \"body\": \"**SMS logs are available for the last 48 hours!**\"\n}\n[/block]\n\nSince this logs example was for all the messages you have sent over the Infobip platform for the last **48 hours**, you might need some filters to search through them. The filters you can use are:\n\n|Parameter|Type|Description|\n|-|-|-|\n|*from*|String|Sender address.|\n|*to*|String|Destination address.|\n|*bulkId*|String[]|Bulk ID for which logs are requested.|\n|*messageId*|String[]|Message ID for which logs are requested.|\n|*generalStatus*|String|Sent SMS status.|\n|*sentSince*|Date|Lower limit on date and time of sending SMS.|\n|*sentUntil*|Date|Upper limit on date and time of sending SMS.|\n|*limit*|int|Max number of messages in returned logs. Default value is **50**.|\n|*mcc*|String|Mobile country code.|\n|*mnc*|String|Mobile network code.|\n \nNow, let's try getting **logs with \"from\", \"to\" and \"limit\" as filters**:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /sms/1/logs?from=InfoSMS&to=41793026727&limit=1 HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/json\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe response will be:\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\\\":\\\"82d1d36e-e4fb-4194-8b93-caeb053bd327\\\",\\n         \\\"messageId\\\":\\\"fc0cbfb8-7a72-40da-a76d-e2c2d9400835\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"from\\\":\\\"InfoSMS\\\",\\n         \\\"text\\\":\\\"Test SMS.\\\",\\n         \\\"sentAt\\\":\\\"2015-02-23T17:42:05.390+0100\\\",\\n         \\\"doneAt\\\":\\\"2015-02-23T17:42:05.390+0100\\\",\\n         \\\"smsCount\\\":1,\\n         \\\"mccmnc\\\":\\\"22801\\\",\\n         \\\"price\\\":{  \\n            \\\"pricePerMessage\\\":0,\\n            \\\"currency\\\":\\\"EUR\\\"\\n         },\\n         \\\"status\\\":{  \\n            \\\"groupId\\\":5,\\n            \\\"groupName\\\":\\\"REJECTED\\\",\\n            \\\"id\\\":6,\\n            \\\"name\\\":\\\"REJECTED_NETWORK\\\",\\n            \\\"description\\\":\\\"Network is forbidden\\\",\\n            \\\"action\\\":\\\"Contact account manager\\\"\\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------\n#### **Next: ** [Number Lookup](doc:number-context)\nFind out how to keep your mobile numbers database up to date.","excerpt":"Your sent SMS message history.","slug":"sms-logs","type":"basic","title":"Getting SMS logs"}

Getting SMS logs

Your sent SMS message history.

Logs with sent SMS message history can be requested for all messages by using a single request: `GET https://api.infobip.com/sms/1/logs`. Unlike delivery reports, these logs can be requested as many times as you want. Let's see what happens when you request all of your logs, without any query parameter: [block:code] { "codes": [ { "code": "GET /sms/1/logs HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json", "language": "json" } ] } [/block] As a response, you will get the following result: [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{ \n \"results\":[ \n { \n \"bulkId\":\"bafdeb3d-719b-4cce-8762-54d47b40f3c5\",\n \"messageId\":\"07e03aae-fabc-44ad-b1ce-222e14094d70\",\n \"to\":\"41793026727\",\n \"from\":\"InfoSMS\",\n \"text\":\"Test SMS.\",\n \"sentAt\":\"2015-02-23T17:41:11.833+0100\",\n \"doneAt\":\"2015-02-23T17:41:11.843+0100\",\n \"smsCount\":1,\n \"mccmnc\":\"22801\",\n \"price\":{ \n \"pricePerMessage\":0.01,\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 \"bulkId\":\"06479ba3-5977-47f6-9346-fee0369bc76b\",\n \"messageId\":\"1f21d8d7-f306-4f53-9f6e-eddfce9849ea\",\n \"to\":\"41793026727\",\n \"from\":\"InfoSMS\",\n \"text\":\"Test SMS.\",\n \"sentAt\":\"2015-02-23T17:40:31.773+0100\",\n \"doneAt\":\"2015-02-23T17:40:31.787+0100\",\n \"smsCount\":1,\n \"mccmnc\":\"22801\",\n \"price\":{ \n \"pricePerMessage\":0.01,\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] Logs carry similar information as delivery reports, with some added fields. If you need detailed information regarding these response fields, check out this [page](doc:message-logs). [block:callout] { "type": "warning", "title": "Important:", "body": "**SMS logs are available for the last 48 hours!**" } [/block] Since this logs example was for all the messages you have sent over the Infobip platform for the last **48 hours**, you might need some filters to search through them. The filters you can use are: |Parameter|Type|Description| |-|-|-| |*from*|String|Sender address.| |*to*|String|Destination address.| |*bulkId*|String[]|Bulk ID for which logs are requested.| |*messageId*|String[]|Message ID for which logs are requested.| |*generalStatus*|String|Sent SMS status.| |*sentSince*|Date|Lower limit on date and time of sending SMS.| |*sentUntil*|Date|Upper limit on date and time of sending SMS.| |*limit*|int|Max number of messages in returned logs. Default value is **50**.| |*mcc*|String|Mobile country code.| |*mnc*|String|Mobile network code.| Now, let's try getting **logs with "from", "to" and "limit" as filters**: [block:code] { "codes": [ { "code": "GET /sms/1/logs?from=InfoSMS&to=41793026727&limit=1 HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json", "language": "json" } ] } [/block] The response will be: [block:code] { "codes": [ { "code": "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{ \n \"results\":[ \n { \n \"bulkId\":\"82d1d36e-e4fb-4194-8b93-caeb053bd327\",\n \"messageId\":\"fc0cbfb8-7a72-40da-a76d-e2c2d9400835\",\n \"to\":\"41793026727\",\n \"from\":\"InfoSMS\",\n \"text\":\"Test SMS.\",\n \"sentAt\":\"2015-02-23T17:42:05.390+0100\",\n \"doneAt\":\"2015-02-23T17:42:05.390+0100\",\n \"smsCount\":1,\n \"mccmnc\":\"22801\",\n \"price\":{ \n \"pricePerMessage\":0,\n \"currency\":\"EUR\"\n },\n \"status\":{ \n \"groupId\":5,\n \"groupName\":\"REJECTED\",\n \"id\":6,\n \"name\":\"REJECTED_NETWORK\",\n \"description\":\"Network is forbidden\",\n \"action\":\"Contact account manager\"\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] ------ #### **Next: ** [Number Lookup](doc:number-context) Find out how to keep your mobile numbers database up to date.