{"_id":"56a0d36544f3d80d00a2c242","parentDoc":null,"__v":1,"category":{"_id":"56d8147c3eb4dd0b00201aac","project":"54eb50e5615ffc1900305a16","version":"54eb63b859b1172100334fae","__v":0,"pages":[],"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-03-03T10:39:56.158Z","from_sync":false,"order":19,"slug":"settings","title":"Settings"},"project":"54eb50e5615ffc1900305a16","editedParams":true,"editedParams2":true,"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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-21T12:47:33.045Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"json","code":"GET settings/1/accounts/EF04794F718A3FC8C6DFA0B215B2CF24 HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json"},{"language":"xml","code":"GET settings/1/accounts/EF04794F718A3FC8C6DFA0B215B2CF24 HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\nAccept: application/xml"},{"language":"curl","code":"curl -H \"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\" -H \"Content-Type: application/json\" 'https://api.infobip.com/settings/1/accounts/EF04794F718A3FC8C6DFA0B215B2CF24'"},{"code":"<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n  CURLOPT_URL => \"https://api.infobip.com/settings/1/accounts/EF04794F718A3FC8C6DFA0B215B2CF24\",\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_HTTPHEADER => array(\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"},{"language":"ruby","code":"require 'uri'\nrequire 'net/http'\n\nurl = URI(\"https://api.infobip.com/settings/1/accounts/EF04794F718A3FC8C6DFA0B215B2CF24\")\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[\"content-type\"] = 'application/json'\n\nresponse = http.request(request)\nputs response.read_body"},{"code":"import http.client\n\nconn = http.client.HTTPSConnection(\"api.infobip.com\")\n\nheaders = {\n    'authorization': \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\",\n    'content-type': \"application/json\"\n    }\n\nconn.request(\"GET\", \"/settings/1/accounts/EF04794F718A3FC8C6DFA0B215B2CF24\", 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/settings/1/accounts/EF04794F718A3FC8C6DFA0B215B2CF24\")\n  .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n  .header(\"content-type\", \"application/json\")\n  .asString();","language":"java"},{"code":"var client = new RestClient(\"https://api.infobip.com/settings/1/accounts/EF04794F718A3FC8C6DFA0B215B2CF24\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nIRestResponse response = client.Execute(request);","language":"csharp"},{"code":"var 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/settings/1/accounts/EF04794F718A3FC8C6DFA0B215B2CF24\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\n\nxhr.send(data);","language":"javascript"}]},"method":"get","results":{"codes":[{"code":"{\n  \"key\": \"EF04794F718A3FC8C6DFA0B215B2CF24\",  \n  \"ownerKey\": \"28A3FC8C615B2CF24E1DFA0BF04794F7\",\n  \"name\": \"AccountName\",\n  \"enabled\": true\n}","name":"","status":200,"language":"json"},{"status":200,"language":"xml","code":"<?xml version='1.0' encoding='UTF-8'?>\n<account>\n    <key>EF04794F718A3FC8C6DFA0B215B2CF24</key>\n    <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\n    <name>AccountName</name>\n    <enabled>true</enabled>\n</account>","name":"OK - XML"},{"code":"{\n  \"requestError\": {\n    \"serviceException\": {\n      \"messageId\": \"BAD_REQUEST\",\n      \"text\": \"Bad request\"\n    }\n  }\n}","language":"json","status":400}]},"settings":"","auth":"required","params":[{"_id":"568b907a0b857d1900905f8d","ref":"","in":"path","required":false,"desc":"Key used to uniquely identify the account. Use _ as parameter value for your current account or account key for sub accounts.","default":"","type":"string","name":"key"},{"_id":"568b907a0b857d1900905f8c","ref":"","in":"query","required":false,"desc":"Account name.","default":"","type":"string","name":"name"},{"_id":"5693b6825f1c951900644b38","ref":"","in":"query","required":false,"desc":"Status of the account (enabled or disabled).","default":"","type":"boolean","name":"enabled"},{"_id":"5693b6825f1c951900644b37","ref":"","in":"query","required":false,"desc":"Number of accounts to fetch.","default":"","type":"int","name":"limit"}],"url":"/settings/:version/accounts/:key"},"isReference":true,"order":3,"body":"# Response format \n\nIf successful, response header HTTP status code will be `200 OK` and the account will be fetched.\n\nIf you try to get account(s) without authorization, you will receive an `401 Unauthorized` error.\n\n### Account\n\n|Parameter|Type|Description|\n|-|-|-|\n|*key*|String|Key used to uniquely identify the account.|\n|*ownerKey*|String|Key which uniquely identifies account's owner.|\n|*name*|String|Account name.|\n|*enabled*|Boolean|Whether account is enabled for use.|\n[block:api-header]\n{\n  \"type\": \"get\",\n  \"title\": \"Additional examples\"\n}\n[/block]\n# Get all accounts\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If **all** accounts are wanted, the **key** parameter must be omitted.\"\n}\n[/block]\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET settings/1/accounts HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\nAccept: application/json\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"GET settings/1/accounts HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/xml\\nAccept: application/xml\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -H \\\"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\" -H \\\"Content-Type: application/json\\\" 'https://api.infobip.com/settings/1/accounts'\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$curl = curl_init();\\n\\ncurl_setopt_array($curl, array(\\n  CURLOPT_URL => \\\"https://api.infobip.com/settings/1/accounts\\\",\\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_HTTPHEADER => array(\\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/settings/1/accounts\\\")\\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[\\\"content-type\\\"] = '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    'content-type': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"GET\\\", \\\"/settings/1/accounts\\\", 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/settings/1/accounts\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/settings/1/accounts\\\");\\nvar request = new RestRequest(Method.GET);\\nrequest.AddHeader(\\\"content-type\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var 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/settings/1/accounts\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"content-type\\\", \\\"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\\t\\\"accounts\\\": [\\n    {\\n  \\t\\t\\\"key\\\": \\\"EF04794F718A3FC8C6DFA0B215B2CF24\\\",  \\n  \\t\\t\\\"ownerKey\\\": \\\"28A3FC8C615B2CF24E1DFA0BF04794F7\\\",\\n  \\t\\t\\\"name\\\": \\\"AccountName\\\",\\n  \\t\\t\\\"enabled\\\": true\\n\\t\\t},\\n    {\\n  \\t\\t\\\"key\\\": \\\"C599FEF17318256ACBF987F6D75A156D\\\",  \\n  \\t\\t\\\"ownerKey\\\": \\\"28A3FC8C615B2CF24E1DFA0BF04794F7\\\",\\n  \\t\\t\\\"name\\\": \\\"SecondAccountName\\\",\\n  \\t\\t\\\"enabled\\\": true\\n\\t\\t},\\n    {\\n  \\t\\t\\\"key\\\": \\\"02D7060AA84699271CD92369F2DEBABF\\\",  \\n  \\t\\t\\\"ownerKey\\\": \\\"28A3FC8C615B2CF24E1DFA0BF04794F7\\\",\\n  \\t\\t\\\"name\\\": \\\"DisabledAccount\\\",\\n  \\t\\t\\\"enabled\\\": false\\n\\t\\t}\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"<?xml version='1.0' encoding='UTF-8'?>\\n<accountsResponse>\\n  <accounts>\\n    <account>\\n      <name>AccountName</name>\\n      <key>EF04794F718A3FC8C6DFA0B215B2CF24</key>\\n      <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\\n      <enabled>true</enabled>\\n    </account>\\n    <account>\\n      <name>SecondAccountName</name>\\n      <key>C599FEF17318256ACBF987F6D75A156D</key>\\n      <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\\n      <enabled>true</enabled>\\n    </account>\\n    <account>\\n      <name>DisabledAccount</name>\\n      <key>02D7060AA84699271CD92369F2DEBABF</key>\\n      <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\\n      <enabled>true</enabled>\\n    </account>\\n  </accounts>\\n</accountsResponse>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - XML\"\n    }\n  ]\n}\n[/block]\n## Response format \n\nIf successful, response header HTTP status code will be `200 OK` and all accounts will be returned.\n\nIf you try to get the accounts without authorization, you will receive an `401 Unauthorized` error.\n\n### Accounts Response\n|Parameter|Type|Description|\n|-|-|-|\n|*accounts*|[Account[]](#section-account)|Array of accounts.|\n\n### Account\n\n|Parameter|Type|Description|\n|-|-|-|\n|*key*|String|Key used to uniquely identify the account.|\n|*ownerKey*|String|Key which uniquely identifies account's owner.|\n|*name*|String|Account name.|\n|*enabled*|Boolean|Whether account is enabled for use.|\n\n# Get account by name\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Usage of **key** and **name**, **enabled** and **limit** parameters is **exclusive**. With *key* **path** parameter, specific account is returned, but with **query** parameter *name* (or *enabled*), list of accounts is returned, filtered by specified parameter value.\",\n  \"title\": \"Caution!\"\n}\n[/block]\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET settings/1/accounts?name=AccountName HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\nAccept: application/json\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"GET settings/1/accounts?name=AccountName HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\nAccept: application/json\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -H \\\"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\" -H \\\"Content-Type: application/json\\\" 'https://api.infobip.com/settings/1/accounts?name=AccountName'\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$curl = curl_init();\\n\\ncurl_setopt_array($curl, array(\\n  CURLOPT_URL => \\\"https://api.infobip.com/settings/1/accounts?name=AccountName\\\",\\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_HTTPHEADER => array(\\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/settings/1/accounts?name=AccountName\\\")\\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[\\\"content-type\\\"] = '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    'content-type': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"GET\\\", \\\"settings/1/accounts?name=AccountName\\\", 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/settings/1/accounts?name=AccountName\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/settings/1/accounts?name=AccountName\\\");\\nvar request = new RestRequest(Method.GET);\\nrequest.AddHeader(\\\"content-type\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var 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/settings/1/accounts?name=AccountName\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"content-type\\\", \\\"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  \\\"accounts\\\":[\\n    {\\n  \\t\\t\\\"key\\\": \\\"EF04794F718A3FC8C6DFA0B215B2CF24\\\",  \\n  \\t\\t\\\"ownerKey\\\": \\\"28A3FC8C615B2CF24E1DFA0BF04794F7\\\",\\n  \\t\\t\\\"name\\\": \\\"AccountName\\\",\\n  \\t\\t\\\"enabled\\\": true\\n\\t\\t}\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"<?xml version='1.0' encoding='UTF-8'?>\\n<account>\\n    <key>EF04794F718A3FC8C6DFA0B215B2CF24</key>\\n    <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\\n    <name>AccountName</name>\\n    <enabled>true</enabled>\\n</account>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - XML\"\n    }\n  ]\n}\n[/block]\n# Get only enabled accounts\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET settings/1/accounts?enabled=true HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\nAccept: application/json\\n\",\n      \"language\": \"json\"\n    },\n    {\n      \"code\": \"GET settings/1/accounts?enabled=true HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nContent-Type: application/json\\nAccept: application/json\\n\",\n      \"language\": \"xml\"\n    },\n    {\n      \"code\": \"curl -H \\\"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\" -H \\\"Content-Type: application/json\\\" 'https://api.infobip.com/settings/1/accounts?enabled=true'\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$curl = curl_init();\\n\\ncurl_setopt_array($curl, array(\\n  CURLOPT_URL => \\\"https://api.infobip.com/settings/1/accounts?enabled=true\\\",\\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_HTTPHEADER => array(\\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/settings/1/accounts?enabled=true\\\")\\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[\\\"content-type\\\"] = '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    'content-type': \\\"application/json\\\"\\n    }\\n\\nconn.request(\\\"GET\\\", \\\"settings/1/accounts?enabled=true\\\", 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/settings/1/accounts?enabled=true\\\")\\n  .header(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var client = new RestClient(\\\"https://api.infobip.com/settings/1/accounts?enabled=true\\\");\\nvar request = new RestRequest(Method.GET);\\nrequest.AddHeader(\\\"content-type\\\", \\\"application/json\\\");\\nrequest.AddHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nIRestResponse response = client.Execute(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"var 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/settings/1/accounts?enabled=true\\\");\\nxhr.setRequestHeader(\\\"authorization\\\", \\\"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\\");\\nxhr.setRequestHeader(\\\"content-type\\\", \\\"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  \\\"accounts\\\":[\\n    {\\n  \\t\\t\\\"key\\\": \\\"EF04794F718A3FC8C6DFA0B215B2CF24\\\",  \\n  \\t\\t\\\"ownerKey\\\": \\\"28A3FC8C615B2CF24E1DFA0BF04794F7\\\",\\n  \\t\\t\\\"name\\\": \\\"AccountName\\\",\\n  \\t\\t\\\"enabled\\\": true\\n\\t\\t},\\n    {\\n  \\t\\t\\\"key\\\": \\\"C599FEF17318256ACBF987F6D75A156D\\\",  \\n  \\t\\t\\\"ownerKey\\\": \\\"28A3FC8C615B2CF24E1DFA0BF04794F7\\\",\\n  \\t\\t\\\"name\\\": \\\"SecondAccountName\\\",\\n  \\t\\t\\\"enabled\\\": true\\n\\t\\t}\\n  ]\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"<?xml version='1.0' encoding='UTF-8'?>\\n<accountsResponse>\\n  <accounts>\\n    <account>\\n      <name>AccountName</name>\\n      <key>EF04794F718A3FC8C6DFA0B215B2CF24</key>\\n      <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\\n      <enabled>true</enabled>\\n    </account>\\n    <account>\\n      <name>SecondAccountName</name>\\n      <key>C599FEF17318256ACBF987F6D75A156D</key>\\n      <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\\n      <enabled>true</enabled>\\n    </account>\\n  </accounts>\\n</accountsResponse>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - XML\"\n    }\n  ]\n}\n[/block]\n# Get main account\n\nIn order to get your main account use the `_` as a value of the path parameter:\n\n**Request**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET settings/1/accounts/_ HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/json\",\n      \"language\": \"http\",\n      \"name\": \"HTTP - JSON\"\n    },\n    {\n      \"code\": \"GET settings/1/accounts/_ HTTP/1.1\\nHost: api.infobip.com\\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\\nAccept: application/xml\",\n      \"language\": \"http\",\n      \"name\": \"HTTP - XML\"\n    }\n  ]\n}\n[/block]\n**Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"key\\\": \\\"28A3FC8C615B2CF24E1DFA0BF04794F7\\\",\\n  \\\"name\\\": \\\"Main account name\\\",\\n  \\\"enabled\\\": true\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK - JSON\"\n    },\n    {\n      \"code\": \"<?xml version='1.0' encoding='UTF-8'?>\\n<account>\\n    <key>28A3FC8C615B2CF24E1DFA0BF04794F7</key>\\n    <name>Main account name</name>\\n    <enabled>true</enabled>\\n</account>\",\n      \"language\": \"xml\",\n      \"name\": \"200 OK - XML\"\n    }\n  ]\n}\n[/block]","excerpt":"This method allows you to get accounts. Specific, all, and filtered accounts could be fetched with this method.","slug":"account-get","type":"endpoint","title":"Account: Get"}

