{"_id":"56afe3db1486990d009c0f50","user":"5582e90181672a3900bb4fc7","category":{"_id":"56ad4e1cd21f1b0d00fd2f97","pages":["56ad4e3f2a7860170013f71c","56ad512eb9ac5517006b696b","56aea6ac70944b0d00c748ac","56aead360c1cab0d009f65dd","56afdf01bc304a0d00ace1f6","56afe3db1486990d009c0f50","56afe6f1b34d210d003d9bbf","56afe729aef9a21700da0e4f","56b006d33c70b01700facf63"],"version":"569f9cf6650e1d1900f96b5e","__v":9,"project":"569f9cf6650e1d1900f96b5b","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-30T23:58:20.127Z","from_sync":false,"order":4,"slug":"company-methods","title":"Company methods"},"project":"569f9cf6650e1d1900f96b5b","githubsync":"","version":{"_id":"569f9cf6650e1d1900f96b5e","project":"569f9cf6650e1d1900f96b5b","__v":12,"createdAt":"2016-01-20T14:43:02.785Z","releaseDate":"2016-01-20T14:43:02.785Z","categories":["569f9cf7650e1d1900f96b5f","56abdd81d4432d1900eed235","56abe0558beeff0d003b8118","56ad2f8b1c09150d00a183a8","56ad4e1cd21f1b0d00fd2f97","56b00ad88f7a4f0d0029dc92","56b2432e9621f20d00efb2bd","56b25826147e900d00d6497a","56b7af2a4b372d2100722c48","56b8c4d938b1070d0028920f","56b8cdab14feef0d0082415d","58599813cf9e112d0032cdab"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":31,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-01T23:01:47.071Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"## Syntax \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    <credentials object>, \\n    \\\"company\\\": <company_name>, \\n    \\\"range\\\": {\\n      \\\"first\\\": <number>\\n      \\\"limit\\\": <number> \\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request fields for get_company_changes\"\n}\n[/block]\nThe following fields can be used in the **get_company_changes** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Definition/Value\",\n    \"0-0\": \"company\",\n    \"0-1\": \"Required\",\n    \"0-2\": \"The name of the company.\",\n    \"1-0\": \"range\",\n    \"1-1\": \"Optional\",\n    \"1-2\": \"The range of results to return. \\n\\nAllowed values are:\\n\\n  * **first** — The 0-based index of the first result to return.\\n  \\n  * **limit** — The maximum number of results to return.\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response fields for get_company_changes\"\n}\n[/block]\nThe following fields may be returned in response to the **get_company_changes** method:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Obligation\",\n    \"h-2\": \"Description/Value\",\n    \"0-0\": \"changes\",\n    \"0-1\": \"Returned if **success = true**\",\n    \"0-2\": \"An array of hashes, one hash for each change returned. The array is sorted by the time of the change, with the earliest change listed first. For each change the following information is returned:\\n\\n  * **application**  — The name of the application used to perform the change. \\n  \\n  * **msg** — A brief summary of the change made. If the changed data is short, it is shown; otherwise, the number of bytes in the new value is shown.\\n  \\n  * **time** — The time that the change was made, in UNIX Epoch time.\\n  \\n  * **user** — The name of the user that performed the change. If the change was performed by the system, the user \\\"OpenSRS\\\" is shown.\",\n    \"1-0\": \"count\",\n    \"1-1\": \"Returned if **success = true**\",\n    \"1-2\": \"The number of items (changes) in the array.\",\n    \"2-0\": \"error\",\n    \"2-1\": \"Returned if **success = true**\",\n    \"3-1\": \"Returned if **success = true**\",\n    \"2-2\": \"A text string that explains the error.\",\n    \"3-0\": \"error_number\",\n    \"3-2\": \"A number that represents the error.\",\n    \"4-0\": \"success\",\n    \"4-1\": \"Always returned\",\n    \"4-2\": \"Indicates whether the request was successful or not. Allowed values are **true** and **false**.\",\n    \"5-0\": \"total_count\",\n    \"5-1\": \"Returned if **success = true**\",\n    \"5-2\": \"The total number of changes available.\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples for get_company_changes\"\n}\n[/block]\n**Request** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"credentials\\\": {\\n    \\\"user\\\": \\\"company_admin:::at:::example.adm\\\",\\n    \\\"password\\\": \\\"sw0rdf1sh\\\"\\n  },\\n  \\\"range\\\": {\\n    \\\"first\\\": 0,\\n    \\\"limit\\\": 500\\n  },\\n  \\\"company\\\": \\\"Example Corp\\\"\\n}\",\n      \"language\": \"perl\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]\n**Response** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"success\\\": true,\\n  \\\"count\\\": 18,\\n  \\\"total_count\\\": 18,\\n  \\\"changes\\\": [\\n    {\\n      \\\"msg\\\": \\\"created 1321901787707\\\",\\n      \\\"time\\\": \\\"1321901787\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    },\\n    {\\n      \\\"msg\\\": \\\"changed quota [5368709120S,2684354C]\\\",\\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed quota_maximum [15360]\\\", \\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed disabled [0]\\\",\\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed createtime [1321901788]\\\", \\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    },\\n    {\\n      \\\"msg\\\": \\\"changed smtprelay_webmail [1]\\\", \\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    },\\n    {\\n      \\\"msg\\\": \\\"changed pop3 [1]\\\",\\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed smtp_sent_limit [500]\\\", \\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed imap4 [1]\\\",\\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed account [1321901787707]\\\", \\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed webmail [1]\\\",\\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    },\\n    {\\n      \\\"msg\\\": \\\"changed smtprelay [1]\\\",\\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed smtpin [1]\\\",\\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed timezone [America/Montreal]\\\", \\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed language [en]\\\",\\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed name [Example Corp]\\\",\\n      \\\"time\\\": \\\"1321901788\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"OpenSRS\\\"\\n    }, \\n    {\\n      \\\"msg\\\": \\\"changed spamtag [[JUNK]]\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"company_admin@example.adm\\\"\\n      \\\"time\\\": \\\"1326401277\\\",\\n    },\\n    {\\n      \\\"msg\\\": \\\"changed block [*@spammers.com]\\\", \\n      \\\"time\\\": \\\"1326401294\\\",\\n      \\\"application\\\": \\\"OMA\\\",\\n      \\\"user\\\": \\\"company_admin@example.adm\\\"\\n    } \\n  ]\\n}\",\n      \"language\": \"text\",\n      \"name\": \"  \"\n    }\n  ]\n}\n[/block]","excerpt":"The **get_company_changes** method retrieves a summary of the changes that have been made to a company.","slug":"get_company_changes","type":"basic","title":"get_company_changes"}

get_company_changes

The **get_company_changes** method retrieves a summary of the changes that have been made to a company.

## Syntax [block:code] { "codes": [ { "code": "{\n <credentials object>, \n \"company\": <company_name>, \n \"range\": {\n \"first\": <number>\n \"limit\": <number> \n}", "language": "perl", "name": " " } ] } [/block] [block:api-header] { "type": "basic", "title": "Request fields for get_company_changes" } [/block] The following fields can be used in the **get_company_changes** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Definition/Value", "0-0": "company", "0-1": "Required", "0-2": "The name of the company.", "1-0": "range", "1-1": "Optional", "1-2": "The range of results to return. \n\nAllowed values are:\n\n * **first** — The 0-based index of the first result to return.\n \n * **limit** — The maximum number of results to return." }, "cols": 3, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Response fields for get_company_changes" } [/block] The following fields may be returned in response to the **get_company_changes** method: [block:parameters] { "data": { "h-0": "Field name", "h-1": "Obligation", "h-2": "Description/Value", "0-0": "changes", "0-1": "Returned if **success = true**", "0-2": "An array of hashes, one hash for each change returned. The array is sorted by the time of the change, with the earliest change listed first. For each change the following information is returned:\n\n * **application** — The name of the application used to perform the change. \n \n * **msg** — A brief summary of the change made. If the changed data is short, it is shown; otherwise, the number of bytes in the new value is shown.\n \n * **time** — The time that the change was made, in UNIX Epoch time.\n \n * **user** — The name of the user that performed the change. If the change was performed by the system, the user \"OpenSRS\" is shown.", "1-0": "count", "1-1": "Returned if **success = true**", "1-2": "The number of items (changes) in the array.", "2-0": "error", "2-1": "Returned if **success = true**", "3-1": "Returned if **success = true**", "2-2": "A text string that explains the error.", "3-0": "error_number", "3-2": "A number that represents the error.", "4-0": "success", "4-1": "Always returned", "4-2": "Indicates whether the request was successful or not. Allowed values are **true** and **false**.", "5-0": "total_count", "5-1": "Returned if **success = true**", "5-2": "The total number of changes available." }, "cols": 3, "rows": 6 } [/block] [block:api-header] { "type": "basic", "title": "Examples for get_company_changes" } [/block] **Request** [block:code] { "codes": [ { "code": "{\n \"credentials\": {\n \"user\": \"company_admin@example.adm\",\n \"password\": \"sw0rdf1sh\"\n },\n \"range\": {\n \"first\": 0,\n \"limit\": 500\n },\n \"company\": \"Example Corp\"\n}", "language": "perl", "name": " " } ] } [/block] **Response** [block:code] { "codes": [ { "code": "{\n \"success\": true,\n \"count\": 18,\n \"total_count\": 18,\n \"changes\": [\n {\n \"msg\": \"created 1321901787707\",\n \"time\": \"1321901787\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n },\n {\n \"msg\": \"changed quota [5368709120S,2684354C]\",\n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed quota_maximum [15360]\", \n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed disabled [0]\",\n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed createtime [1321901788]\", \n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n },\n {\n \"msg\": \"changed smtprelay_webmail [1]\", \n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n },\n {\n \"msg\": \"changed pop3 [1]\",\n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed smtp_sent_limit [500]\", \n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed imap4 [1]\",\n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed account [1321901787707]\", \n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed webmail [1]\",\n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n },\n {\n \"msg\": \"changed smtprelay [1]\",\n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed smtpin [1]\",\n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed timezone [America/Montreal]\", \n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed language [en]\",\n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed name [Example Corp]\",\n \"time\": \"1321901788\",\n \"application\": \"OMA\",\n \"user\": \"OpenSRS\"\n }, \n {\n \"msg\": \"changed spamtag [[JUNK]]\",\n \"application\": \"OMA\",\n \"user\": \"company_admin@example.adm\"\n \"time\": \"1326401277\",\n },\n {\n \"msg\": \"changed block [*@spammers.com]\", \n \"time\": \"1326401294\",\n \"application\": \"OMA\",\n \"user\": \"company_admin@example.adm\"\n } \n ]\n}", "language": "text", "name": " " } ] } [/block]