{"_id":"55494b4a6a82a10d00817af5","__v":7,"user":"55208129504fd6230022ae20","project":"55208137623ff50d009b2bec","githubsync":"","parentDoc":null,"version":{"_id":"55208137623ff50d009b2bef","__v":14,"project":"55208137623ff50d009b2bec","createdAt":"2015-04-05T00:26:31.564Z","releaseDate":"2015-04-05T00:26:31.563Z","categories":["55208138623ff50d009b2bf0","55494a226a82a10d00817ae5","55494ba7ee219b0d001743c8","55494bc1ee219b0d001743cc","56ead8c1df765617008bccaf","573a2073dd007d1700cf288f","579695b1f64c9f0e007cd76c","57969e3dfa1ff60e006a1274","579a4592fd9f3c0e008e4f4a","57ab9afe54fa780e006c5430","57b784f5b7ebd60e009cb4a6","58f686818193090f008cec76","59e79fbd4cf31900341d50c6","5b2436973fd93f0003dcf99d"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"55494a226a82a10d00817ae5","project":"55208137623ff50d009b2bec","version":"55208137623ff50d009b2bef","__v":15,"pages":["55494ad0ee219b0d001743bb","55494b05f452670d00ec0c29","55494b11ee219b0d001743bf","55494b20ee219b0d001743c1","55494b2bee219b0d001743c3","55494b4a6a82a10d00817af5","55494b686a82a10d00817af9","5549651ccd09b317005f8f50","55497273cd09b317005f8f86","554977f0c634cf2d001250a7","55b970eab42b610d00c9b2e3","5696f3688560a60d00e2c216","5696f91c59a6692d003fad50","5696f92c24490c3700170a2d","5696f9700b09a41900b24422"],"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-05-05T22:54:26.925Z","from_sync":false,"order":2,"slug":"public-api","title":"Public API"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-05T22:59:22.689Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":true,"order":17,"body":"For people using the [Sonar Ruby Gem](/docs/sonar-ruby-gem). Check out the gem read me for more info.\n\nFor curl users, errors are rendered in json with an appropriate http code and message. The JSON looks like this:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"error\\\":\\\"Bad Token\\\"}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nHere are the errors you may see:\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"Bad Publishable-Key\",\n    \"0-1\": \"401\",\n    \"1-0\": \"Company inactive\",\n    \"h-0\": \"Error Name\",\n    \"h-1\": \"Code\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"The Publishable Key you used is incorrect or can't be found\",\n    \"1-1\": \"403\",\n    \"1-2\": \"Your company account has been set to inactive.\",\n    \"2-0\": \"Company cancelled\",\n    \"2-1\": \"403\",\n    \"2-2\": \"Your company account has been cancelled\",\n    \"3-0\": \"No Active Subscription\",\n    \"3-1\": \"403\",\n    \"3-2\": \"Your company doesn't have an active subscription or the free trial has expired\",\n    \"4-0\": \"Api Disabled For Company\",\n    \"4-1\": \"403\",\n    \"4-2\": \"The API has been disabled for your company\",\n    \"5-0\": \"Invalid Phone Number\",\n    \"5-1\": \"403\",\n    \"5-2\": \"The phone number you provided is invalid\",\n    \"6-0\": \"Trial Customer Limit Reached\",\n    \"6-1\": \"403\",\n    \"6-2\": \"Your company has reached the limit of the number of customers it can add to Sonar as part of a free trial\",\n    \"8-0\": \"Forbidden\",\n    \"8-1\": \"403\",\n    \"8-2\": \"General error for not being able to add a customer and sending a message\",\n    \"7-0\": \"Trial Message Limit Reached\",\n    \"7-1\": \"403\",\n    \"7-2\": \"Your company has reached the limit of the number of messages you can send as part of a free trial\"\n  },\n  \"cols\": 3,\n  \"rows\": 9\n}\n[/block]","excerpt":"","slug":"dealing-with-errors","type":"basic","title":"Errors"}
For people using the [Sonar Ruby Gem](/docs/sonar-ruby-gem). Check out the gem read me for more info. For curl users, errors are rendered in json with an appropriate http code and message. The JSON looks like this: [block:code] { "codes": [ { "code": "{\"error\":\"Bad Token\"}", "language": "text" } ] } [/block] Here are the errors you may see: [block:parameters] { "data": { "0-0": "Bad Publishable-Key", "0-1": "401", "1-0": "Company inactive", "h-0": "Error Name", "h-1": "Code", "h-2": "Description", "0-2": "The Publishable Key you used is incorrect or can't be found", "1-1": "403", "1-2": "Your company account has been set to inactive.", "2-0": "Company cancelled", "2-1": "403", "2-2": "Your company account has been cancelled", "3-0": "No Active Subscription", "3-1": "403", "3-2": "Your company doesn't have an active subscription or the free trial has expired", "4-0": "Api Disabled For Company", "4-1": "403", "4-2": "The API has been disabled for your company", "5-0": "Invalid Phone Number", "5-1": "403", "5-2": "The phone number you provided is invalid", "6-0": "Trial Customer Limit Reached", "6-1": "403", "6-2": "Your company has reached the limit of the number of customers it can add to Sonar as part of a free trial", "8-0": "Forbidden", "8-1": "403", "8-2": "General error for not being able to add a customer and sending a message", "7-0": "Trial Message Limit Reached", "7-1": "403", "7-2": "Your company has reached the limit of the number of messages you can send as part of a free trial" }, "cols": 3, "rows": 9 } [/block]