getAccount: Get

This method allows you to get accounts. Specific, all, and filtered accounts could be fetched with this method.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

key:
string
Key used to uniquely identify the account. Use _ as parameter value for your current account or account key for sub accounts.

Query Params

name:
string
Account name.
enabled:
boolean
Status of the account (enabled or disabled).
limit:
integer
Number of accounts to fetch.

Examples


Result Format


Documentation

# Response format If successful, response header HTTP status code will be `200 OK` and the account will be fetched. If you try to get account(s) without authorization, you will receive an `401 Unauthorized` error. ### Account |Parameter|Type|Description| |-|-|-| |*key*|String|Key used to uniquely identify the account.| |*ownerKey*|String|Key which uniquely identifies account's owner.| |*name*|String|Account name.| |*enabled*|Boolean|Whether account is enabled for use.| [block:api-header] { "type": "get", "title": "Additional examples" } [/block] # Get all accounts [block:callout] { "type": "info", "body": "If **all** accounts are wanted, the **key** parameter must be omitted." } [/block] **Request** [block:code] { "codes": [ { "code": "GET settings/1/accounts HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json", "language": "json" }, { "code": "GET settings/1/accounts HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/xml\nAccept: application/xml", "language": "xml" }, { "code": "curl -H \"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\" -H \"Content-Type: application/json\" 'https://api.infobip.com/settings/1/accounts'", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"https://api.infobip.com/settings/1/accounts\",\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_HTTPHEADER => array(\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/settings/1/accounts\")\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[\"content-type\"] = '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 'content-type': \"application/json\"\n }\n\nconn.request(\"GET\", \"/settings/1/accounts\", 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/settings/1/accounts\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"content-type\", \"application/json\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/settings/1/accounts\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var 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/settings/1/accounts\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n\t\"accounts\": [\n {\n \t\t\"key\": \"EF04794F718A3FC8C6DFA0B215B2CF24\", \n \t\t\"ownerKey\": \"28A3FC8C615B2CF24E1DFA0BF04794F7\",\n \t\t\"name\": \"AccountName\",\n \t\t\"enabled\": true\n\t\t},\n {\n \t\t\"key\": \"C599FEF17318256ACBF987F6D75A156D\", \n \t\t\"ownerKey\": \"28A3FC8C615B2CF24E1DFA0BF04794F7\",\n \t\t\"name\": \"SecondAccountName\",\n \t\t\"enabled\": true\n\t\t},\n {\n \t\t\"key\": \"02D7060AA84699271CD92369F2DEBABF\", \n \t\t\"ownerKey\": \"28A3FC8C615B2CF24E1DFA0BF04794F7\",\n \t\t\"name\": \"DisabledAccount\",\n \t\t\"enabled\": false\n\t\t}\n ]\n}", "language": "json", "name": "200 OK - JSON" }, { "code": "<?xml version='1.0' encoding='UTF-8'?>\n<accountsResponse>\n <accounts>\n <account>\n <name>AccountName</name>\n <key>EF04794F718A3FC8C6DFA0B215B2CF24</key>\n <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\n <enabled>true</enabled>\n </account>\n <account>\n <name>SecondAccountName</name>\n <key>C599FEF17318256ACBF987F6D75A156D</key>\n <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\n <enabled>true</enabled>\n </account>\n <account>\n <name>DisabledAccount</name>\n <key>02D7060AA84699271CD92369F2DEBABF</key>\n <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\n <enabled>true</enabled>\n </account>\n </accounts>\n</accountsResponse>", "language": "xml", "name": "200 OK - XML" } ] } [/block] ## Response format If successful, response header HTTP status code will be `200 OK` and all accounts will be returned. If you try to get the accounts without authorization, you will receive an `401 Unauthorized` error. ### Accounts Response |Parameter|Type|Description| |-|-|-| |*accounts*|[Account[]](#section-account)|Array of accounts.| ### Account |Parameter|Type|Description| |-|-|-| |*key*|String|Key used to uniquely identify the account.| |*ownerKey*|String|Key which uniquely identifies account's owner.| |*name*|String|Account name.| |*enabled*|Boolean|Whether account is enabled for use.| # Get account by name [block:callout] { "type": "warning", "body": "Usage of **key** and **name**, **enabled** and **limit** parameters is **exclusive**. With *key* **path** parameter, specific account is returned, but with **query** parameter *name* (or *enabled*), list of accounts is returned, filtered by specified parameter value.", "title": "Caution!" } [/block] **Request** [block:code] { "codes": [ { "code": "GET settings/1/accounts?name=AccountName HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json", "language": "json" }, { "code": "GET settings/1/accounts?name=AccountName HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json", "language": "xml" }, { "code": "curl -H \"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\" -H \"Content-Type: application/json\" 'https://api.infobip.com/settings/1/accounts?name=AccountName'", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"https://api.infobip.com/settings/1/accounts?name=AccountName\",\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_HTTPHEADER => array(\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/settings/1/accounts?name=AccountName\")\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[\"content-type\"] = '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 'content-type': \"application/json\"\n }\n\nconn.request(\"GET\", \"settings/1/accounts?name=AccountName\", 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/settings/1/accounts?name=AccountName\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"content-type\", \"application/json\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/settings/1/accounts?name=AccountName\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var 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/settings/1/accounts?name=AccountName\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"accounts\":[\n {\n \t\t\"key\": \"EF04794F718A3FC8C6DFA0B215B2CF24\", \n \t\t\"ownerKey\": \"28A3FC8C615B2CF24E1DFA0BF04794F7\",\n \t\t\"name\": \"AccountName\",\n \t\t\"enabled\": true\n\t\t}\n ]\n}", "language": "json", "name": "200 OK - JSON" }, { "code": "<?xml version='1.0' encoding='UTF-8'?>\n<account>\n <key>EF04794F718A3FC8C6DFA0B215B2CF24</key>\n <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\n <name>AccountName</name>\n <enabled>true</enabled>\n</account>", "language": "xml", "name": "200 OK - XML" } ] } [/block] # Get only enabled accounts **Request** [block:code] { "codes": [ { "code": "GET settings/1/accounts?enabled=true HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json\n", "language": "json" }, { "code": "GET settings/1/accounts?enabled=true HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nContent-Type: application/json\nAccept: application/json\n", "language": "xml" }, { "code": "curl -H \"Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\" -H \"Content-Type: application/json\" 'https://api.infobip.com/settings/1/accounts?enabled=true'", "language": "curl" }, { "code": "<?php\n\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n CURLOPT_URL => \"https://api.infobip.com/settings/1/accounts?enabled=true\",\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_HTTPHEADER => array(\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/settings/1/accounts?enabled=true\")\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[\"content-type\"] = '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 'content-type': \"application/json\"\n }\n\nconn.request(\"GET\", \"settings/1/accounts?enabled=true\", 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/settings/1/accounts?enabled=true\")\n .header(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\")\n .header(\"content-type\", \"application/json\")\n .asString();", "language": "java" }, { "code": "var client = new RestClient(\"https://api.infobip.com/settings/1/accounts?enabled=true\");\nvar request = new RestRequest(Method.GET);\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nIRestResponse response = client.Execute(request);", "language": "csharp" }, { "code": "var 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/settings/1/accounts?enabled=true\");\nxhr.setRequestHeader(\"authorization\", \"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\");\nxhr.setRequestHeader(\"content-type\", \"application/json\");\n\nxhr.send(data);", "language": "javascript" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"accounts\":[\n {\n \t\t\"key\": \"EF04794F718A3FC8C6DFA0B215B2CF24\", \n \t\t\"ownerKey\": \"28A3FC8C615B2CF24E1DFA0BF04794F7\",\n \t\t\"name\": \"AccountName\",\n \t\t\"enabled\": true\n\t\t},\n {\n \t\t\"key\": \"C599FEF17318256ACBF987F6D75A156D\", \n \t\t\"ownerKey\": \"28A3FC8C615B2CF24E1DFA0BF04794F7\",\n \t\t\"name\": \"SecondAccountName\",\n \t\t\"enabled\": true\n\t\t}\n ]\n}", "language": "json", "name": "200 OK - JSON" }, { "code": "<?xml version='1.0' encoding='UTF-8'?>\n<accountsResponse>\n <accounts>\n <account>\n <name>AccountName</name>\n <key>EF04794F718A3FC8C6DFA0B215B2CF24</key>\n <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\n <enabled>true</enabled>\n </account>\n <account>\n <name>SecondAccountName</name>\n <key>C599FEF17318256ACBF987F6D75A156D</key>\n <ownerKey>28A3FC8C615B2CF24E1DFA0BF04794F7</ownerKey>\n <enabled>true</enabled>\n </account>\n </accounts>\n</accountsResponse>", "language": "xml", "name": "200 OK - XML" } ] } [/block] # Get main account In order to get your main account use the `_` as a value of the path parameter: **Request** [block:code] { "codes": [ { "code": "GET settings/1/accounts/_ HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/json", "language": "http", "name": "HTTP - JSON" }, { "code": "GET settings/1/accounts/_ HTTP/1.1\nHost: api.infobip.com\nAuthorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\nAccept: application/xml", "language": "http", "name": "HTTP - XML" } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"key\": \"28A3FC8C615B2CF24E1DFA0BF04794F7\",\n \"name\": \"Main account name\",\n \"enabled\": true\n}", "language": "json", "name": "200 OK - JSON" }, { "code": "<?xml version='1.0' encoding='UTF-8'?>\n<account>\n <key>28A3FC8C615B2CF24E1DFA0BF04794F7</key>\n <name>Main account name</name>\n <enabled>true</enabled>\n</account>", "language": "xml", "name": "200 OK - XML" } ] } [/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 }}