{"__v":1,"_id":"551e55590a72c50d0085b911","category":{"__v":3,"_id":"5515472ac28d6125001b8884","pages":["551924db45b0d80d00152254","55194fec71a8cc210031db15","551e55590a72c50d0085b911"],"project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-03-27T12:03:54.990Z","from_sync":false,"order":2,"slug":"receive-sms","title":"Receive SMS"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"54eb50e5615ffc1900305a16","user":"54eb4fdedf7add210007b29b","version":{"__v":20,"_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","58b04a023529383900a759b5"],"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-04-03T08:54:49.324Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"","code":"GET /sms/1/inbox/logs HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json","language":"json"}]},"method":"get","results":{"codes":[{"name":"","code":"{  \n   \"results\":[  \n      {  \n         \"messageId\":\"5908971644001839114\",\n         \"to\":\"41793026727\",\n         \"receivedAt\":\"2015-03-01T12:54:44.560+0000\",\n         \"from\":\"385998779111\",\n         \"text\":\"HEY hello world\",\n         \"cleanText\":\"hello world\",\n         \"keyword\":\"HEY\",\n         \"smsCount\":1\n      },\n      {  \n         \"messageId\":\"5904932597450690569\",\n         \"to\":\"41793026727\",\n         \"receivedAt\":\"2015-03-01T12:54:42.231+0000\",\n         \"from\":\"385998779111\",\n         \"text\":\"HEY how are you\",\n         \"cleanText\":\"how are you\",\n         \"keyword\":\"HEY\",\n         \"smsCount\":1\n      },\n      {  \n         \"messageId\":\"5904217701796992008\",\n         \"to\":\"41793026727\",\n         \"receivedAt\":\"2015-03-01T12:54:40.111+0000\",\n         \"from\":\"385998779111\",\n         \"text\":\"KEY hello world\",\n         \"cleanText\":\"hello world\",\n         \"keyword\":\"KEY\",\n         \"smsCount\":1\n      }\n   ]\n}","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"551e55590a72c50d0085b916","ref":"","in":"query","required":false,"desc":"Maximum number of messages in returned logs. Default value is **50**.","default":"","type":"int","name":"limit"},{"_id":"551e55590a72c50d0085b915","ref":"","in":"query","required":false,"desc":"Keyword used in received messages","default":"","type":"string","name":"keyword"},{"_id":"551e55590a72c50d0085b914","ref":"","in":"query","required":false,"desc":"The message destination address.","default":"","type":"string","name":"to"},{"_id":"551e55590a72c50d0085b913","ref":"","in":"query","required":false,"desc":"Lower limit on date and time of sending SMS.","default":"","type":"datetime","name":"receivedSince"},{"_id":"551e55590a72c50d0085b912","ref":"","in":"query","required":false,"desc":"Upper limit on date and time of sending SMS.","default":"","type":"datetime","name":"receivedUntil"}],"url":"/sms/:version/inbox/logs"},"isReference":true,"order":5,"body":"# Response format\n\nIf successful, the response header HTTP status code will be `200 OK` and the message logs will be returned.\n\nIf you try to send a message without authorization, you will get a response with HTTP status code `401 Unauthorized`.\n\n## MOLogsResponse\n\n|Parameter|Type|Description|\n|-|-|-|\n|*results*|[MOLog[]](#section-molog)|Collection of logs.|\n\n### MOLog\n\n|Parameter|Type|Description|\n|-|-|-|\n|*messageId*|String|The ID that uniquely identifies the received message.|\n|*to*|String|The message destination address.|\n|*receivedAt*|Date|Tells when the SMS was received. It has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.|\n|*from*|String|Sender ID that can be alphanumeric or numeric.|\n|*text*|String|Text of the message that was sent.|\n|*cleanText*|String|Text of the message that was sent without the keyword.|\n|*keyword*|String|Keyword extracted from the message text.|\n|*smsCount*|int|The number of sent message segments.|\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Important:\",\n  \"body\": \"**Received messages logs are available for the last 48 hours!**\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Additional examples\"\n}\n[/block]\n# Getting logs without any query parameter\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /sms/1/inbox/logs HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/json\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"GET /sms/1/inbox/logs HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/xml\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -X GET \\\\\\n-H 'Accept: application/json' \\\\\\n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \\\\\\nhttps://api.infobip.com/sms/1/inbox/logs\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$curl = curl_init();\\n\\ncurl_setopt_array($curl, array(\\n  CURLOPT_URL => \\\"http://api.infobip.com/sms/1/inbox/logs\\\",\\n  CURLOPT_RETURNTRANSFER => true,\\n  CURLOPT_ENCODING => \\\"\\\",\\n  CURLOPT_MAXREDIRS => 10,\\n  CURLOPT_TIMEOUT => 30,\\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\\n  CURLOPT_CUSTOMREQUEST => \\\"GET\\\",\\n  CURLOPT_POSTFIELDS => \\\"\\\",\\n  CURLOPT_HTTPHEADER => array(\\n    \\\"accept: application/json\\\",\\n    \\\"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\"\\n  ),\\n));\\n\\n$response = curl_exec($curl);\\n$err = curl_error($curl);\\n\\ncurl_close($curl);\\n\\nif ($err) {\\n  echo \\\"cURL Error #:\\\" . $err;\\n} else {\\n  echo $response;\\n}\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'uri'\\nrequire 'net/http'\\n\\nurl = URI(\\\"https://api.infobip.com/sms/1/inbox/logs\\\")\\n\\nhttp = Net::HTTP.new(url.host, url.port)\\nhttp.use_ssl = true\\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\\n\\nrequest = Net::HTTP::Get.new(url)\\nrequest[\\\"authorization\\\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nrequest[\\\"accept\\\"] = 'application/json'\\n\\nresponse = http.request(request)\\nputs response.read_body\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"import http.client\\n\\nconn = http.client.HTTPSConnection(\\\"api.infobip.com\\\")\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"GET\\\", \\\"/sms/1/inbox/logs\\\", headers=headers)\\n\\nres = conn.getresponse()\\ndata = res.read()\\n\\nprint(data.decode(\\\"utf-8\\\"))\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"HttpResponse<String> response = Unirest.get(\\\"https://api.infobip.com/sms/1/inbox/logs\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/sms/1/inbox/logs\\\");\\n\\nvar request = new RestRequest(Method.GET);\\nrequest.AddHeader(\\\"accept\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\n\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = null;\\n\\nvar xhr = new XMLHttpRequest();\\nxhr.withCredentials = true;\\n\\nxhr.addEventListener(\\\"readystatechange\\\", function () {\\n  if (this.readyState === this.DONE) {\\n    console.log(this.responseText);\\n  }\\n});\\n\\nxhr.open(\\\"GET\\\", \\\"https://api.infobip.com/sms/1/inbox/logs\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"accept\\\", \\\"application/json\\\");\\n\\nxhr.send(data);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n   \\\"results\\\":[  \\n      {  \\n         \\\"messageId\\\":\\\"5908971644001839114\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"receivedAt\\\":\\\"2015-03-01T12:54:44.560+0000\\\",\\n         \\\"from\\\":\\\"385998779111\\\",\\n         \\\"text\\\":\\\"HEY hello world\\\",\\n         \\\"cleanText\\\":\\\"hello world\\\",\\n         \\\"keyword\\\":\\\"HEY\\\",\\n         \\\"smsCount\\\":1\\n      },\\n      {  \\n         \\\"messageId\\\":\\\"5904932597450690569\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"receivedAt\\\":\\\"2015-03-01T12:54:42.231+0000\\\",\\n         \\\"from\\\":\\\"385998779111\\\",\\n         \\\"text\\\":\\\"HEY how are you\\\",\\n         \\\"cleanText\\\":\\\"how are you\\\",\\n         \\\"keyword\\\":\\\"HEY\\\",\\n         \\\"smsCount\\\":1\\n      },\\n      {  \\n         \\\"messageId\\\":\\\"5904217701796992008\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"receivedAt\\\":\\\"2015-03-01T12:54:40.111+0000\\\",\\n         \\\"from\\\":\\\"385998779111\\\",\\n         \\\"text\\\":\\\"KEY hello world\\\",\\n         \\\"cleanText\\\":\\\"hello world\\\",\\n         \\\"keyword\\\":\\\"KEY\\\",\\n         \\\"smsCount\\\":1\\n      }\\n   ]\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/xml\\n\\n<moLogsResponse>\\n   <results>\\n      <result>\\n         <messageId>5908971644001839114</messageId>\\n         <to>13372</to>\\n         <receivedAt>2015-03-01T12:54:44.560+0000</receivedAt>\\n         <from>385998779613</from>\\n         <text>HEY hello world</text>\\n         <cleanText>hello world</cleanText>\\n         <keyword>HEY</keyword>\\n         <smsCount>1</smsCount>\\n      </result>\\n      <result>\\n         <messageId>5904932597450690569</messageId>\\n         <to>13372</to>\\n         <receivedAt>2015-03-01T12:54:42.231+0000</receivedAt>\\n         <from>385998779613</from>\\n         <text>HEY how are you</text>\\n         <cleanText>how are you</cleanText>\\n         <keyword>HEY</keyword>\\n         <smsCount>1</smsCount>\\n      </result>\\n      <result>\\n         <messageId>5904217701796992008</messageId>\\n         <to>13372</to>\\n         <receivedAt>2015-03-01T12:54:40.111+0000</receivedAt>\\n         <from>385998779613</from>\\n         <text>KEY hello world</text>\\n         <cleanText>hello world</cleanText>\\n         <keyword>KEY</keyword>\\n         <smsCount>1</smsCount>\\n      </result>\\n   </results>\\n</moLogsResponse>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n# Getting logs with `keyword` and `to` as filters\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /sms/1/inbox/logs?keyword=HEY&to=13372 HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/json\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"GET /sms/1/inbox/logs?keyword=HEY&to=13372 HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/xml\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -X GET \\n-H 'Accept: application/json' \\n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \\nhttps://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$curl = curl_init();\\n\\ncurl_setopt_array($curl, array(\\n  CURLOPT_URL => \\\"http://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\\\",\\n  CURLOPT_RETURNTRANSFER => true,\\n  CURLOPT_ENCODING => \\\"\\\",\\n  CURLOPT_MAXREDIRS => 10,\\n  CURLOPT_TIMEOUT => 30,\\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\\n  CURLOPT_CUSTOMREQUEST => \\\"GET\\\",\\n  CURLOPT_POSTFIELDS => \\\"\\\",\\n  CURLOPT_HTTPHEADER => array(\\n    \\\"accept: application/json\\\",\\n    \\\"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\"\\n  ),\\n));\\n\\n$response = curl_exec($curl);\\n$err = curl_error($curl);\\n\\ncurl_close($curl);\\n\\nif ($err) {\\n  echo \\\"cURL Error #:\\\" . $err;\\n} else {\\n  echo $response;\\n}\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'uri'\\nrequire 'net/http'\\n\\nurl = URI(\\\"https://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\\\")\\n\\nhttp = Net::HTTP.new(url.host, url.port)\\nhttp.use_ssl = true\\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\\n\\nrequest = Net::HTTP::Get.new(url)\\nrequest[\\\"authorization\\\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nrequest[\\\"accept\\\"] = 'application/json'\\n\\nresponse = http.request(request)\\nputs response.read_body\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"import http.client\\n\\nconn = http.client.HTTPSConnection(\\\"api.infobip.com\\\")\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"GET\\\", \\\"/sms/1/inbox/logs?keyword=HEY&to=13372\\\", headers=headers)\\n\\nres = conn.getresponse()\\ndata = res.read()\\n\\nprint(data.decode(\\\"utf-8\\\"))\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"HttpResponse<String> response = Unirest.get(\\\"https://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\\\");\\n\\nvar request = new RestRequest(Method.GET);\\nrequest.AddHeader(\\\"accept\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\n\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = null;\\n\\nvar xhr = new XMLHttpRequest();\\nxhr.withCredentials = true;\\n\\nxhr.addEventListener(\\\"readystatechange\\\", function () {\\n  if (this.readyState === this.DONE) {\\n    console.log(this.responseText);\\n  }\\n});\\n\\nxhr.open(\\\"GET\\\", \\\"https://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"accept\\\", \\\"application/json\\\");\\n\\nxhr.send(data);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{  \\n   \\\"results\\\":[  \\n      {  \\n         \\\"messageId\\\":\\\"5908971644001839114\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"receivedAt\\\":\\\"2015-03-01T12:54:44.560+0000\\\",\\n         \\\"from\\\":\\\"385998779111\\\",\\n         \\\"text\\\":\\\"HEY hello world\\\",\\n         \\\"cleanText\\\":\\\"hello world\\\",\\n         \\\"keyword\\\":\\\"HEY\\\",\\n         \\\"smsCount\\\":1\\n      },\\n      {  \\n         \\\"messageId\\\":\\\"5904932597450690569\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"receivedAt\\\":\\\"2015-03-01T12:54:42.231+0000\\\",\\n         \\\"from\\\":\\\"385998779111\\\",\\n         \\\"text\\\":\\\"HEY how are you\\\",\\n         \\\"cleanText\\\":\\\"how are you\\\",\\n         \\\"keyword\\\":\\\"HEY\\\",\\n         \\\"smsCount\\\":1\\n      }\\n   ]\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/xml\\n\\n<moLogsResponse>\\n   <results>\\n      <result>\\n         <messageId>5908971644001839114</messageId>\\n         <to>13372</to>\\n         <receivedAt>2015-03-01T12:54:44.560+0000</receivedAt>\\n         <from>385998779613</from>\\n         <text>HEY hello world</text>\\n         <cleanText>hello world</cleanText>\\n         <keyword>HEY</keyword>\\n         <smsCount>1</smsCount>\\n      </result>\\n      <result>\\n         <messageId>5904932597450690569</messageId>\\n         <to>13372</to>\\n         <receivedAt>2015-03-01T12:54:42.231+0000</receivedAt>\\n         <from>385998779613</from>\\n         <text>HEY how are you</text>\\n         <cleanText>how are you</cleanText>\\n         <keyword>HEY</keyword>\\n         <smsCount>1</smsCount>\\n      </result>\\n   </results>\\n</moLogsResponse>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n# Getting messages without keyword\n\nTo get all messages sent without the keyword, you can use `NO_KEYWORD` filter.\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /sms/1/inbox/logs?keyword=NO_KEYWORD HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/json\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"GET /sms/1/inbox/logs?keyword=NO_KEYWORD HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/xml\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -X GET \\n-H 'Accept: application/json' \\n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \\nhttps://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$curl = curl_init();\\n\\ncurl_setopt_array($curl, array(\\n  CURLOPT_URL => \\\"http://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\\\",\\n  CURLOPT_RETURNTRANSFER => true,\\n  CURLOPT_ENCODING => \\\"\\\",\\n  CURLOPT_MAXREDIRS => 10,\\n  CURLOPT_TIMEOUT => 30,\\n  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\\n  CURLOPT_CUSTOMREQUEST => \\\"GET\\\",\\n  CURLOPT_POSTFIELDS => \\\"\\\",\\n  CURLOPT_HTTPHEADER => array(\\n    \\\"accept: application/json\\\",\\n    \\\"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\"\\n  ),\\n));\\n\\n$response = curl_exec($curl);\\n$err = curl_error($curl);\\n\\ncurl_close($curl);\\n\\nif ($err) {\\n  echo \\\"cURL Error #:\\\" . $err;\\n} else {\\n  echo $response;\\n}\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'uri'\\nrequire 'net/http'\\n\\nurl = URI(\\\"https://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\\\")\\n\\nhttp = Net::HTTP.new(url.host, url.port)\\nhttp.use_ssl = true\\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\\n\\nrequest = Net::HTTP::Get.new(url)\\nrequest[\\\"authorization\\\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\\nrequest[\\\"accept\\\"] = 'application/json'\\n\\nresponse = http.request(request)\\nputs response.read_body\",\n      \"language\": \"ruby\"\n    },\n    {\n      \"code\": \"import http.client\\n\\nconn = http.client.HTTPSConnection(\\\"api.infobip.com\\\")\\n\\nheaders = {\\n    'authorization': \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\",\\n    'accept': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"GET\\\", \\\"/sms/1/inbox/logs?keyword=NO_KEYWORD\\\", headers=headers)\\n\\nres = conn.getresponse()\\ndata = res.read()\\n\\nprint(data.decode(\\\"utf-8\\\"))\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"HttpResponse<String> response = Unirest.get(\\\"https://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\\\");\\n\\nvar request = new RestRequest(Method.GET);\\nrequest.AddHeader(\\\"accept\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\n\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var data = null;\\n\\nvar xhr = new XMLHttpRequest();\\nxhr.withCredentials = true;\\n\\nxhr.addEventListener(\\\"readystatechange\\\", function () {\\n  if (this.readyState === this.DONE) {\\n    console.log(this.responseText);\\n  }\\n});\\n\\nxhr.open(\\\"GET\\\", \\\"https://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"accept\\\", \\\"application/json\\\");\\n\\nxhr.send(data);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"results\\\":[\\n      {\\n         \\\"messageId\\\":\\\"606386740726357762\\\",\\n         \\\"from\\\":\\\"385998779111\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"text\\\":\\\"Message without keyword\\\",\\n         \\\"cleanText\\\":\\\"Message without keyword\\\",\\n         \\\"receivedAt\\\":\\\"2015-05-20T10:06:46.880+0000\\\",\\n         \\\"smsCount\\\":1\\n      },\\n      {\\n         \\\"messageId\\\":\\\"3634590217319761028\\\",\\n         \\\"from\\\":\\\"385998779111\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"text\\\":\\\"Logs test\\\",\\n         \\\"cleanText\\\":\\\"Logs test\\\",\\n         \\\"receivedAt\\\":\\\"2015-05-20T10:06:17.713+0000\\\",\\n         \\\"smsCount\\\":1\\n      }\\n   ]\\n}\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"HTTP/1.1 200 OK\\nContent-Type: application/xml\\n\\n<moLogsResponse>\\n\\t<results>\\n    <result>\\n      <messageId>606386740726357762</messageId>\\n      <from>385998779111</from>\\n      <to>41793026727</to>\\n      <text>Message without keyword</text>\\n      <cleanText>Message without keyword</cleanText>\\n      <receivedAt>2015-05-20T10:06:46.880+0000</receivedAt>\\n      <smsCount>1</smsCount>\\n    </result>\\n    <result>\\n      <messageId>3634590217319761028</messageId>\\n      <from>385998779111</from>\\n      <to>41793026727</to>\\n      <text>Logs test</text>\\n      <cleanText>Logs test</cleanText>\\n      <receivedAt>2015-05-20T10:06:17.713+0000</receivedAt>\\n      <smsCount>1</smsCount>\\n    </result>\\n\\t</results>\\n</moLogsResponse>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n# Getting messages received within specified time span\n\nYou can use `receivedSince` and/or `receivedUntil` to filter messages by `receivedAt` property.\n\nRequest\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /sms/1/inbox/logs?receivedSince=2015-05-20T10:06:16.713%2b00:00&receivedUntil=2015-05-20T10:06:47.880%2b00:00 HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/json\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"results\\\":[\\n      {\\n         \\\"messageId\\\":\\\"606386740726357762\\\",\\n         \\\"from\\\":\\\"385998779111\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"text\\\":\\\"Message without keyword\\\",\\n         \\\"cleanText\\\":\\\"Message without keyword\\\",\\n         \\\"receivedAt\\\":\\\"2015-05-20T10:06:46.880+0000\\\",\\n         \\\"smsCount\\\":1\\n      },\\n      {\\n         \\\"messageId\\\":\\\"3634590217319761028\\\",\\n         \\\"from\\\":\\\"385998779111\\\",\\n         \\\"to\\\":\\\"41793026727\\\",\\n         \\\"text\\\":\\\"Logs test\\\",\\n         \\\"cleanText\\\":\\\"Logs test\\\",\\n         \\\"receivedAt\\\":\\\"2015-05-20T10:06:17.713+0000\\\",\\n         \\\"smsCount\\\":1\\n      }\\n   ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"received-messages-logs","type":"endpoint","title":"Received messages logs"}

getReceived messages logs


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

limit:
integer
Maximum number of messages in returned logs. Default value is **50**.
keyword:
string
Keyword used in received messages
to:
string
The message destination address.
receivedSince:
datetime
Lower limit on date and time of sending SMS.
receivedUntil:
datetime
Upper limit on date and time of sending SMS.

Examples


Result Format


Documentation

# Response format If successful, the response header HTTP status code will be `200 OK` and the message logs will be returned. If you try to send a message without authorization, you will get a response with HTTP status code `401 Unauthorized`. ## MOLogsResponse |Parameter|Type|Description| |-|-|-| |*results*|[MOLog[]](#section-molog)|Collection of logs.| ### MOLog |Parameter|Type|Description| |-|-|-| |*messageId*|String|The ID that uniquely identifies the received message.| |*to*|String|The message destination address.| |*receivedAt*|Date|Tells when the SMS was received. It has the following format: `yyyy-MM-dd'T'HH:mm:ss.SSSZ`.| |*from*|String|Sender ID that can be alphanumeric or numeric.| |*text*|String|Text of the message that was sent.| |*cleanText*|String|Text of the message that was sent without the keyword.| |*keyword*|String|Keyword extracted from the message text.| |*smsCount*|int|The number of sent message segments.| [block:callout] { "type": "warning", "title": "Important:", "body": "**Received messages logs are available for the last 48 hours!**" } [/block] [block:api-header] { "type": "basic", "title": "Additional examples" } [/block] # Getting logs without any query parameter **Request** [block:code] { "codes": [ { "code": "GET /sms/1/inbox/logs HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json", "language": "json" }, { "code": "GET /sms/1/inbox/logs HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/xml", "language": "xml" }, { "code": "curl -X GET \\\n-H 'Accept: application/json' \\\n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \\\nhttps://api.infobip.com/sms/1/inbox/logs", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"http://api.infobip.com/sms/1/inbox/logs\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_POSTFIELDS => \"\",\n CURLOPT_HTTPHEADER => array(\n \"accept: application/json\",\n \"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\"\n ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}", "language": "php" }, { "code": "require 'uri'\nrequire 'net/http'\n\nurl = URI(\"https://api.infobip.com/sms/1/inbox/logs\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"accept\"] = 'application/json'\n\nresponse = http.request(request)\nputs response.read_body", "language": "ruby" }, { "code": "import http.client\n\nconn = http.client.HTTPSConnection(\"api.infobip.com\")\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"GET\", \"/sms/1/inbox/logs\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))", "language": "python" }, { "code": "HttpResponse<String> response = Unirest.get(\"https://api.infobip.com/sms/1/inbox/logs\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"accept\", \"application/json\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/sms/1/inbox/logs\");\n\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\n\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = null;\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://api.infobip.com/sms/1/inbox/logs\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{ \n \"results\":[ \n { \n \"messageId\":\"5908971644001839114\",\n \"to\":\"41793026727\",\n \"receivedAt\":\"2015-03-01T12:54:44.560+0000\",\n \"from\":\"385998779111\",\n \"text\":\"HEY hello world\",\n \"cleanText\":\"hello world\",\n \"keyword\":\"HEY\",\n \"smsCount\":1\n },\n { \n \"messageId\":\"5904932597450690569\",\n \"to\":\"41793026727\",\n \"receivedAt\":\"2015-03-01T12:54:42.231+0000\",\n \"from\":\"385998779111\",\n \"text\":\"HEY how are you\",\n \"cleanText\":\"how are you\",\n \"keyword\":\"HEY\",\n \"smsCount\":1\n },\n { \n \"messageId\":\"5904217701796992008\",\n \"to\":\"41793026727\",\n \"receivedAt\":\"2015-03-01T12:54:40.111+0000\",\n \"from\":\"385998779111\",\n \"text\":\"KEY hello world\",\n \"cleanText\":\"hello world\",\n \"keyword\":\"KEY\",\n \"smsCount\":1\n }\n ]\n}", "language": "json" }, { "code": "HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<moLogsResponse>\n <results>\n <result>\n <messageId>5908971644001839114</messageId>\n <to>13372</to>\n <receivedAt>2015-03-01T12:54:44.560+0000</receivedAt>\n <from>385998779613</from>\n <text>HEY hello world</text>\n <cleanText>hello world</cleanText>\n <keyword>HEY</keyword>\n <smsCount>1</smsCount>\n </result>\n <result>\n <messageId>5904932597450690569</messageId>\n <to>13372</to>\n <receivedAt>2015-03-01T12:54:42.231+0000</receivedAt>\n <from>385998779613</from>\n <text>HEY how are you</text>\n <cleanText>how are you</cleanText>\n <keyword>HEY</keyword>\n <smsCount>1</smsCount>\n </result>\n <result>\n <messageId>5904217701796992008</messageId>\n <to>13372</to>\n <receivedAt>2015-03-01T12:54:40.111+0000</receivedAt>\n <from>385998779613</from>\n <text>KEY hello world</text>\n <cleanText>hello world</cleanText>\n <keyword>KEY</keyword>\n <smsCount>1</smsCount>\n </result>\n </results>\n</moLogsResponse>", "language": "xml" } ] } [/block] # Getting logs with `keyword` and `to` as filters **Request** [block:code] { "codes": [ { "code": "GET /sms/1/inbox/logs?keyword=HEY&to=13372 HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json", "language": "json" }, { "code": "GET /sms/1/inbox/logs?keyword=HEY&to=13372 HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/xml", "language": "xml" }, { "code": "curl -X GET \n-H 'Accept: application/json' \n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \nhttps://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"http://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_POSTFIELDS => \"\",\n CURLOPT_HTTPHEADER => array(\n \"accept: application/json\",\n \"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\"\n ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}", "language": "php" }, { "code": "require 'uri'\nrequire 'net/http'\n\nurl = URI(\"https://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"accept\"] = 'application/json'\n\nresponse = http.request(request)\nputs response.read_body", "language": "ruby" }, { "code": "import http.client\n\nconn = http.client.HTTPSConnection(\"api.infobip.com\")\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"GET\", \"/sms/1/inbox/logs?keyword=HEY&to=13372\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))", "language": "python" }, { "code": "HttpResponse<String> response = Unirest.get(\"https://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"accept\", \"application/json\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\");\n\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\n\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = null;\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://api.infobip.com/sms/1/inbox/logs?keyword=HEY&to=13372\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{ \n \"results\":[ \n { \n \"messageId\":\"5908971644001839114\",\n \"to\":\"41793026727\",\n \"receivedAt\":\"2015-03-01T12:54:44.560+0000\",\n \"from\":\"385998779111\",\n \"text\":\"HEY hello world\",\n \"cleanText\":\"hello world\",\n \"keyword\":\"HEY\",\n \"smsCount\":1\n },\n { \n \"messageId\":\"5904932597450690569\",\n \"to\":\"41793026727\",\n \"receivedAt\":\"2015-03-01T12:54:42.231+0000\",\n \"from\":\"385998779111\",\n \"text\":\"HEY how are you\",\n \"cleanText\":\"how are you\",\n \"keyword\":\"HEY\",\n \"smsCount\":1\n }\n ]\n}", "language": "json" }, { "code": "HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<moLogsResponse>\n <results>\n <result>\n <messageId>5908971644001839114</messageId>\n <to>13372</to>\n <receivedAt>2015-03-01T12:54:44.560+0000</receivedAt>\n <from>385998779613</from>\n <text>HEY hello world</text>\n <cleanText>hello world</cleanText>\n <keyword>HEY</keyword>\n <smsCount>1</smsCount>\n </result>\n <result>\n <messageId>5904932597450690569</messageId>\n <to>13372</to>\n <receivedAt>2015-03-01T12:54:42.231+0000</receivedAt>\n <from>385998779613</from>\n <text>HEY how are you</text>\n <cleanText>how are you</cleanText>\n <keyword>HEY</keyword>\n <smsCount>1</smsCount>\n </result>\n </results>\n</moLogsResponse>", "language": "xml" } ] } [/block] # Getting messages without keyword To get all messages sent without the keyword, you can use `NO_KEYWORD` filter. **Request** [block:code] { "codes": [ { "code": "GET /sms/1/inbox/logs?keyword=NO_KEYWORD HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json", "language": "json" }, { "code": "GET /sms/1/inbox/logs?keyword=NO_KEYWORD HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/xml", "language": "xml" }, { "code": "curl -X GET \n-H 'Accept: application/json' \n-H 'Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \nhttps://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"http://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_POSTFIELDS => \"\",\n CURLOPT_HTTPHEADER => array(\n \"accept: application/json\",\n \"authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\"\n ),\n));\n\n$response = curl_exec($curl);\n$err = curl_error($curl);\n\ncurl_close($curl);\n\nif ($err) {\n echo \"cURL Error #:\" . $err;\n} else {\n echo $response;\n}", "language": "php" }, { "code": "require 'uri'\nrequire 'net/http'\n\nurl = URI(\"https://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\")\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"authorization\"] = 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='\nrequest[\"accept\"] = 'application/json'\n\nresponse = http.request(request)\nputs response.read_body", "language": "ruby" }, { "code": "import http.client\n\nconn = http.client.HTTPSConnection(\"api.infobip.com\")\n\nheaders = {\n 'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n 'accept': \"application/json\"\n }\n\nconn.request(\"GET\", \"/sms/1/inbox/logs?keyword=NO_KEYWORD\", headers=headers)\n\nres = conn.getresponse()\ndata = res.read()\n\nprint(data.decode(\"utf-8\"))", "language": "python" }, { "code": "HttpResponse<String> response = Unirest.get(\"https://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"accept\", \"application/json\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\");\n\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\n\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var data = null;\n\nvar xhr = new XMLHttpRequest();\nxhr.withCredentials = true;\n\nxhr.addEventListener(\"readystatechange\", function () {\n if (this.readyState === this.DONE) {\n console.log(this.responseText);\n }\n});\n\nxhr.open(\"GET\", \"https://api.infobip.com/sms/1/inbox/logs?keyword=NO_KEYWORD\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"accept\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"results\":[\n {\n \"messageId\":\"606386740726357762\",\n \"from\":\"385998779111\",\n \"to\":\"41793026727\",\n \"text\":\"Message without keyword\",\n \"cleanText\":\"Message without keyword\",\n \"receivedAt\":\"2015-05-20T10:06:46.880+0000\",\n \"smsCount\":1\n },\n {\n \"messageId\":\"3634590217319761028\",\n \"from\":\"385998779111\",\n \"to\":\"41793026727\",\n \"text\":\"Logs test\",\n \"cleanText\":\"Logs test\",\n \"receivedAt\":\"2015-05-20T10:06:17.713+0000\",\n \"smsCount\":1\n }\n ]\n}", "language": "json" }, { "code": "HTTP/1.1 200 OK\nContent-Type: application/xml\n\n<moLogsResponse>\n\t<results>\n <result>\n <messageId>606386740726357762</messageId>\n <from>385998779111</from>\n <to>41793026727</to>\n <text>Message without keyword</text>\n <cleanText>Message without keyword</cleanText>\n <receivedAt>2015-05-20T10:06:46.880+0000</receivedAt>\n <smsCount>1</smsCount>\n </result>\n <result>\n <messageId>3634590217319761028</messageId>\n <from>385998779111</from>\n <to>41793026727</to>\n <text>Logs test</text>\n <cleanText>Logs test</cleanText>\n <receivedAt>2015-05-20T10:06:17.713+0000</receivedAt>\n <smsCount>1</smsCount>\n </result>\n\t</results>\n</moLogsResponse>", "language": "xml" } ] } [/block] # Getting messages received within specified time span You can use `receivedSince` and/or `receivedUntil` to filter messages by `receivedAt` property. Request [block:code] { "codes": [ { "code": "GET /sms/1/inbox/logs?receivedSince=2015-05-20T10:06:16.713%2b00:00&receivedUntil=2015-05-20T10:06:47.880%2b00:00 HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json", "language": "json" } ] } [/block] [block:code] { "codes": [ { "code": "{\n \"results\":[\n {\n \"messageId\":\"606386740726357762\",\n \"from\":\"385998779111\",\n \"to\":\"41793026727\",\n \"text\":\"Message without keyword\",\n \"cleanText\":\"Message without keyword\",\n \"receivedAt\":\"2015-05-20T10:06:46.880+0000\",\n \"smsCount\":1\n },\n {\n \"messageId\":\"3634590217319761028\",\n \"from\":\"385998779111\",\n \"to\":\"41793026727\",\n \"text\":\"Logs test\",\n \"cleanText\":\"Logs test\",\n \"receivedAt\":\"2015-05-20T10:06:17.713+0000\",\n \"smsCount\":1\n }\n ]\n}", "language": "json" } ] } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}