{"_id":"56565d42c8330e0d00aa1526","api":{"auth":"required","params":[],"results":{"codes":[]},"settings":"","url":""},"githubsync":"","hidden":false,"project":"565416f3ac09cc2100feb2d5","sync_unique":"","user":"565416cace43aa21002b2566","createdAt":"2015-11-26T01:15:46.279Z","isReference":false,"link_url":"","type":"basic","updates":["56b2d285a5a1020d00cf4d29"],"order":0,"parentDoc":null,"slug":"introduction","__v":2,"body":"Supportbench is a customer support and helpdesk platform. Many customers use the Supportbench API in order to create custom workflows or integrations with internal systems.","category":"565416f4ac09cc2100feb2d9","excerpt":"","link_external":false,"title":"Introduction","version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

Introduction


Supportbench is a customer support and helpdesk platform. Many customers use the Supportbench API in order to create custom workflows or integrations with internal systems.
{"_id":"565659bcf8bb010d00ca6b82","user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","category":"565416f4ac09cc2100feb2d9","excerpt":"","isReference":false,"link_url":"","next":{"pages":[],"description":""},"order":1,"parentDoc":null,"slug":"api","type":"basic","sync_unique":"","createdAt":"2015-11-26T01:00:44.896Z","title":"Authentication","updates":[],"api":{"auth":"required","params":[],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"language":"json","code":"{}","name":"","status":400}]},"settings":"","url":""},"body":"The API is an SSL only. You must be a verified user with the proper security role to make API requests. You can authorize against the API using an OAuth access token.\n\nTo obtain a token, you will need to post your username and password to https://api.supportbench.net/oauth/token with a grant type of password.\n\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var credentials = {grant_type: \\\"password\\\",username: \\\"myemail@mydomain.com\\\",password: \\\"123456789\\\"};\\n\\n$.ajax({\\n    type: \\\"post\\\",\\n    url: \\\"https://api.supportbench.net/oauth/token\\\",\\n    data: credentials,\\n    contentType: 'application/x-www-form-urlencoded',\\n    success: function (result) {\\n        alert(r.access_token);\\n    }\\n});\",\n      \"language\": \"javascript\",\n      \"name\": \"jQuery\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Storing your new token\"\n}\n[/block]\nThere are several ways to store your token for use.  Each token expires after 7 days of being issued, so that token will need to be renewed every 7 days.\n\n1. HTML5 Web Storage (localStorage/sessionStorage)\n2. Cookies\n3. Code behind\n\nWe highly suggest using cookies if you are using local storage to avoid XSS vulnerabilities  or server side storage (PHP, .NET, Ruby, etc..).","githubsync":"","hidden":false,"link_external":false,"project":"565416f3ac09cc2100feb2d5","__v":6,"childrenPages":[]}

Authentication


The API is an SSL only. You must be a verified user with the proper security role to make API requests. You can authorize against the API using an OAuth access token. To obtain a token, you will need to post your username and password to https://api.supportbench.net/oauth/token with a grant type of password. [block:code] { "codes": [ { "code": "var credentials = {grant_type: \"password\",username: \"myemail@mydomain.com\",password: \"123456789\"};\n\n$.ajax({\n type: \"post\",\n url: \"https://api.supportbench.net/oauth/token\",\n data: credentials,\n contentType: 'application/x-www-form-urlencoded',\n success: function (result) {\n alert(r.access_token);\n }\n});", "language": "javascript", "name": "jQuery" } ] } [/block] [block:api-header] { "type": "basic", "title": "Storing your new token" } [/block] There are several ways to store your token for use. Each token expires after 7 days of being issued, so that token will need to be renewed every 7 days. 1. HTML5 Web Storage (localStorage/sessionStorage) 2. Cookies 3. Code behind We highly suggest using cookies if you are using local storage to avoid XSS vulnerabilities or server side storage (PHP, .NET, Ruby, etc..).
The API is an SSL only. You must be a verified user with the proper security role to make API requests. You can authorize against the API using an OAuth access token. To obtain a token, you will need to post your username and password to https://api.supportbench.net/oauth/token with a grant type of password. [block:code] { "codes": [ { "code": "var credentials = {grant_type: \"password\",username: \"myemail@mydomain.com\",password: \"123456789\"};\n\n$.ajax({\n type: \"post\",\n url: \"https://api.supportbench.net/oauth/token\",\n data: credentials,\n contentType: 'application/x-www-form-urlencoded',\n success: function (result) {\n alert(r.access_token);\n }\n});", "language": "javascript", "name": "jQuery" } ] } [/block] [block:api-header] { "type": "basic", "title": "Storing your new token" } [/block] There are several ways to store your token for use. Each token expires after 7 days of being issued, so that token will need to be renewed every 7 days. 1. HTML5 Web Storage (localStorage/sessionStorage) 2. Cookies 3. Code behind We highly suggest using cookies if you are using local storage to avoid XSS vulnerabilities or server side storage (PHP, .NET, Ruby, etc..).
{"_id":"5657982ac196311700797979","isReference":true,"link_external":false,"link_url":"","slug":"create-a-new-case","sync_unique":"","user":"565416cace43aa21002b2566","api":{"results":{"codes":[{"status":200,"language":"json","code":"{\"id\":\"C-1000\"}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/case","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var case_id = null;\nvar case_data = {\n  \t\"id_prefix\":\"C\", //not required for case updates\n    \"id_source\":\"123456\", //not required for case updates, only if you want to customize your case id\n  \t\"id\":\"C-1000\", //required for case updates, omit of null value to create a new case\n    \"division_id\": 3, //required for case creations\n    \"status_id\": 1,\n    \"min_to_close\": 0, //used only when closing a case\n    \"owner_id\": \"1\",\n    \"priority_id\": \"3\", //required for case creations\n    \"issue_id\": \"2\",\n    \"outcome_id\": 0, //used when closing a case\n    \"asset_id\": \"\",\n    \"company_id\": \"SFCP-0011a000004fp6NAAQ\",\n    \"contact_id\": \"SFCT-0031a000004A98pAAC\",\n    \"subject\": \"API Case\", //required for case creations\n    \"summary\": \"REST API created case\",\n    \"tags\": [\"api\", \"api_case\"],\n    \"fields\": [{\n        'id': 6,\n        'value': '1234567890'\n    }, {\n        'id': 7,\n        'value': 'true'\n    }]\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/case',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(case_data),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        case_id = jQuery.parseJSON(r).id;\n    }\n});","language":"javascript"}]},"method":"post","params":[]},"category":"5656ac105656350d001d83a8","githubsync":"","order":0,"title":"Create / Update a Case","type":"post","body":"Creating and updating a case from the API can be done by posting your case object to Supportbench. \n\nThe only difference between case creations and updates is including a case id within the case object.\n\nWhen creating or updating a case, the below fields are available to you.\n[block:parameters]\n{\n  \"data\": {\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-0\": \"Name\",\n    \"0-0\": \"id_prefix\",\n    \"0-1\": \"no\",\n    \"0-2\": \"5 characters\",\n    \"0-3\": \"\\\"C\\\"\",\n    \"h-3\": \"Default\",\n    \"3-0\": \"division_id\",\n    \"3-1\": \"**yes**\",\n    \"3-2\": \"Integer\",\n    \"3-3\": \"-\",\n    \"4-0\": \"status_id\",\n    \"4-1\": \"no\",\n    \"4-2\": \"Integer\",\n    \"4-3\": \"1\",\n    \"h-4\": \"Availability\",\n    \"0-4\": \"New\",\n    \"3-4\": \"New / Update\",\n    \"4-4\": \"New / Update\",\n    \"h-5\": \"Summary\",\n    \"0-5\": \"The prefix of the case.  You can assign new case prefix's within the API administration section.\",\n    \"3-5\": \"The case category id.\",\n    \"4-5\": \"The case status id.\",\n    \"2-0\": \"id\",\n    \"2-1\": \"no - when creating \\nyes - when updating\",\n    \"2-2\": \"30 characters\",\n    \"2-3\": \"-\",\n    \"2-4\": \"Update\",\n    \"2-5\": \"The full case id including the prefix.\",\n    \"6-0\": \"owner_id\",\n    \"7-0\": \"priority_id\",\n    \"8-0\": \"issue_id\",\n    \"10-0\": \"asset_id\",\n    \"11-0\": \"company_id\",\n    \"6-1\": \"no\",\n    \"7-1\": \"**yes**\",\n    \"8-1\": \"no\",\n    \"10-1\": \"no\",\n    \"11-1\": \"no\",\n    \"6-2\": \"Integer\",\n    \"7-2\": \"Integer\",\n    \"8-2\": \"Integer\",\n    \"10-2\": \"30 characters\",\n    \"11-2\": \"30 characters\",\n    \"6-3\": \"-\",\n    \"7-3\": \"-\",\n    \"8-3\": \"-\",\n    \"10-3\": \"-\",\n    \"11-3\": \"-\",\n    \"6-4\": \"New / Update\",\n    \"7-4\": \"New / Update\",\n    \"8-4\": \"New / Update\",\n    \"10-4\": \"New / Update\",\n    \"11-4\": \"New / Update\",\n    \"6-5\": \"The agent id of the case owner.\",\n    \"7-5\": \"The priority id of the case.\",\n    \"8-5\": \"The issue id of the case.\",\n    \"10-5\": \"The asset id assigned to the case.\",\n    \"11-5\": \"The company id of the company assigned to the case.\",\n    \"12-5\": \"The contact id of the company assigned to the case.\",\n    \"12-4\": \"New / Update\",\n    \"12-3\": \"-\",\n    \"12-2\": \"30 characters\",\n    \"12-1\": \"no\",\n    \"12-0\": \"contact_id\",\n    \"13-0\": \"subject\",\n    \"13-1\": \"**yes**\",\n    \"13-2\": \"250 characters\",\n    \"13-3\": \"-\",\n    \"13-4\": \"New / Update\",\n    \"13-5\": \"The subject of the case.\",\n    \"14-0\": \"summary\",\n    \"14-1\": \"no\",\n    \"14-2\": \"2500 characters\",\n    \"14-3\": \"-\",\n    \"14-4\": \"New / Update\",\n    \"14-5\": \"The summary of the case.\",\n    \"15-0\": \"tags\",\n    \"15-1\": \"no\",\n    \"15-2\": \"100 characters per tag\",\n    \"15-3\": \"-\",\n    \"15-4\": \"New / Update\",\n    \"15-5\": \"A tag array assigned to the case. If updating, the tags defined here will overwrite any existing tags.\",\n    \"16-0\": \"fields\",\n    \"16-1\": \"no\",\n    \"16-2\": \"See field object\",\n    \"16-3\": \"-\",\n    \"16-4\": \"New / Update\",\n    \"16-5\": \"A field array of custom fields to insert or update.  Please see the field object below.\",\n    \"1-0\": \"id_source\",\n    \"1-1\": \"no\",\n    \"1-2\": \"25 characters\",\n    \"1-3\": \"-\",\n    \"1-4\": \"New\",\n    \"1-5\": \"The source id of the case.  You can assign custom ID's from existing systems or importing them into Supportbench.\",\n    \"5-0\": \"min_to_close\",\n    \"5-1\": \"no\",\n    \"5-2\": \"Integer\",\n    \"5-3\": \"-\",\n    \"5-4\": \"New / Update\",\n    \"5-5\": \"If the case status is set to closed (0), then this sets when to close the case from now. i.e. 1440 min or 1 day from now.  This allows cases not to have a re-opened statistic if closed accidentally.\",\n    \"9-0\": \"outcome_id\",\n    \"9-1\": \"no\",\n    \"9-2\": \"Integer\",\n    \"9-3\": \"-\",\n    \"9-4\": \"New / Update\",\n    \"9-5\": \"The case outcome id.  Used when closing the case.\"\n  },\n  \"cols\": 6,\n  \"rows\": 17\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Field Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"**yes**\",\n    \"0-2\": \"Integer\",\n    \"0-3\": \"-\",\n    \"0-4\": \"The field id of the field you wish to update.  The field id must map to a valid field in the case.\",\n    \"1-0\": \"value\",\n    \"1-1\": \"**yes**\",\n    \"1-2\": \"Dropdown list - Integer\\nCheckbox - Boolean\\nText box - Unlimited\",\n    \"1-3\": \"-\",\n    \"1-4\": \"The value of the custom field.  The value is dependent on the field type.\"\n  },\n  \"cols\": 5,\n  \"rows\": 2\n}\n[/block]","createdAt":"2015-11-26T23:39:22.714Z","updates":[],"version":"565416f4ac09cc2100feb2d8","parentDoc":null,"hidden":false,"next":{"description":"","pages":[]},"project":"565416f3ac09cc2100feb2d5","__v":13,"excerpt":"","childrenPages":[]}

postCreate / Update a Case


Creating and updating a case from the API can be done by posting your case object to Supportbench. The only difference between case creations and updates is including a case id within the case object. When creating or updating a case, the below fields are available to you. [block:parameters] { "data": { "h-1": "Required", "h-2": "Limit", "h-0": "Name", "0-0": "id_prefix", "0-1": "no", "0-2": "5 characters", "0-3": "\"C\"", "h-3": "Default", "3-0": "division_id", "3-1": "**yes**", "3-2": "Integer", "3-3": "-", "4-0": "status_id", "4-1": "no", "4-2": "Integer", "4-3": "1", "h-4": "Availability", "0-4": "New", "3-4": "New / Update", "4-4": "New / Update", "h-5": "Summary", "0-5": "The prefix of the case. You can assign new case prefix's within the API administration section.", "3-5": "The case category id.", "4-5": "The case status id.", "2-0": "id", "2-1": "no - when creating \nyes - when updating", "2-2": "30 characters", "2-3": "-", "2-4": "Update", "2-5": "The full case id including the prefix.", "6-0": "owner_id", "7-0": "priority_id", "8-0": "issue_id", "10-0": "asset_id", "11-0": "company_id", "6-1": "no", "7-1": "**yes**", "8-1": "no", "10-1": "no", "11-1": "no", "6-2": "Integer", "7-2": "Integer", "8-2": "Integer", "10-2": "30 characters", "11-2": "30 characters", "6-3": "-", "7-3": "-", "8-3": "-", "10-3": "-", "11-3": "-", "6-4": "New / Update", "7-4": "New / Update", "8-4": "New / Update", "10-4": "New / Update", "11-4": "New / Update", "6-5": "The agent id of the case owner.", "7-5": "The priority id of the case.", "8-5": "The issue id of the case.", "10-5": "The asset id assigned to the case.", "11-5": "The company id of the company assigned to the case.", "12-5": "The contact id of the company assigned to the case.", "12-4": "New / Update", "12-3": "-", "12-2": "30 characters", "12-1": "no", "12-0": "contact_id", "13-0": "subject", "13-1": "**yes**", "13-2": "250 characters", "13-3": "-", "13-4": "New / Update", "13-5": "The subject of the case.", "14-0": "summary", "14-1": "no", "14-2": "2500 characters", "14-3": "-", "14-4": "New / Update", "14-5": "The summary of the case.", "15-0": "tags", "15-1": "no", "15-2": "100 characters per tag", "15-3": "-", "15-4": "New / Update", "15-5": "A tag array assigned to the case. If updating, the tags defined here will overwrite any existing tags.", "16-0": "fields", "16-1": "no", "16-2": "See field object", "16-3": "-", "16-4": "New / Update", "16-5": "A field array of custom fields to insert or update. Please see the field object below.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the case. You can assign custom ID's from existing systems or importing them into Supportbench.", "5-0": "min_to_close", "5-1": "no", "5-2": "Integer", "5-3": "-", "5-4": "New / Update", "5-5": "If the case status is set to closed (0), then this sets when to close the case from now. i.e. 1440 min or 1 day from now. This allows cases not to have a re-opened statistic if closed accidentally.", "9-0": "outcome_id", "9-1": "no", "9-2": "Integer", "9-3": "-", "9-4": "New / Update", "9-5": "The case outcome id. Used when closing the case." }, "cols": 6, "rows": 17 } [/block] [block:api-header] { "type": "basic", "title": "Field Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the case.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Creating and updating a case from the API can be done by posting your case object to Supportbench. The only difference between case creations and updates is including a case id within the case object. When creating or updating a case, the below fields are available to you. [block:parameters] { "data": { "h-1": "Required", "h-2": "Limit", "h-0": "Name", "0-0": "id_prefix", "0-1": "no", "0-2": "5 characters", "0-3": "\"C\"", "h-3": "Default", "3-0": "division_id", "3-1": "**yes**", "3-2": "Integer", "3-3": "-", "4-0": "status_id", "4-1": "no", "4-2": "Integer", "4-3": "1", "h-4": "Availability", "0-4": "New", "3-4": "New / Update", "4-4": "New / Update", "h-5": "Summary", "0-5": "The prefix of the case. You can assign new case prefix's within the API administration section.", "3-5": "The case category id.", "4-5": "The case status id.", "2-0": "id", "2-1": "no - when creating \nyes - when updating", "2-2": "30 characters", "2-3": "-", "2-4": "Update", "2-5": "The full case id including the prefix.", "6-0": "owner_id", "7-0": "priority_id", "8-0": "issue_id", "10-0": "asset_id", "11-0": "company_id", "6-1": "no", "7-1": "**yes**", "8-1": "no", "10-1": "no", "11-1": "no", "6-2": "Integer", "7-2": "Integer", "8-2": "Integer", "10-2": "30 characters", "11-2": "30 characters", "6-3": "-", "7-3": "-", "8-3": "-", "10-3": "-", "11-3": "-", "6-4": "New / Update", "7-4": "New / Update", "8-4": "New / Update", "10-4": "New / Update", "11-4": "New / Update", "6-5": "The agent id of the case owner.", "7-5": "The priority id of the case.", "8-5": "The issue id of the case.", "10-5": "The asset id assigned to the case.", "11-5": "The company id of the company assigned to the case.", "12-5": "The contact id of the company assigned to the case.", "12-4": "New / Update", "12-3": "-", "12-2": "30 characters", "12-1": "no", "12-0": "contact_id", "13-0": "subject", "13-1": "**yes**", "13-2": "250 characters", "13-3": "-", "13-4": "New / Update", "13-5": "The subject of the case.", "14-0": "summary", "14-1": "no", "14-2": "2500 characters", "14-3": "-", "14-4": "New / Update", "14-5": "The summary of the case.", "15-0": "tags", "15-1": "no", "15-2": "100 characters per tag", "15-3": "-", "15-4": "New / Update", "15-5": "A tag array assigned to the case. If updating, the tags defined here will overwrite any existing tags.", "16-0": "fields", "16-1": "no", "16-2": "See field object", "16-3": "-", "16-4": "New / Update", "16-5": "A field array of custom fields to insert or update. Please see the field object below.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the case. You can assign custom ID's from existing systems or importing them into Supportbench.", "5-0": "min_to_close", "5-1": "no", "5-2": "Integer", "5-3": "-", "5-4": "New / Update", "5-5": "If the case status is set to closed (0), then this sets when to close the case from now. i.e. 1440 min or 1 day from now. This allows cases not to have a re-opened statistic if closed accidentally.", "9-0": "outcome_id", "9-1": "no", "9-2": "Integer", "9-3": "-", "9-4": "New / Update", "9-5": "The case outcome id. Used when closing the case." }, "cols": 6, "rows": 17 } [/block] [block:api-header] { "type": "basic", "title": "Field Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the case.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]
{"_id":"566261b1cd54d50d005015c8","excerpt":"","parentDoc":null,"sync_unique":"","type":"post","updates":[],"version":"565416f4ac09cc2100feb2d8","createdAt":"2015-12-05T04:01:53.206Z","body":"To update a case status, you must post the status arguments.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Arguments\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"**Yes**\",\n    \"1-0\": \"status_id\",\n    \"1-1\": \"**Yes**\",\n    \"0-2\": \"The case id to update.\",\n    \"1-2\": \"The status id to set the case to.  0 = closed, 1 = active, etc..\",\n    \"2-0\": \"min_to_close\",\n    \"2-1\": \"no\",\n    \"2-2\": \"The amount of minutes as an integer from now to close the case.  i.e. 120 = 2h from now.  The case status  **must **be set to 0 (closed).\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]","githubsync":"","link_url":"","project":"565416f3ac09cc2100feb2d5","title":"Update Status","user":"565416cace43aa21002b2566","link_external":false,"order":1,"hidden":false,"api":{"auth":"required","examples":{"codes":[{"name":"jQuery","language":"javascript","code":"var args = {\n    \"id\": \"C-1000\",\n    \"status_id\": \"2\",\n    \"min_to_close\": null //how many minutes before case is closed, status_id of 0 must be set\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/case/status',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(args),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        var response = jQuery.parseJSON(r);\n        alert(response.success); //returns true or false\n    }\n});"}]},"method":"post","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/case/status"},"category":"5656ac105656350d001d83a8","isReference":true,"slug":"update-status","__v":1,"childrenPages":[]}

postUpdate Status


To update a case status, you must post the status arguments. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Description", "0-0": "id", "0-1": "**Yes**", "1-0": "status_id", "1-1": "**Yes**", "0-2": "The case id to update.", "1-2": "The status id to set the case to. 0 = closed, 1 = active, etc..", "2-0": "min_to_close", "2-1": "no", "2-2": "The amount of minutes as an integer from now to close the case. i.e. 120 = 2h from now. The case status **must **be set to 0 (closed)." }, "cols": 3, "rows": 3 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



To update a case status, you must post the status arguments. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Description", "0-0": "id", "0-1": "**Yes**", "1-0": "status_id", "1-1": "**Yes**", "0-2": "The case id to update.", "1-2": "The status id to set the case to. 0 = closed, 1 = active, etc..", "2-0": "min_to_close", "2-1": "no", "2-2": "The amount of minutes as an integer from now to close the case. i.e. 120 = 2h from now. The case status **must **be set to 0 (closed)." }, "cols": 3, "rows": 3 } [/block]
{"_id":"566263c17ff90b0d00a6221c","category":"5656ac105656350d001d83a8","user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","createdAt":"2015-12-05T04:10:41.424Z","isReference":true,"link_external":false,"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","sync_unique":"","updates":[],"__v":4,"body":"To assign a case, you must post the assignment arguments.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Arguments\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"id\",\n    \"0-1\": \"**Yes**\",\n    \"1-0\": \"agent_id\",\n    \"1-1\": \"**Yes**\",\n    \"0-2\": \"The case id to update.\",\n    \"1-2\": \"The agent id to assign the case to.  This must be set if the queue id is not.\",\n    \"2-0\": \"queue_id\",\n    \"2-1\": \"**Yes**\",\n    \"2-2\": \"The queue id to assign the case to.  This must be set if the agent id is not.  \\n\\nIf both the agent and queue id's are set, the queue_id will be taken as the authoritative assignment location.\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]","excerpt":"","link_url":"","order":2,"type":"post","api":{"auth":"required","examples":{"codes":[{"name":"jQuery","code":"var args = {\n    \"id\": \"C-1000\",\n    \"agent_id\": null,\n    \"queue_id\": 1000\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/case/assign',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(args),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        var response = jQuery.parseJSON(r);\n        alert(response.success); //returns true or false\n    }\n});","language":"javascript"}]},"method":"post","params":[],"results":{"codes":[{"code":"{\"success\":true}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/case/assign"},"githubsync":"","hidden":false,"slug":"assign-to-agent-or-queue","title":"Assign to Agent or Queue","childrenPages":[]}

postAssign to Agent or Queue


To assign a case, you must post the assignment arguments. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Description", "0-0": "id", "0-1": "**Yes**", "1-0": "agent_id", "1-1": "**Yes**", "0-2": "The case id to update.", "1-2": "The agent id to assign the case to. This must be set if the queue id is not.", "2-0": "queue_id", "2-1": "**Yes**", "2-2": "The queue id to assign the case to. This must be set if the agent id is not. \n\nIf both the agent and queue id's are set, the queue_id will be taken as the authoritative assignment location." }, "cols": 3, "rows": 3 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



To assign a case, you must post the assignment arguments. [block:api-header] { "type": "basic", "title": "Arguments" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Description", "0-0": "id", "0-1": "**Yes**", "1-0": "agent_id", "1-1": "**Yes**", "0-2": "The case id to update.", "1-2": "The agent id to assign the case to. This must be set if the queue id is not.", "2-0": "queue_id", "2-1": "**Yes**", "2-2": "The queue id to assign the case to. This must be set if the agent id is not. \n\nIf both the agent and queue id's are set, the queue_id will be taken as the authoritative assignment location." }, "cols": 3, "rows": 3 } [/block]
{"_id":"5657862196d7ff0d009fc550","category":"5656ac105656350d001d83a8","createdAt":"2015-11-26T22:22:25.771Z","link_external":false,"slug":"properties","type":"get","api":{"settings":"","url":"/case/:id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var case_data = null;\nvar case_id = 'C-10691';\n\n$.ajax({\n    url: 'https://api.supportbench.net/case/' + case_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        case_data = r;\n        alert(case_data.id);\n    }\n});","language":"javascript"}]},"method":"get","params":[{"_id":"56578fe91edfb90d005c241f","default":"","desc":"The Case ID","name":"id","ref":"","required":false,"type":"string","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id_prefix\": \"C\",\n    \"id\": \"C-1000\",\n    \"division_id\": 1,\n    \"division\": \"Customer Service\",\n    \"status_id\": 1,\n    \"status\": \"Active\",\n    \"closed_on\": null,    \n    \"closed_unix\": null,\n    \"closed_ago\": null,\n    \"owner_id\": \"1\",\n    \"owner\": \"Joe Smith\",\n    \"queue_id\": null,\n    \"queue\": null,\n    \"sla_target\": \"Dec 31 2015  7:00AM\",    \n    \"sla_target_unix\": \"1455341587\",\n  \t\"sla_target_readable\":\"in 6.2 hour(s)\",\n    \"support_level\": \"Standard\",\n    \"priority_id\": \"5\",\n    \"priority\": \"Low\",\n    \"priority_color\":\"#FFF\",\n    \"issue_id\": \"1\",\n    \"issue\": \"Installation\",\n    \"outcome_id\": null,\n    \"outcome\": null,\n    \"asset_id\": \"A-1000\",\n    \"asset\": \"A Computer\",\n    \"company_id\": \"CP-1000\",\n    \"company\": \"Joes Plumbing\",\n    \"contact_id\": \"CT-1000\",\n    \"contact\": \"Jack Rogers\",\n    \"email\": \"jrogers@domain.com\",\n    \"subject\": \"OS installation\",\n    \"summary\": \"Computer rebuild required.\",\n    \"tags\": [\"computer\",\"rebuild\"],\n    \"sat_score\": null,\n    \"nps_score\": null,\n    \"csr_recieved\": null,\n    \"forum\": \"\",\n    \"forum_resolved\": \"False\",\n    \"fields\": [{\n      \t\t\t\"id\": \"2\",\n            \"name\": \"Was a rebuild\",\n            \"value\": \"Yes\",\n            \"value_id\": null,\n      \t\t\t\"type_id\":\"5\",      \t\t\t\n            \"type\":\"Checkbox\"\n        }, {\n          \t\"id\": \"3\",\n            \"name\": \"Operating System\",\n            \"value\": \"Windows 10\",\n            \"value_id\": 56,\n      \t\t\t\"type_id\":\"10\",      \t\t\t\n            \"type\":\"Dropdown list\"\n        }],\n    \"last_activity_id\":\"123456\",    \n    \"last_activity_type\":\"Incoming Email\",\n    \"last_activity_type_id\":\"1\",    \n    \"last_activity_type_icon\":\"https://na1.supportbench.net/images/email.png\",\n    \"modified\": \"Nov 24 2015  8:26AM\",    \n    \"modified_unix\": \"1455461587\",\n    \"modified_ago\": \"1.1 Day(s) ago\",\n    \"created\": \"Oct 25 2015  5:10PM\",\n    \"created_unix\": \"1455341587\",\n    \"created_ago\": \"5 Days(s) ago\",\n    \"activities\": [{\n        \"id\": \"1000\",\n        \"type_id\": \"5\",\n        \"type\": \"Phone Call\",        \n        \"type_icon\": \"https://na1.supportbench.net/images/phone.png\",\n        \"subject\": \"This is a test activity #1\",\n        \"contact_id\": \"CT-1000\",\n        \"contact\": \"Jack Rogers\",\n        \"email_from\": null,\n        \"email_to\": null,\n        \"email_cc\": null,\n        \"content\": \"\",\n        \"attachments\": [],\n      \t\"createdby_id\": \"1\",\n      \t\"createdby\": \"Joe Smith\",\n        \"created\": \"Oct 25 2015  5:10PM\",\n        \"created_unix\": \"1455341587\",\n        \"created_ago\": \"1.1 Days(s) ago\",\n        \"due\": \"Oct 2 2015  4:10PM\",\n        \"due_unix\": \"1674341587\",\n        \"due_ago\": \"5.3 Days(s) ago\",\n        \"completed\": null,\n        \"completed_unix\": null,\n        \"completed_ago\": null\n    }, {\n        \"id\": \"1001\",\n        \"type_id\": \"20\",\n        \"type\": \"Email - Outgoing\",       \n        \"subject\": \"This is a test activity\",\n        \"type_icon\": \"https://na1.supportbench.net/images/email2.png\",\n        \"contact_id\": \"CT-1000\",\n        \"contact\": \"Jack Rogers\",\n        \"email_from\": null,\n        \"email_to\": \"jrogers@domain.com\",\n        \"email_cc\": null,\n        \"content\": \"\",\n        \"attachments\": [{\n            \"id\" : 17624,\n            \"name\": \"thumbnail.png\",\n            \"size\": \"16786\",\n            \"url\": \"https://kustorage.blob.core.windows.net/acc1/case/C-1000/10001/thumbnail.png?sv=2015-04-05&sr=c&si=accountpolicy&sig=TxsdfTicDsjVpwrPoOx5NuOD1FtnfkKQVFf5enaocf4gjM%3D\"\n        }],\n        \"created\": \"Nov 24 2015  8:26AM\",\n        \"created_unix\": \"1455341587\",\n        \"created_ago\": \"1.8 Days(s) ago\",\n        \"due\": \"Oct 2 2015  4:10PM\",\n        \"due_unix\": \"1674341587\",\n        \"due_ago\": \"5.3 Days(s) ago\",\n        \"completed\": null,\n        \"completed_unix\": null,\n        \"completed_ago\": null\n    }]\n}","name":"Success"},{"name":"Failure","status":400,"language":"json","code":"{}"}]}},"editedParams":true,"editedParams2":true,"excerpt":"","hidden":false,"link_url":"","next":{"description":"","pages":[]},"__v":6,"updates":[],"version":"565416f4ac09cc2100feb2d8","sync_unique":"","order":3,"title":"Returning a Case","isReference":true,"githubsync":"","parentDoc":null,"project":"565416f3ac09cc2100feb2d5","user":"565416cace43aa21002b2566","body":"You can retrieve a case and all of its data.  All case fields, activities and their attachments are returned.","childrenPages":[]}

getReturning a Case


Path Params

id:
string
The Case ID
You can retrieve a case and all of its data. All case fields, activities and their attachments are returned.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



You can retrieve a case and all of its data. All case fields, activities and their attachments are returned.
{"_id":"56622ed72bd9ca0d00109a87","excerpt":"Return a list of cases based on a query.","githubsync":"","hidden":false,"sync_unique":"","version":"565416f4ac09cc2100feb2d8","body":"You can query the system for cases you require.  To return an array of case objects, you will need to post the query parameters to return. You can use any or all of the parameters to refine your search results.\n\nThe top 1000 results are returned order by the case creation date. \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Usage\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"cases\",\n    \"0-1\": \"\\\"C-1000,C-1001\\\"\",\n    \"0-2\": \"Return cases by their ID's.\",\n    \"1-0\": \"companies\",\n    \"1-1\": \"\\\"CP-1000,CP-1001\\\"\",\n    \"1-2\": \"Return cases by the company id's assigned.\",\n    \"2-0\": \"contacts\",\n    \"2-1\": \"\\\"CT-1000,CT-1001\\\"\",\n    \"2-2\": \"Return cases by the contact id's assigned.\",\n    \"3-0\": \"status_id\",\n    \"3-1\": \"-1 = Return all cases\\nnull = Return all open cases\\n0 = Return closed cases\\nelse = Return cases with state\",\n    \"3-2\": \"Return cases by their status.  If not entered or is null, only open cases are returned by default.\",\n    \"4-0\": \"created_from\",\n    \"5-0\": \"created_to\",\n    \"6-0\": \"owners\",\n    \"10-0\": \"tags\",\n    \"10-1\": \"\\\"tag1, tag2\\\"\",\n    \"10-2\": \"Return cases with the defined tags.\",\n    \"6-2\": \"Return cases with these case owners.\",\n    \"6-1\": \"\\\"1000,1001\\\"\",\n    \"4-1\": \"\\\"12/31/2014\\\"\",\n    \"5-1\": \"\\\"1/31/2015\\\"\",\n    \"4-2\": \"Return cases created from this date.\",\n    \"5-2\": \"Return cases created before this date.\",\n    \"7-0\": \"queues\",\n    \"7-1\": \"\\\"100,1005\\\"\",\n    \"7-2\": \"Return cases within the given queues.\",\n    \"8-0\": \"divisions\",\n    \"9-0\": \"issues\",\n    \"8-1\": \"\\\"2,10\\\"\",\n    \"9-1\": \"\\\"5,6,9\\\"\",\n    \"8-2\": \"Return cases within the given divisions.\",\n    \"9-2\": \"Return cases within the given case issues.\"\n  },\n  \"cols\": 3,\n  \"rows\": 11\n}\n[/block]","slug":"query-and-return-a-case-list","type":"get","createdAt":"2015-12-05T00:24:55.396Z","api":{"examples":{"codes":[{"name":"jQuery","language":"javascript","code":"var case_data = null;\nvar query_args = {\n    \"cases\": null,\n    \"companies\": \"CP-1000\",\n    \"contacts\": null,\n    \"status_id\": null, //-1 = all cases, null = open cases, else return that status\n    \"created_from\": null,\n    \"created_to\": null,\n    \"queues\": null,    \n    \"owners\": null,    \n    \"divisions\": null,\n    \"issues\": null,\n    \"tags\": null\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/cases',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(query_args),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        var case_data = jQuery.parseJSON(r);\n    }\n});"}]},"method":"get","params":[],"results":{"codes":[{"language":"json","code":"[\n  {  \n      \"id_prefix\":\"C\",\n      \"id\":\"C-1000\",\n      \"division_id\":1,\n      \"division\":\"Customer Service\",\n      \"status_id\":1,\n      \"status\":\"Active\",\n      \"closed_on\":null,\n      \"owner_id\":null,\n      \"owner\":null,\n      \"queue_id\":\"1\",\n      \"queue\":\"Email\",\n      \"sla_target\":\"2014-11-15T01:30:40.163\",\n      \"sla_target_readable\":\"Due 2 hour(s) ago\",\n      \"support_level\":\"Standard\",\n      \"priority_id\":\"1\",\n      \"priority\":\"Low\",\n      \"issue_id\":\"1\",\n      \"issue\":\"Installation\",\n      \"outcome_id\":null,\n      \"outcome\":null,\n      \"asset_id\":null,\n      \"asset\":\"\",\n      \"company_id\":\"CP-1000\",\n      \"company\":\"My Company\",\n      \"contact_id\":\"CT-1000\",\n      \"contact\":\"Joe Jones\",\n      \"email\":\"joe@domain.com\",\n      \"subject\":\"Case 1\",\n      \"summary\":null,\n      \"tags\":[  \n         \"tag1\",\n         \"tag2\",\n         \"incoming_email\"\n      ],\n      \"sat_score\":null,\n      \"nps_score\":null,\n      \"csr_recieved\":null,\n      \"forum\":\"\",\n      \"forum_resolved\":\"False\",\n      \"fields\":[],\n      \"modified\":\"2015-01-30T03:35:42.007\",\n      \"created\":\"2014-07-11T16:34:21.817\",\n      \"activities\":null //Will always will return null on case queries\n   },\n  {  \n      \"id_prefix\":\"C\",\n      \"id\":\"C-1001\",\n      \"division_id\":1,\n      \"division\":\"It Department\",\n      \"status_id\":1,\n      \"status\":\"Active\",\n      \"closed_on\":null,\n      \"owner_id\":null,\n      \"owner\":null,\n      \"queue_id\":\"1\",\n      \"queue\":\"Email\",\n      \"sla_target\":\"2014-12-15T01:30:40.163\",\n      \"support_level\":\"Standard\",      \n      \"sla_target_readable\":\"Due in 1hour(s)\",\n      \"priority_id\":\"1\",\n      \"priority\":\"Low\",\n      \"issue_id\":\"1\",\n      \"issue\":\"Installation\",\n      \"outcome_id\":null,\n      \"outcome\":null,\n      \"asset_id\":null,\n      \"asset\":\"\",\n      \"company_id\":\"CP-1000\",\n      \"company\":\"My Company\",\n      \"contact_id\":\"CT-1000\",\n      \"contact\":\"Joe Jones\",\n      \"email\":\"joe@domain.com\",\n      \"subject\":\"Case 2\",\n      \"summary\":null,\n      \"tags\":[  \n         \"incoming_email\"\n      ],\n      \"sat_score\":null,\n      \"nps_score\":null,\n      \"csr_recieved\":null,\n      \"forum\":\"\",\n      \"forum_resolved\":\"False\",\n      \"fields\":[],\n      \"modified\":\"2015-02-30T03:35:42.007\",\n      \"created\":\"2014-08-11T16:34:21.817\",\n      \"activities\":null //Will always will return null on case queries\n   }\n]","name":"","status":200},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/cases","auth":"required"},"category":"5656ac105656350d001d83a8","project":"565416f3ac09cc2100feb2d5","updates":[],"user":"565416cace43aa21002b2566","__v":8,"link_external":false,"link_url":"","next":{"description":"","pages":[]},"order":4,"parentDoc":null,"title":"Return Cases","isReference":true,"childrenPages":[]}

getReturn Cases

Return a list of cases based on a query.

You can query the system for cases you require. To return an array of case objects, you will need to post the query parameters to return. You can use any or all of the parameters to refine your search results. The top 1000 results are returned order by the case creation date. [block:parameters] { "data": { "h-0": "Name", "h-1": "Usage", "h-2": "Description", "0-0": "cases", "0-1": "\"C-1000,C-1001\"", "0-2": "Return cases by their ID's.", "1-0": "companies", "1-1": "\"CP-1000,CP-1001\"", "1-2": "Return cases by the company id's assigned.", "2-0": "contacts", "2-1": "\"CT-1000,CT-1001\"", "2-2": "Return cases by the contact id's assigned.", "3-0": "status_id", "3-1": "-1 = Return all cases\nnull = Return all open cases\n0 = Return closed cases\nelse = Return cases with state", "3-2": "Return cases by their status. If not entered or is null, only open cases are returned by default.", "4-0": "created_from", "5-0": "created_to", "6-0": "owners", "10-0": "tags", "10-1": "\"tag1, tag2\"", "10-2": "Return cases with the defined tags.", "6-2": "Return cases with these case owners.", "6-1": "\"1000,1001\"", "4-1": "\"12/31/2014\"", "5-1": "\"1/31/2015\"", "4-2": "Return cases created from this date.", "5-2": "Return cases created before this date.", "7-0": "queues", "7-1": "\"100,1005\"", "7-2": "Return cases within the given queues.", "8-0": "divisions", "9-0": "issues", "8-1": "\"2,10\"", "9-1": "\"5,6,9\"", "8-2": "Return cases within the given divisions.", "9-2": "Return cases within the given case issues." }, "cols": 3, "rows": 11 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



You can query the system for cases you require. To return an array of case objects, you will need to post the query parameters to return. You can use any or all of the parameters to refine your search results. The top 1000 results are returned order by the case creation date. [block:parameters] { "data": { "h-0": "Name", "h-1": "Usage", "h-2": "Description", "0-0": "cases", "0-1": "\"C-1000,C-1001\"", "0-2": "Return cases by their ID's.", "1-0": "companies", "1-1": "\"CP-1000,CP-1001\"", "1-2": "Return cases by the company id's assigned.", "2-0": "contacts", "2-1": "\"CT-1000,CT-1001\"", "2-2": "Return cases by the contact id's assigned.", "3-0": "status_id", "3-1": "-1 = Return all cases\nnull = Return all open cases\n0 = Return closed cases\nelse = Return cases with state", "3-2": "Return cases by their status. If not entered or is null, only open cases are returned by default.", "4-0": "created_from", "5-0": "created_to", "6-0": "owners", "10-0": "tags", "10-1": "\"tag1, tag2\"", "10-2": "Return cases with the defined tags.", "6-2": "Return cases with these case owners.", "6-1": "\"1000,1001\"", "4-1": "\"12/31/2014\"", "5-1": "\"1/31/2015\"", "4-2": "Return cases created from this date.", "5-2": "Return cases created before this date.", "7-0": "queues", "7-1": "\"100,1005\"", "7-2": "Return cases within the given queues.", "8-0": "divisions", "9-0": "issues", "8-1": "\"2,10\"", "9-1": "\"5,6,9\"", "8-2": "Return cases within the given divisions.", "9-2": "Return cases within the given case issues." }, "cols": 3, "rows": 11 } [/block]
{"_id":"56cd07c5d98d851d00c0c3b8","updates":[],"user":"565416cace43aa21002b2566","__v":3,"api":{"results":{"codes":[{"language":"json","code":"[{\n    \"id\": \"-1\",    \n    \"name\": \"Support\",    \n    \"parent_id\": \"0\"\n},{\n    \"id\": \"11\",    \n    \"name\": \"Customer Care\",    \n    \"parent_id\": \"10\"\n}]","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","url":"/divisions","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var list_data = null;\n\n$.ajax({\n    url: 'https://api.supportbench.net/divisions',\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript"}]},"method":"get","params":[]},"link_external":false,"version":"565416f4ac09cc2100feb2d8","isReference":true,"next":{"description":"","pages":[]},"sync_unique":"","hidden":false,"link_url":"","parentDoc":null,"project":"565416f3ac09cc2100feb2d5","title":"Return Categories","category":"5656ac105656350d001d83a8","excerpt":"","githubsync":"","type":"get","order":5,"slug":"return-categories","body":"Return a list of active case categories in the system.  The categories will return in order of the order within the system which it was given in a hierarchy. Each child element will have spaces to the left of the item making it easy to visually see the item. Each parent item will have an id of -1 making it unselectable.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The unique id of the case division.\",\n    \"1-1\": \"The full name of the case division.\",\n    \"1-0\": \"name\",\n    \"2-0\": \"parent_id\",\n    \"2-1\": \"The parent id of the division.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]","createdAt":"2016-02-24T01:30:45.641Z","childrenPages":[]}

getReturn Categories


Return a list of active case categories in the system. The categories will return in order of the order within the system which it was given in a hierarchy. Each child element will have spaces to the left of the item making it easy to visually see the item. Each parent item will have an id of -1 making it unselectable. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the case division.", "1-1": "The full name of the case division.", "1-0": "name", "2-0": "parent_id", "2-1": "The parent id of the division." }, "cols": 2, "rows": 3 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a list of active case categories in the system. The categories will return in order of the order within the system which it was given in a hierarchy. Each child element will have spaces to the left of the item making it easy to visually see the item. Each parent item will have an id of -1 making it unselectable. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the case division.", "1-1": "The full name of the case division.", "1-0": "name", "2-0": "parent_id", "2-1": "The parent id of the division." }, "cols": 2, "rows": 3 } [/block]
{"_id":"56c6a18675cd250d004338c1","version":"565416f4ac09cc2100feb2d8","category":"5656ac105656350d001d83a8","createdAt":"2016-02-19T05:00:54.585Z","link_external":false,"type":"get","project":"565416f3ac09cc2100feb2d5","slug":"queue-list-1","updates":[],"excerpt":"","githubsync":"","link_url":"","title":"Return Priorities","user":"565416cace43aa21002b2566","isReference":true,"order":6,"parentDoc":null,"sync_unique":"","__v":3,"api":{"url":"/priorities","auth":"required","examples":{"codes":[{"code":"var list_data = null;\n\n$.ajax({\n    url: 'https://api.supportbench.net/priorities',\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript","name":"jQuery"}]},"method":"get","params":[],"results":{"codes":[{"language":"json","status":200,"name":"","code":"[{\n    \"id\": \"10\",    \n    \"name\": \"Low\",\n  \t\"color\": \"\"\n},{\n    \"id\": \"11\",    \n    \"name\": \"High\",\n    \"color\":\"red\"\n}]"},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":""},"body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"2-0\": \"color\",\n    \"0-1\": \"The unique id of the priority.\",\n    \"2-1\": \"The assigned color of the priority.\",\n    \"1-1\": \"The full name of the priority.\",\n    \"1-0\": \"name\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]","hidden":false,"childrenPages":[]}

getReturn Priorities


Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "color", "0-1": "The unique id of the priority.", "2-1": "The assigned color of the priority.", "1-1": "The full name of the priority.", "1-0": "name" }, "cols": 2, "rows": 3 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "color", "0-1": "The unique id of the priority.", "2-1": "The assigned color of the priority.", "1-1": "The full name of the priority.", "1-0": "name" }, "cols": 2, "rows": 3 } [/block]
{"_id":"56cd0aafca43550b00281527","api":{"params":[{"required":false,"desc":"The category id to filter for","default":"","type":"string","name":"category_id","in":"path","_id":"56cd0aafca43550b00281528"}],"results":{"codes":[{"name":"","code":"[{\n    \"id\": \"-1\",    \n    \"name\": \"Installation\",    \n    \"parent_id\": \"0\"\n},{\n    \"id\": \"11\",    \n    \"name\": \"Windows\",    \n    \"parent_id\": \"10\"\n}]","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/issues/:category_id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var list_data = null;\nvar category_id = 0; //the category id to filter for\n\n$.ajax({\n    url: 'https://api.supportbench.net/issues/' + category_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript"}]},"method":"get"},"slug":"return-issues","sync_unique":"","type":"get","updates":[],"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","__v":0,"category":"5656ac105656350d001d83a8","editedParams":true,"githubsync":"","hidden":false,"link_url":"","order":7,"body":"Return a list of active case issues in the system.  The issues will return in order of the order within the system which it was given in a hierarchy. Each child element will have spaces to the left of the item making it easy to visually see the item. Each parent item will have an id of -1 making it unselectable.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The unique id of the case issue.\",\n    \"1-1\": \"The full name of the case issue.\",\n    \"1-0\": \"name\",\n    \"2-0\": \"parent_id\",\n    \"2-1\": \"The parent id of the issue.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]","createdAt":"2016-02-24T01:43:11.857Z","editedParams2":true,"excerpt":"","isReference":true,"link_external":false,"title":"Return Issues","user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

getReturn Issues


Path Params

category_id:
string
The category id to filter for
Return a list of active case issues in the system. The issues will return in order of the order within the system which it was given in a hierarchy. Each child element will have spaces to the left of the item making it easy to visually see the item. Each parent item will have an id of -1 making it unselectable. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the case issue.", "1-1": "The full name of the case issue.", "1-0": "name", "2-0": "parent_id", "2-1": "The parent id of the issue." }, "cols": 2, "rows": 3 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a list of active case issues in the system. The issues will return in order of the order within the system which it was given in a hierarchy. Each child element will have spaces to the left of the item making it easy to visually see the item. Each parent item will have an id of -1 making it unselectable. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the case issue.", "1-1": "The full name of the case issue.", "1-0": "name", "2-0": "parent_id", "2-1": "The parent id of the issue." }, "cols": 2, "rows": 3 } [/block]
{"_id":"583cf03e265b4219009a5099","sync_unique":"","__v":0,"createdAt":"2016-11-29T03:04:30.674Z","excerpt":"","hidden":false,"link_url":"","parentDoc":null,"type":"get","api":{"results":{"codes":[{"code":"[{\n    \"id\": \"1\",    \n    \"name\": \"No response\",    \n    \"parent_id\": \"0\"\n},{\n    \"id\": \"1\",    \n    \"name\": \"Resolved\",    \n    \"parent_id\": \"0\"\n}]","language":"json","status":200,"name":""},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/outcomes/:category_id","auth":"required","examples":{"codes":[{"language":"javascript","name":"jQuery","code":"var list_data = null;\nvar category_id = 0; //the category id to filter for\n\n$.ajax({\n    url: 'https://api.supportbench.net/outcomes/' + category_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});"}]},"method":"get","params":[{"desc":"The category id to filter for","default":"","type":"string","name":"category_id","_id":"56cd0aafca43550b00281528","ref":"","in":"path","required":false}]},"body":"Return a list of active case outcomes in the system.  The outcomes will return in order of the order within the system which it was given in a hierarchy. Each child element will have spaces to the left of the item making it easy to visually see the item. Each parent item will have an id of -1 making it unselectable.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The unique id of the case outcome.\",\n    \"1-1\": \"The full name of the case outcome.\",\n    \"1-0\": \"name\",\n    \"2-0\": \"parent_id\",\n    \"2-1\": \"The parent id of the outcome.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]","githubsync":"","link_external":false,"user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","next":{"pages":[],"description":""},"order":8,"project":"565416f3ac09cc2100feb2d5","updates":[],"category":"5656ac105656350d001d83a8","isReference":true,"slug":"return-outcomes","title":"Return Outcomes","childrenPages":[]}

getReturn Outcomes


Path Params

category_id:
string
The category id to filter for
Return a list of active case outcomes in the system. The outcomes will return in order of the order within the system which it was given in a hierarchy. Each child element will have spaces to the left of the item making it easy to visually see the item. Each parent item will have an id of -1 making it unselectable. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the case outcome.", "1-1": "The full name of the case outcome.", "1-0": "name", "2-0": "parent_id", "2-1": "The parent id of the outcome." }, "cols": 2, "rows": 3 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a list of active case outcomes in the system. The outcomes will return in order of the order within the system which it was given in a hierarchy. Each child element will have spaces to the left of the item making it easy to visually see the item. Each parent item will have an id of -1 making it unselectable. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the case outcome.", "1-1": "The full name of the case outcome.", "1-0": "name", "2-0": "parent_id", "2-1": "The parent id of the outcome." }, "cols": 2, "rows": 3 } [/block]
{"_id":"5820fc4ea6b35a1b00c76021","body":"Return the policy of the case division for opening a new case.","category":"5656ac105656350d001d83a8","order":9,"githubsync":"","link_external":false,"project":"565416f3ac09cc2100feb2d5","slug":"returning-on-open-policy","updates":[],"__v":0,"api":{"url":"/policy/case/open/:division_id","auth":"required","examples":{"codes":[{"language":"javascript","code":"var policy_data = null;\nvar division_id = '5';\n\n$.ajax({\n    url: 'https://api.supportbench.net/policy/case/open/' + division_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        policy_data = r;\n        alert(policy_data.id);\n    }\n});","name":"jQuery"}]},"method":"get","params":[{"name":"division_id","ref":"","required":false,"type":"string","_id":"56578fe91edfb90d005c241f","default":"","desc":"The case division id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id\": \"100\",\n    \"customer_required\": null,\n    \"summary_show\": true,\n    \"summary_required\": null,\n    \"tags_show\": 1,\n    \"tags_required\": null,\n    \"asset_show\": null,    \n    \"asset_required\": null,\n    \"priority_show\": true,\n    \"priority_required\": null,\n    \"issue_show\": false,\n    \"issue_required\": null,\n    \"fields\": [{\n      \t\t\t\"id\": \"2\",\n            \"name\": \"License Number\",\n            \"show\": true,\n      \t\t\t\"required\":null      \t\t\n        }, {\n      \t\t\t\"id\": \"3\",\n            \"name\": \"RMA\",\n            \"show\": true,\n      \t\t\t\"required\":null \n        }]\n}","name":"Success"},{"status":400,"language":"json","code":"{}","name":"Failure"}]},"settings":""},"createdAt":"2016-11-07T22:12:30.493Z","excerpt":"","isReference":true,"link_url":"","type":"get","user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","hidden":false,"next":{"pages":[],"description":""},"parentDoc":null,"sync_unique":"","title":"Returning On Open Policy","childrenPages":[]}

getReturning On Open Policy


Path Params

division_id:
string
The case division id
Return the policy of the case division for opening a new case.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return the policy of the case division for opening a new case.
{"_id":"56d92c85dd90610b002707d5","githubsync":"","updates":[],"version":"565416f4ac09cc2100feb2d8","body":"Return the policy of the case division.","editedParams":true,"link_external":false,"next":{"description":"","pages":[]},"project":"565416f3ac09cc2100feb2d5","slug":"returning-view-policy","title":"Returning View Policy","category":"5656ac105656350d001d83a8","hidden":false,"isReference":true,"sync_unique":"","__v":1,"createdAt":"2016-03-04T06:34:45.524Z","link_url":"","order":10,"parentDoc":null,"type":"get","user":"565416cace43aa21002b2566","api":{"url":"/policy/case/view/:division_id","auth":"required","examples":{"codes":[{"language":"javascript","code":"var policy_data = null;\nvar division_id = '5';\n\n$.ajax({\n    url: 'https://api.supportbench.net/policy/case/view/' + division_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        policy_data = r;\n        alert(policy_data.id);\n    }\n});","name":"jQuery"}]},"method":"get","params":[{"required":false,"type":"string","_id":"56578fe91edfb90d005c241f","default":"","desc":"The case division id","in":"path","name":"division_id","ref":""}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id\": \"100\",\n    \"customer_required\": null,\n    \"summary_show\": true,\n    \"summary_required\": null,\n    \"tags_show\": 1,\n    \"tags_required\": null,\n    \"asset_show\": null,    \n    \"asset_required\": null,\n    \"priority_show\": true,\n    \"priority_required\": null,\n    \"issue_show\": false,\n    \"issue_required\": null,\n    \"fields\": [{\n      \t\t\t\"id\": \"2\",\n            \"name\": \"License Number\",\n            \"show\": true,\n      \t\t\t\"required\":null      \t\t\n        }, {\n      \t\t\t\"id\": \"3\",\n            \"name\": \"RMA\",\n            \"show\": true,\n      \t\t\t\"required\":null \n        }]\n}","name":"Success"},{"language":"json","code":"{}","name":"Failure","status":400}]},"settings":""},"editedParams2":true,"excerpt":"","childrenPages":[]}

getReturning View Policy


Path Params

division_id:
string
The case division id
Return the policy of the case division.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return the policy of the case division.
{"_id":"583ce80272a5e90f0048748b","api":{"url":"/policy/case/close/:division_id","auth":"required","examples":{"codes":[{"language":"javascript","code":"var policy_data = null;\nvar division_id = '5';\n\n$.ajax({\n    url: 'https://api.supportbench.net/policy/case/close/' + division_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        policy_data = r;\n        alert(policy_data.id);\n    }\n});","name":"jQuery"}]},"method":"get","params":[{"name":"division_id","ref":"","required":false,"type":"string","_id":"56578fe91edfb90d005c241f","default":"","desc":"The case division id","in":"path"}],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id\": \"100\",\n    \"customer_required\": null,\n    \"summary_show\": true,\n    \"summary_required\": null,\n    \"tags_show\": 1,\n    \"tags_required\": null,\n    \"asset_show\": null,    \n    \"asset_required\": null,\n    \"priority_show\": true,\n    \"priority_required\": null,\n    \"issue_show\": false,\n    \"issue_required\": null,\n    \"fields\": [{\n      \t\t\t\"id\": \"2\",\n            \"name\": \"License Number\",\n            \"show\": true,\n      \t\t\t\"required\":null      \t\t\n        }, {\n      \t\t\t\"id\": \"3\",\n            \"name\": \"RMA\",\n            \"show\": true,\n      \t\t\t\"required\":null \n        }]\n}","name":"Success"},{"status":400,"language":"json","code":"{}","name":"Failure"}]},"settings":""},"createdAt":"2016-11-29T02:29:22.513Z","updates":[],"user":"565416cace43aa21002b2566","body":"Return the policy of the case division for opening a new case.","hidden":false,"isReference":true,"__v":0,"githubsync":"","link_external":false,"next":{"pages":[],"description":""},"parentDoc":null,"sync_unique":"","version":"565416f4ac09cc2100feb2d8","title":"Returning On Close Policy","category":"5656ac105656350d001d83a8","excerpt":"","link_url":"","order":11,"project":"565416f3ac09cc2100feb2d5","slug":"returning-on-close-policy","type":"get","childrenPages":[]}

getReturning On Close Policy


Path Params

division_id:
string
The case division id
Return the policy of the case division for opening a new case.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return the policy of the case division for opening a new case.
{"_id":"565747a11edfb90d005c2400","slug":"view-a-case","user":"565416cace43aa21002b2566","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","url":""},"category":"5656ac105656350d001d83a8","next":{"pages":[],"description":""},"type":"basic","isReference":true,"link_external":false,"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","body":"The case object is what is returned when retrieving a case or querying cases.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-2\": \"Summary\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id_prefix\",\n    \"0-1\": \"The prefix of the id.\",\n    \"1-0\": \"id\",\n    \"1-1\": \"The case id with the prefix.\",\n    \"2-0\": \"division_id\",\n    \"2-1\": \"The case division id.\",\n    \"3-0\": \"division\",\n    \"3-1\": \"The display name of the division.\",\n    \"4-0\": \"status_id\",\n    \"5-0\": \"status\",\n    \"4-1\": \"The case status id. Any id other than 0 is open.\",\n    \"5-1\": \"The display name of the state.\",\n    \"6-0\": \"closed_on\",\n    \"9-0\": \"owner_id\",\n    \"10-0\": \"owner\",\n    \"6-1\": \"The date the case was closed.\",\n    \"9-1\": \"The agent owner id.\",\n    \"10-1\": \"The full name of the agent owner.\",\n    \"11-0\": \"queue_id\",\n    \"12-0\": \"queue\",\n    \"13-0\": \"sla_target\",\n    \"16-0\": \"support_level\",\n    \"17-0\": \"priority_id\",\n    \"18-0\": \"priority\",\n    \"20-0\": \"issue_id\",\n    \"21-0\": \"issue\",\n    \"11-1\": \"The queue id the case is in.\",\n    \"12-1\": \"The display name of the queue the case is in.\",\n    \"13-1\": \"The next SLA target of the case before an SLA violation.\",\n    \"16-1\": \"The display name of the case support level.\",\n    \"17-1\": \"The priority id.\",\n    \"18-1\": \"The display name of the priority.\",\n    \"20-1\": \"The issue id.\",\n    \"21-1\": \"The display name of the issue.\",\n    \"22-0\": \"outcome_id\",\n    \"23-0\": \"outcome\",\n    \"24-0\": \"asset_id\",\n    \"25-0\": \"asset\",\n    \"26-0\": \"company_id\",\n    \"27-0\": \"company\",\n    \"28-0\": \"contact_id\",\n    \"29-0\": \"contact\",\n    \"22-1\": \"The outcome id.\",\n    \"23-1\": \"The display name of the outcome id.\",\n    \"24-1\": \"The assigned asset id.\",\n    \"25-1\": \"The display name of the assigned asset.\",\n    \"26-1\": \"The company id.\",\n    \"27-1\": \"The name of the assigned company.\",\n    \"28-1\": \"The contact id.\",\n    \"29-1\": \"The full name of the assigned contact.\",\n    \"30-0\": \"email\",\n    \"31-0\": \"subject\",\n    \"32-0\": \"summary\",\n    \"33-0\": \"tags\",\n    \"30-1\": \"The assigned contact's email address.\",\n    \"31-1\": \"The case subject.\",\n    \"32-1\": \"The case summary.\",\n    \"33-1\": \"An array of tags associated to the case.\",\n    \"34-0\": \"sat_score\",\n    \"35-0\": \"nps_score\",\n    \"36-0\": \"csr_recieved\",\n    \"37-0\": \"forum\",\n    \"38-0\": \"forum_resolved\",\n    \"39-0\": \"fields\",\n    \"44-0\": \"modified\",\n    \"47-0\": \"created\",\n    \"34-1\": \"The customer satisfaction score.  \\n1 = Satisfied\\n2 = Not satisfied\",\n    \"35-1\": \"The NPS score from 1-10.\",\n    \"36-1\": \"The date the survey was received.\",\n    \"37-1\": \"The display name of the forum.\",\n    \"38-1\": \"Resolved within the forum.\",\n    \"44-1\": \"The last date the case was modified in UTC.\",\n    \"47-1\": \"The date the case was created in UTC.\",\n    \"39-1\": \"An object array of key value pairs for custom fields related to this case if they exist.\\nname = The field name.\\nvalue = The value of the field.\",\n    \"50-0\": \"activities\",\n    \"50-1\": \"The activities attached to the case.  See the activity view object below.\",\n    \"7-0\": \"closed_unix\",\n    \"8-0\": \"closed_ago\",\n    \"7-1\": \"The date the case was closed in a UNIX time stamp.\",\n    \"8-1\": \"The date the case was closed in readable text.\",\n    \"15-0\": \"sla_target_readable\",\n    \"15-1\": \"The next SLA target of the case before an SLA violation in readable text.\",\n    \"19-0\": \"priority_color\",\n    \"19-1\": \"The color of the priority.\",\n    \"40-0\": \"last_activity_id\",\n    \"41-0\": \"last_activity_type\",\n    \"42-0\": \"last_activity_type_id\",\n    \"43-0\": \"last_activity_type_icon\",\n    \"40-1\": \"The last activity id related to this case.\",\n    \"41-1\": \"The last activity type name related to this case.\",\n    \"42-1\": \"The last activity type id related to this case.\",\n    \"43-1\": \"The last activity type full URL of the icon related to this case.\",\n    \"45-0\": \"modified_unix\",\n    \"46-0\": \"modified_ago\",\n    \"48-0\": \"created_unix\",\n    \"49-0\": \"created_ago\",\n    \"45-1\": \"The last date the case was modified in UTC in a UNIX time stamp.\",\n    \"46-1\": \"The last date the case was modified in readable text.\",\n    \"48-1\": \"The date the case was created in UTC in a UNIX time stamp.\",\n    \"49-1\": \"The date the case was created in readable text.\",\n    \"14-0\": \"sla_target_unix\",\n    \"14-1\": \"The next SLA target of the case before an SLA violation in a UNIX time stamp.\"\n  },\n  \"cols\": 2,\n  \"rows\": 51\n}\n[/block]","excerpt":"","githubsync":"","hidden":false,"title":"Case Object","sync_unique":"","updates":[],"version":"565416f4ac09cc2100feb2d8","__v":16,"createdAt":"2015-11-26T17:55:45.524Z","link_url":"","order":12,"childrenPages":[]}

Case Object


The case object is what is returned when retrieving a case or querying cases. [block:parameters] { "data": { "h-0": "Name", "h-2": "Summary", "h-1": "Summary", "0-0": "id_prefix", "0-1": "The prefix of the id.", "1-0": "id", "1-1": "The case id with the prefix.", "2-0": "division_id", "2-1": "The case division id.", "3-0": "division", "3-1": "The display name of the division.", "4-0": "status_id", "5-0": "status", "4-1": "The case status id. Any id other than 0 is open.", "5-1": "The display name of the state.", "6-0": "closed_on", "9-0": "owner_id", "10-0": "owner", "6-1": "The date the case was closed.", "9-1": "The agent owner id.", "10-1": "The full name of the agent owner.", "11-0": "queue_id", "12-0": "queue", "13-0": "sla_target", "16-0": "support_level", "17-0": "priority_id", "18-0": "priority", "20-0": "issue_id", "21-0": "issue", "11-1": "The queue id the case is in.", "12-1": "The display name of the queue the case is in.", "13-1": "The next SLA target of the case before an SLA violation.", "16-1": "The display name of the case support level.", "17-1": "The priority id.", "18-1": "The display name of the priority.", "20-1": "The issue id.", "21-1": "The display name of the issue.", "22-0": "outcome_id", "23-0": "outcome", "24-0": "asset_id", "25-0": "asset", "26-0": "company_id", "27-0": "company", "28-0": "contact_id", "29-0": "contact", "22-1": "The outcome id.", "23-1": "The display name of the outcome id.", "24-1": "The assigned asset id.", "25-1": "The display name of the assigned asset.", "26-1": "The company id.", "27-1": "The name of the assigned company.", "28-1": "The contact id.", "29-1": "The full name of the assigned contact.", "30-0": "email", "31-0": "subject", "32-0": "summary", "33-0": "tags", "30-1": "The assigned contact's email address.", "31-1": "The case subject.", "32-1": "The case summary.", "33-1": "An array of tags associated to the case.", "34-0": "sat_score", "35-0": "nps_score", "36-0": "csr_recieved", "37-0": "forum", "38-0": "forum_resolved", "39-0": "fields", "44-0": "modified", "47-0": "created", "34-1": "The customer satisfaction score. \n1 = Satisfied\n2 = Not satisfied", "35-1": "The NPS score from 1-10.", "36-1": "The date the survey was received.", "37-1": "The display name of the forum.", "38-1": "Resolved within the forum.", "44-1": "The last date the case was modified in UTC.", "47-1": "The date the case was created in UTC.", "39-1": "An object array of key value pairs for custom fields related to this case if they exist.\nname = The field name.\nvalue = The value of the field.", "50-0": "activities", "50-1": "The activities attached to the case. See the activity view object below.", "7-0": "closed_unix", "8-0": "closed_ago", "7-1": "The date the case was closed in a UNIX time stamp.", "8-1": "The date the case was closed in readable text.", "15-0": "sla_target_readable", "15-1": "The next SLA target of the case before an SLA violation in readable text.", "19-0": "priority_color", "19-1": "The color of the priority.", "40-0": "last_activity_id", "41-0": "last_activity_type", "42-0": "last_activity_type_id", "43-0": "last_activity_type_icon", "40-1": "The last activity id related to this case.", "41-1": "The last activity type name related to this case.", "42-1": "The last activity type id related to this case.", "43-1": "The last activity type full URL of the icon related to this case.", "45-0": "modified_unix", "46-0": "modified_ago", "48-0": "created_unix", "49-0": "created_ago", "45-1": "The last date the case was modified in UTC in a UNIX time stamp.", "46-1": "The last date the case was modified in readable text.", "48-1": "The date the case was created in UTC in a UNIX time stamp.", "49-1": "The date the case was created in readable text.", "14-0": "sla_target_unix", "14-1": "The next SLA target of the case before an SLA violation in a UNIX time stamp." }, "cols": 2, "rows": 51 } [/block]
The case object is what is returned when retrieving a case or querying cases. [block:parameters] { "data": { "h-0": "Name", "h-2": "Summary", "h-1": "Summary", "0-0": "id_prefix", "0-1": "The prefix of the id.", "1-0": "id", "1-1": "The case id with the prefix.", "2-0": "division_id", "2-1": "The case division id.", "3-0": "division", "3-1": "The display name of the division.", "4-0": "status_id", "5-0": "status", "4-1": "The case status id. Any id other than 0 is open.", "5-1": "The display name of the state.", "6-0": "closed_on", "9-0": "owner_id", "10-0": "owner", "6-1": "The date the case was closed.", "9-1": "The agent owner id.", "10-1": "The full name of the agent owner.", "11-0": "queue_id", "12-0": "queue", "13-0": "sla_target", "16-0": "support_level", "17-0": "priority_id", "18-0": "priority", "20-0": "issue_id", "21-0": "issue", "11-1": "The queue id the case is in.", "12-1": "The display name of the queue the case is in.", "13-1": "The next SLA target of the case before an SLA violation.", "16-1": "The display name of the case support level.", "17-1": "The priority id.", "18-1": "The display name of the priority.", "20-1": "The issue id.", "21-1": "The display name of the issue.", "22-0": "outcome_id", "23-0": "outcome", "24-0": "asset_id", "25-0": "asset", "26-0": "company_id", "27-0": "company", "28-0": "contact_id", "29-0": "contact", "22-1": "The outcome id.", "23-1": "The display name of the outcome id.", "24-1": "The assigned asset id.", "25-1": "The display name of the assigned asset.", "26-1": "The company id.", "27-1": "The name of the assigned company.", "28-1": "The contact id.", "29-1": "The full name of the assigned contact.", "30-0": "email", "31-0": "subject", "32-0": "summary", "33-0": "tags", "30-1": "The assigned contact's email address.", "31-1": "The case subject.", "32-1": "The case summary.", "33-1": "An array of tags associated to the case.", "34-0": "sat_score", "35-0": "nps_score", "36-0": "csr_recieved", "37-0": "forum", "38-0": "forum_resolved", "39-0": "fields", "44-0": "modified", "47-0": "created", "34-1": "The customer satisfaction score. \n1 = Satisfied\n2 = Not satisfied", "35-1": "The NPS score from 1-10.", "36-1": "The date the survey was received.", "37-1": "The display name of the forum.", "38-1": "Resolved within the forum.", "44-1": "The last date the case was modified in UTC.", "47-1": "The date the case was created in UTC.", "39-1": "An object array of key value pairs for custom fields related to this case if they exist.\nname = The field name.\nvalue = The value of the field.", "50-0": "activities", "50-1": "The activities attached to the case. See the activity view object below.", "7-0": "closed_unix", "8-0": "closed_ago", "7-1": "The date the case was closed in a UNIX time stamp.", "8-1": "The date the case was closed in readable text.", "15-0": "sla_target_readable", "15-1": "The next SLA target of the case before an SLA violation in readable text.", "19-0": "priority_color", "19-1": "The color of the priority.", "40-0": "last_activity_id", "41-0": "last_activity_type", "42-0": "last_activity_type_id", "43-0": "last_activity_type_icon", "40-1": "The last activity id related to this case.", "41-1": "The last activity type name related to this case.", "42-1": "The last activity type id related to this case.", "43-1": "The last activity type full URL of the icon related to this case.", "45-0": "modified_unix", "46-0": "modified_ago", "48-0": "created_unix", "49-0": "created_ago", "45-1": "The last date the case was modified in UTC in a UNIX time stamp.", "46-1": "The last date the case was modified in readable text.", "48-1": "The date the case was created in UTC in a UNIX time stamp.", "49-1": "The date the case was created in readable text.", "14-0": "sla_target_unix", "14-1": "The next SLA target of the case before an SLA violation in a UNIX time stamp." }, "cols": 2, "rows": 51 } [/block]
{"_id":"56578e025cb2420d00d700f3","__v":3,"category":"5656ac105656350d001d83a8","link_external":false,"slug":"activity-object","createdAt":"2015-11-26T22:56:02.382Z","hidden":false,"isReference":true,"project":"565416f3ac09cc2100feb2d5","order":13,"parentDoc":null,"sync_unique":"","user":"565416cace43aa21002b2566","title":"Activity Object","type":"basic","updates":[],"api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"The activity object is what is returned within the activities property when retrieving a case.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id\",\n    \"1-0\": \"type_id\",\n    \"2-0\": \"type\",\n    \"4-0\": \"contact_id\",\n    \"5-0\": \"contact\",\n    \"6-0\": \"email_from\",\n    \"7-0\": \"email_to\",\n    \"8-0\": \"email_cc\",\n    \"9-0\": \"content\",\n    \"10-0\": \"attachments\",\n    \"11-0\": \"createdby_id\",\n    \"0-1\": \"The activity id.\",\n    \"1-1\": \"The type id.\",\n    \"2-1\": \"The display name of the activity type.\",\n    \"4-1\": \"The contact id of the user who created it.\",\n    \"13-0\": \"created\",\n    \"12-0\": \"createdby\",\n    \"5-1\": \"The contact name of the user who created the activity.\",\n    \"6-1\": \"If an incoming email, the from email address of that email.\",\n    \"7-1\": \"If an incoming or outgoing email, the to email addresses of that email.\",\n    \"8-1\": \"If an incoming or outgoing email, the cc email addresses of that email.\",\n    \"9-1\": \"The raw activity content in HTML.\",\n    \"10-1\": \"An array of attachments related to the activity.  Please see the attachment object for details below.\",\n    \"11-1\": \"The agent id who created the activity if internally created.\",\n    \"12-1\": \"The agents full name who created the activity if internally created.\",\n    \"13-1\": \"The date the activity was created.\",\n    \"3-0\": \"type_icon\",\n    \"3-1\": \"The icon URL of the activity type.\",\n    \"14-0\": \"created_unix\",\n    \"15-0\": \"created_ago\",\n    \"14-1\": \"The date the activity was created as a UNIX time stamp.\",\n    \"15-1\": \"The date the activity was created as a friendly name.\"\n  },\n  \"cols\": 2,\n  \"rows\": 16\n}\n[/block]","excerpt":"","githubsync":"","link_url":"","version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

Activity Object


The activity object is what is returned within the activities property when retrieving a case. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "1-0": "type_id", "2-0": "type", "4-0": "contact_id", "5-0": "contact", "6-0": "email_from", "7-0": "email_to", "8-0": "email_cc", "9-0": "content", "10-0": "attachments", "11-0": "createdby_id", "0-1": "The activity id.", "1-1": "The type id.", "2-1": "The display name of the activity type.", "4-1": "The contact id of the user who created it.", "13-0": "created", "12-0": "createdby", "5-1": "The contact name of the user who created the activity.", "6-1": "If an incoming email, the from email address of that email.", "7-1": "If an incoming or outgoing email, the to email addresses of that email.", "8-1": "If an incoming or outgoing email, the cc email addresses of that email.", "9-1": "The raw activity content in HTML.", "10-1": "An array of attachments related to the activity. Please see the attachment object for details below.", "11-1": "The agent id who created the activity if internally created.", "12-1": "The agents full name who created the activity if internally created.", "13-1": "The date the activity was created.", "3-0": "type_icon", "3-1": "The icon URL of the activity type.", "14-0": "created_unix", "15-0": "created_ago", "14-1": "The date the activity was created as a UNIX time stamp.", "15-1": "The date the activity was created as a friendly name." }, "cols": 2, "rows": 16 } [/block]
The activity object is what is returned within the activities property when retrieving a case. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "1-0": "type_id", "2-0": "type", "4-0": "contact_id", "5-0": "contact", "6-0": "email_from", "7-0": "email_to", "8-0": "email_cc", "9-0": "content", "10-0": "attachments", "11-0": "createdby_id", "0-1": "The activity id.", "1-1": "The type id.", "2-1": "The display name of the activity type.", "4-1": "The contact id of the user who created it.", "13-0": "created", "12-0": "createdby", "5-1": "The contact name of the user who created the activity.", "6-1": "If an incoming email, the from email address of that email.", "7-1": "If an incoming or outgoing email, the to email addresses of that email.", "8-1": "If an incoming or outgoing email, the cc email addresses of that email.", "9-1": "The raw activity content in HTML.", "10-1": "An array of attachments related to the activity. Please see the attachment object for details below.", "11-1": "The agent id who created the activity if internally created.", "12-1": "The agents full name who created the activity if internally created.", "13-1": "The date the activity was created.", "3-0": "type_icon", "3-1": "The icon URL of the activity type.", "14-0": "created_unix", "15-0": "created_ago", "14-1": "The date the activity was created as a UNIX time stamp.", "15-1": "The date the activity was created as a friendly name." }, "cols": 2, "rows": 16 } [/block]
{"_id":"5657918596d7ff0d009fc556","__v":2,"api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"The attachment object is what is returned within the activity attachments property when retrieving a case.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"1-0\": \"name\",\n    \"1-1\": \"The name of the file.\",\n    \"2-0\": \"size\",\n    \"2-1\": \"The size of the file in bytes.\",\n    \"3-0\": \"url\",\n    \"3-1\": \"The download URL of the file.  This includes an expiring security signature in the URL.\",\n    \"0-0\": \"id\",\n    \"0-1\": \"The unique attachment id\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","order":14,"updates":[],"category":"5656ac105656350d001d83a8","parentDoc":null,"version":"565416f4ac09cc2100feb2d8","githubsync":"","link_external":false,"link_url":"","next":{"description":"","pages":[]},"slug":"attachment-object","sync_unique":"","title":"Attachment Object","user":"565416cace43aa21002b2566","createdAt":"2015-11-26T23:11:01.705Z","excerpt":"","hidden":false,"isReference":true,"project":"565416f3ac09cc2100feb2d5","type":"basic","childrenPages":[]}

Attachment Object


The attachment object is what is returned within the activity attachments property when retrieving a case. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "1-0": "name", "1-1": "The name of the file.", "2-0": "size", "2-1": "The size of the file in bytes.", "3-0": "url", "3-1": "The download URL of the file. This includes an expiring security signature in the URL.", "0-0": "id", "0-1": "The unique attachment id" }, "cols": 2, "rows": 4 } [/block]
The attachment object is what is returned within the activity attachments property when retrieving a case. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "1-0": "name", "1-1": "The name of the file.", "2-0": "size", "2-1": "The size of the file in bytes.", "3-0": "url", "3-1": "The download URL of the file. This includes an expiring security signature in the URL.", "0-0": "id", "0-1": "The unique attachment id" }, "cols": 2, "rows": 4 } [/block]
{"_id":"56595b6f314e600d00292c6e","parentDoc":null,"slug":"fields-object-2","updates":[],"category":"5656ac105656350d001d83a8","createdAt":"2015-11-28T07:44:47.799Z","isReference":true,"link_external":false,"next":{"description":"","pages":[]},"title":"Field Object","version":"565416f4ac09cc2100feb2d8","excerpt":"","githubsync":"","hidden":false,"link_url":"","__v":4,"order":15,"project":"565416f3ac09cc2100feb2d5","type":"basic","user":"565416cace43aa21002b2566","api":{"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"","auth":"required"},"body":"The custom fields object returned within the fields property from the case object.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"The id of the custom field.\",\n    \"2-0\": \"value\",\n    \"2-1\": \"The value of the field. This could be a Boolean, name of a field item, or content depending on the field type.\",\n    \"1-0\": \"name\",\n    \"1-1\": \"The field display name.\",\n    \"4-0\": \"type_id\",\n    \"4-1\": \"The type id of the field.  Each type will have a unique id assigned.\",\n    \"5-0\": \"type\",\n    \"5-1\": \"The type name of the field. i.e. dropdown, checkbox, textbox, etc ..\",\n    \"3-0\": \"value_id\",\n    \"3-1\": \"If this was a list item, will return the id of that field list item.\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]","sync_unique":"","childrenPages":[]}

Field Object


The custom fields object returned within the fields property from the case object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The id of the custom field.", "2-0": "value", "2-1": "The value of the field. This could be a Boolean, name of a field item, or content depending on the field type.", "1-0": "name", "1-1": "The field display name.", "4-0": "type_id", "4-1": "The type id of the field. Each type will have a unique id assigned.", "5-0": "type", "5-1": "The type name of the field. i.e. dropdown, checkbox, textbox, etc ..", "3-0": "value_id", "3-1": "If this was a list item, will return the id of that field list item." }, "cols": 2, "rows": 6 } [/block]
The custom fields object returned within the fields property from the case object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The id of the custom field.", "2-0": "value", "2-1": "The value of the field. This could be a Boolean, name of a field item, or content depending on the field type.", "1-0": "name", "1-1": "The field display name.", "4-0": "type_id", "4-1": "The type id of the field. Each type will have a unique id assigned.", "5-0": "type", "5-1": "The type name of the field. i.e. dropdown, checkbox, textbox, etc ..", "3-0": "value_id", "3-1": "If this was a list item, will return the id of that field list item." }, "cols": 2, "rows": 6 } [/block]
{"_id":"56d92ed8dd90610b002707f6","link_url":"","version":"565416f4ac09cc2100feb2d8","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"","auth":"required","params":[]},"createdAt":"2016-03-04T06:44:40.120Z","order":16,"__v":2,"category":"5656ac105656350d001d83a8","isReference":true,"slug":"case-policy-object","sync_unique":"","user":"565416cace43aa21002b2566","excerpt":"","link_external":false,"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","title":"Policy Object","type":"basic","updates":[],"body":"The case policy object is used by case policies to control the behavior of a case view or action.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id\",\n    \"1-0\": \"customer_required\",\n    \"2-0\": \"summary_show\",\n    \"3-0\": \"summary_required\",\n    \"4-0\": \"tags_show\",\n    \"5-0\": \"tags_required\",\n    \"6-0\": \"asset_show\",\n    \"7-0\": \"asset_required\",\n    \"8-0\": \"priority_show\",\n    \"9-0\": \"priority_required\",\n    \"10-0\": \"issue_show\",\n    \"11-0\": \"issue_required\",\n    \"12-0\": \"fields\",\n    \"12-1\": \"A list of fields for cases from this policy item.\",\n    \"0-1\": \"The id of the policy.\",\n    \"1-1\": \"Is the customer required? \\n*** For the case view this will always return null.*\",\n    \"2-1\": \"Show the case summary.\",\n    \"3-1\": \"The summary is required to save.\\n*** For the case view this will always return null.*\",\n    \"4-1\": \"Show the tags field.\",\n    \"5-1\": \"Tags field is required to save.\\n*** For the case view this will always return null.*\",\n    \"6-1\": \"Show the assigned asset.\",\n    \"7-1\": \"Asset field is required to save.\\n*** For the case view this will always return null.*\",\n    \"9-1\": \"*** For the case view this will always return null.*\",\n    \"11-1\": \"The issue field is required to save.\\n*** For the case view this will always return null.*\",\n    \"8-1\": \"Show the assigned priority.\",\n    \"10-1\": \"Show the assigned issue.\"\n  },\n  \"cols\": 2,\n  \"rows\": 13\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Policy Field Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id\",\n    \"1-0\": \"name\",\n    \"2-0\": \"show\",\n    \"3-0\": \"required\",\n    \"0-1\": \"The id of the field.\",\n    \"1-1\": \"The display name of the field.\",\n    \"2-1\": \"Show the field.\",\n    \"3-1\": \"Require the field to save.\\n*** For the case view this will always return null.*\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","githubsync":"","hidden":false,"childrenPages":[]}

Policy Object


The case policy object is used by case policies to control the behavior of a case view or action. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "1-0": "customer_required", "2-0": "summary_show", "3-0": "summary_required", "4-0": "tags_show", "5-0": "tags_required", "6-0": "asset_show", "7-0": "asset_required", "8-0": "priority_show", "9-0": "priority_required", "10-0": "issue_show", "11-0": "issue_required", "12-0": "fields", "12-1": "A list of fields for cases from this policy item.", "0-1": "The id of the policy.", "1-1": "Is the customer required? \n*** For the case view this will always return null.*", "2-1": "Show the case summary.", "3-1": "The summary is required to save.\n*** For the case view this will always return null.*", "4-1": "Show the tags field.", "5-1": "Tags field is required to save.\n*** For the case view this will always return null.*", "6-1": "Show the assigned asset.", "7-1": "Asset field is required to save.\n*** For the case view this will always return null.*", "9-1": "*** For the case view this will always return null.*", "11-1": "The issue field is required to save.\n*** For the case view this will always return null.*", "8-1": "Show the assigned priority.", "10-1": "Show the assigned issue." }, "cols": 2, "rows": 13 } [/block] [block:api-header] { "type": "basic", "title": "Policy Field Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "1-0": "name", "2-0": "show", "3-0": "required", "0-1": "The id of the field.", "1-1": "The display name of the field.", "2-1": "Show the field.", "3-1": "Require the field to save.\n*** For the case view this will always return null.*" }, "cols": 2, "rows": 4 } [/block]
The case policy object is used by case policies to control the behavior of a case view or action. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "1-0": "customer_required", "2-0": "summary_show", "3-0": "summary_required", "4-0": "tags_show", "5-0": "tags_required", "6-0": "asset_show", "7-0": "asset_required", "8-0": "priority_show", "9-0": "priority_required", "10-0": "issue_show", "11-0": "issue_required", "12-0": "fields", "12-1": "A list of fields for cases from this policy item.", "0-1": "The id of the policy.", "1-1": "Is the customer required? \n*** For the case view this will always return null.*", "2-1": "Show the case summary.", "3-1": "The summary is required to save.\n*** For the case view this will always return null.*", "4-1": "Show the tags field.", "5-1": "Tags field is required to save.\n*** For the case view this will always return null.*", "6-1": "Show the assigned asset.", "7-1": "Asset field is required to save.\n*** For the case view this will always return null.*", "9-1": "*** For the case view this will always return null.*", "11-1": "The issue field is required to save.\n*** For the case view this will always return null.*", "8-1": "Show the assigned priority.", "10-1": "Show the assigned issue." }, "cols": 2, "rows": 13 } [/block] [block:api-header] { "type": "basic", "title": "Policy Field Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "1-0": "name", "2-0": "show", "3-0": "required", "0-1": "The id of the field.", "1-1": "The display name of the field.", "2-1": "Show the field.", "3-1": "Require the field to save.\n*** For the case view this will always return null.*" }, "cols": 2, "rows": 4 } [/block]
{"_id":"56581a80c4744f0d008a25b1","title":"Create an Activity","updates":[],"body":"Creating a new activity for a case from the API can be done by posting your activity object to Supportbench.  Updating activities are not supported.  \n\nWhen creating an activity, the below fields are available to you.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Default\",\n    \"h-3\": \"Summary\",\n    \"0-0\": \"case_id\",\n    \"1-0\": \"type_id\",\n    \"2-0\": \"contact_id\",\n    \"3-0\": \"time_spent\",\n    \"4-0\": \"subject\",\n    \"5-0\": \"public\",\n    \"6-0\": \"important\",\n    \"7-0\": \"logs\",\n    \"8-0\": \"solution\",\n    \"9-0\": \"email_from\",\n    \"10-0\": \"email_to\",\n    \"11-0\": \"email_cc\",\n    \"12-0\": \"content\",\n    \"0-1\": \"**yes**\",\n    \"1-1\": \"**yes**\",\n    \"2-1\": \"no\",\n    \"3-1\": \"no\",\n    \"4-1\": \"no\",\n    \"5-1\": \"no\",\n    \"6-1\": \"no\",\n    \"7-1\": \"no\",\n    \"8-1\": \"no\",\n    \"9-1\": \"no\",\n    \"10-1\": \"no\",\n    \"11-1\": \"no\",\n    \"12-1\": \"**yes**\",\n    \"0-2\": \"-\",\n    \"1-2\": \"-\",\n    \"2-2\": \"-\",\n    \"3-2\": \"0\",\n    \"4-2\": \"-\",\n    \"5-2\": \"False\",\n    \"6-2\": \"False\",\n    \"7-2\": \"False\",\n    \"8-2\": \"False\",\n    \"9-2\": \"-\",\n    \"10-2\": \"-\",\n    \"11-2\": \"-\",\n    \"12-2\": \"-\",\n    \"0-3\": \"The case id this activity is associated to.\",\n    \"1-3\": \"The activity type.  i.e. Task\",\n    \"2-3\": \"The contact associated to this activity.\",\n    \"3-3\": \"The time spent in minutes.\",\n    \"4-3\": \"The subject of the activity if different from the case.\",\n    \"5-3\": \"Is the case available within the communities.\",\n    \"6-3\": \"Set the important flag.\",\n    \"7-3\": \"Set the log flag.\",\n    \"8-3\": \"Set the solution flag.\",\n    \"9-3\": \"The email from.\",\n    \"10-3\": \"The email to addresses separated by commas.\",\n    \"11-3\": \"The email cc addresses separated by commas\",\n    \"12-3\": \"The activity content in HTML.\",\n    \"15-0\": \"attachment_group_id\",\n    \"15-1\": \"no\",\n    \"15-2\": \"-\",\n    \"15-3\": \"When attaching files, enter the attachment group id associated to the files to attach to this activity.\",\n    \"13-0\": \"due\",\n    \"14-0\": \"completed_on\",\n    \"13-1\": \"no\",\n    \"14-1\": \"no\",\n    \"13-2\": \"-\",\n    \"14-2\": \"-\",\n    \"13-3\": \"Used for tasks.  The date the task is due.\",\n    \"14-3\": \"Used for tasks.  The date the task was completed on.\"\n  },\n  \"cols\": 4,\n  \"rows\": 16\n}\n[/block]","excerpt":"","isReference":true,"link_external":false,"parentDoc":null,"sync_unique":"","version":"565416f4ac09cc2100feb2d8","__v":6,"api":{"examples":{"codes":[{"language":"javascript","code":"var new_activity_id = null;\nvar activity_data = {\n    \"case_id\": \"c-1000\",\n    \"type_id\": 1,\n    \"contact_id\": \"CT-1000\",\n    \"time_spent\": \"10\",\n    \"subject\": \"My Activity\",\n    \"public\": 1,\n    \"important\": 0,\n    \"logs\": 1,\n    \"solution\": 0,\n    \"email_from\": \"user@domain.com\",\n    \"email_to\": \"support@mydomain.com\",\n    \"email_cc\": \"\",\n    \"content\": \"<p>My Activity</p>\",\n    \"due\":'01/12/2016 11:00:00',    \n    \"completed_on\":'01/12/2016 12:00:00',\n    \"attachment_group_id\":\"4DFD576S54FSFD\"\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/activity',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(activity_data),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        var new_activity_id = jQuery.parseJSON(r).id;\n    }\n});","name":"jQuery"}]},"method":"post","params":[],"results":{"codes":[{"language":"json","code":"{\"id\":\"1000\"}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","url":"/activity","auth":"required"},"hidden":false,"next":{"description":"","pages":[]},"user":"565416cace43aa21002b2566","type":"post","createdAt":"2015-11-27T08:55:28.688Z","githubsync":"","link_url":"","project":"565416f3ac09cc2100feb2d5","slug":"create-an-activity","category":"56580701c4744f0d008a25a8","order":0,"childrenPages":[]}

postCreate an Activity


Creating a new activity for a case from the API can be done by posting your activity object to Supportbench. Updating activities are not supported. When creating an activity, the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Default", "h-3": "Summary", "0-0": "case_id", "1-0": "type_id", "2-0": "contact_id", "3-0": "time_spent", "4-0": "subject", "5-0": "public", "6-0": "important", "7-0": "logs", "8-0": "solution", "9-0": "email_from", "10-0": "email_to", "11-0": "email_cc", "12-0": "content", "0-1": "**yes**", "1-1": "**yes**", "2-1": "no", "3-1": "no", "4-1": "no", "5-1": "no", "6-1": "no", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "11-1": "no", "12-1": "**yes**", "0-2": "-", "1-2": "-", "2-2": "-", "3-2": "0", "4-2": "-", "5-2": "False", "6-2": "False", "7-2": "False", "8-2": "False", "9-2": "-", "10-2": "-", "11-2": "-", "12-2": "-", "0-3": "The case id this activity is associated to.", "1-3": "The activity type. i.e. Task", "2-3": "The contact associated to this activity.", "3-3": "The time spent in minutes.", "4-3": "The subject of the activity if different from the case.", "5-3": "Is the case available within the communities.", "6-3": "Set the important flag.", "7-3": "Set the log flag.", "8-3": "Set the solution flag.", "9-3": "The email from.", "10-3": "The email to addresses separated by commas.", "11-3": "The email cc addresses separated by commas", "12-3": "The activity content in HTML.", "15-0": "attachment_group_id", "15-1": "no", "15-2": "-", "15-3": "When attaching files, enter the attachment group id associated to the files to attach to this activity.", "13-0": "due", "14-0": "completed_on", "13-1": "no", "14-1": "no", "13-2": "-", "14-2": "-", "13-3": "Used for tasks. The date the task is due.", "14-3": "Used for tasks. The date the task was completed on." }, "cols": 4, "rows": 16 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Creating a new activity for a case from the API can be done by posting your activity object to Supportbench. Updating activities are not supported. When creating an activity, the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Default", "h-3": "Summary", "0-0": "case_id", "1-0": "type_id", "2-0": "contact_id", "3-0": "time_spent", "4-0": "subject", "5-0": "public", "6-0": "important", "7-0": "logs", "8-0": "solution", "9-0": "email_from", "10-0": "email_to", "11-0": "email_cc", "12-0": "content", "0-1": "**yes**", "1-1": "**yes**", "2-1": "no", "3-1": "no", "4-1": "no", "5-1": "no", "6-1": "no", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "11-1": "no", "12-1": "**yes**", "0-2": "-", "1-2": "-", "2-2": "-", "3-2": "0", "4-2": "-", "5-2": "False", "6-2": "False", "7-2": "False", "8-2": "False", "9-2": "-", "10-2": "-", "11-2": "-", "12-2": "-", "0-3": "The case id this activity is associated to.", "1-3": "The activity type. i.e. Task", "2-3": "The contact associated to this activity.", "3-3": "The time spent in minutes.", "4-3": "The subject of the activity if different from the case.", "5-3": "Is the case available within the communities.", "6-3": "Set the important flag.", "7-3": "Set the log flag.", "8-3": "Set the solution flag.", "9-3": "The email from.", "10-3": "The email to addresses separated by commas.", "11-3": "The email cc addresses separated by commas", "12-3": "The activity content in HTML.", "15-0": "attachment_group_id", "15-1": "no", "15-2": "-", "15-3": "When attaching files, enter the attachment group id associated to the files to attach to this activity.", "13-0": "due", "14-0": "completed_on", "13-1": "no", "14-1": "no", "13-2": "-", "14-2": "-", "13-3": "Used for tasks. The date the task is due.", "14-3": "Used for tasks. The date the task was completed on." }, "cols": 4, "rows": 16 } [/block]
{"_id":"565807403df5130d00a579c6","order":1,"sync_unique":"","title":"Returning an Activity","body":"You can retrieve a case activity and all of its data.  All activity fields, and its attachments are returned.","editedParams":true,"excerpt":"","githubsync":"","link_external":false,"updates":[],"next":{"pages":[],"description":""},"slug":"retrieve-activity","__v":1,"category":"56580701c4744f0d008a25a8","editedParams2":true,"hidden":false,"link_url":"","version":"565416f4ac09cc2100feb2d8","createdAt":"2015-11-27T07:33:20.327Z","isReference":true,"parentDoc":null,"user":"565416cace43aa21002b2566","api":{"method":"get","params":[{"ref":"","required":false,"type":"int","in":"path","_id":"565807403df5130d00a579c7","default":"","desc":"A case activity id","name":"id"}],"results":{"codes":[{"name":"","code":"{  \n   \"id\":\"1000\",\n   \"case_id\":\"C-1000\",   \n   \"type_id\":\"20\",\n   \"type\":\"Email - Outgoing Forward\",\n   \"type_icon\":\"https://na1.supportbench.net/images/email2.png\",\n   \"contact_id\":\"CT-1000\",\n   \"contact\":\"Jack Rogers\",\n   \"contact_email\":\"jack@hisdomain.com\",\n   \"time_spent\":31,\n   \"subject\":\"\",\n   \"public\":true,\n   \"email_from\":null,\n   \"email_to\":\"jack@domain.com\",\n   \"email_cc\":null,\n   \"content\":\"<p>Forward</p>\",   \n   \"content_plaintext\":\"Forward\",\n   \"createdby_id\":\"1\",\n   \"createdby\":\"Joe Smith\",\n   \"created\":\"Nov 24 2015  8:26AM\",   \n   \"created_unix\":\"32168764535454\",\n   \"created_ago\":\"51 Day(s) ago\",\n   \"due\":\"Nov 24 2015  8:26AM\",\n   \"due_unix\":\"32168764535454\",\n   \"due_ago\":\"51 Day(s) ago\",\n   \"completed_on\":\"Nov 24 2015  8:26AM\",\n   \"completed_on_unix\":\"32168764535454\",\n   \"completed_on_ago\":\"51 Day(s) ago\",\n   \"response_time\":120,\n   \"sla_response_time\":60,\n   \"sla_response_time_expected\":360,\n   \"attachments\":[  \n      {  \n         \"id\" : 1234,\n         \"name\":\"thumbnail.png\",\n         \"size\":\"16786\",\n         \"url\":\"https://kustorage.blob.core.windows.net/acc/case/C-1000/1000/thumbnail.png?sv=2015-04-05&sr=c&si=accountpolicy&sig=TxTicDsjVpwrPoOx5NuOD1FtnfkKQVFf5enaocf4gjM%3D\"\n      }\n   ]\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/activity/:id","auth":"required","examples":{"codes":[{"name":"jQuery","language":"javascript","code":"var activity_data = null;\nvar activity_id = '1000';\n\n$.ajax({\n    url: 'https://api.supportbench.net/activity/' + activity_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        activity_data = r;\n        alert(activity_data.id);\n    }\n});"}]}},"project":"565416f3ac09cc2100feb2d5","type":"get","childrenPages":[]}

getReturning an Activity


Path Params

id:
integer
A case activity id
You can retrieve a case activity and all of its data. All activity fields, and its attachments are returned.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



You can retrieve a case activity and all of its data. All activity fields, and its attachments are returned.
{"_id":"56e2001b059d4a0e0034fa7e","createdAt":"2016-03-10T23:15:39.162Z","editedParams":true,"editedParams2":true,"isReference":true,"link_external":false,"link_url":"","slug":"return-types","sync_unique":"","version":"565416f4ac09cc2100feb2d8","category":"56580701c4744f0d008a25a8","excerpt":"","hidden":false,"title":"Return Types","type":"get","updates":[],"__v":0,"order":2,"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","api":{"settings":"","url":"/activity/types/:category_id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var list_data = null;\nvar category_id = 0; //the category id to filter for\n\n$.ajax({\n    url: 'https://api.supportbench.net/activity/types/' + category_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript"}]},"method":"get","params":[{"name":"category_id","in":"path","_id":"56cd0aafca43550b00281528","ref":"","required":false,"desc":"The category id to filter for","default":"","type":"string"}],"results":{"codes":[{"name":"","code":"[{\n    \"id\": \"10\",    \n    \"name\": \"Phone Call\"\n},{\n    \"id\": \"15\",    \n    \"name\": \"Inbound Email\"\n}]","language":"json","status":200},{"status":400,"name":"","code":"{}","language":"json"}]}},"body":"Return a list of active activity types in the system.  The types will return in order of the order within the system which it was given..  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The unique id of the activity type.\",\n    \"1-1\": \"The full name of the activity type.\",\n    \"1-0\": \"name\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]","githubsync":"","user":"565416cace43aa21002b2566","childrenPages":[]}

getReturn Types


Path Params

category_id:
string
The category id to filter for
Return a list of active activity types in the system. The types will return in order of the order within the system which it was given.. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the activity type.", "1-1": "The full name of the activity type.", "1-0": "name" }, "cols": 2, "rows": 2 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a list of active activity types in the system. The types will return in order of the order within the system which it was given.. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the activity type.", "1-1": "The full name of the activity type.", "1-0": "name" }, "cols": 2, "rows": 2 } [/block]
{"_id":"56e75117e7d54f3200c70858","createdAt":"2016-03-15T00:02:31.752Z","editedParams2":true,"hidden":false,"parentDoc":null,"user":"565416cace43aa21002b2566","api":{"settings":"","url":"/attachment/upload/:group_id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"<html>\n  <form id=\"form-uploader\" enctype=\"multipart/form-data\" method=\"post\" novalidate=\"novalidate\">    \n    <input type=\"file\" id=\"fileInput\" name=\"fileInput\" />\n  </form>\n</html>\n\n<script>\n  var data = new FormData($('#form-uploader')); //The form with the <input type=\"file\">\n\n   //attach the file to the form\n  var attachedFile = $('#fileInput')[0];\n  data.append(\"files\", attachedFile.files[0]);\n\n  //A string to attach related file\n  _groupId = \"34dr57dfg56tsd239d\";\n\n  $.ajax({\n      url: \"https://api.supportbench.net/attachment/upload/\" + _groupId,\n      type: 'POST',\n      beforeSend: function(request) {\n          request.setRequestHeader('Authorization', 'Bearer ' + token);\n      },\n      enctype: 'multipart/form-data',\n      contentType: false,\n      processData: false, // prevent auto processing\n      cache: false,\n      data: data, // submit the manipulated form data\n      success: function(d, textStatus, xhr) {\n          $.each($.parseJSON(d), function(index, i) {\n              alert(i.file_name);\n          });\n      },\n      error: function(XMLHttpRequest, textStatus, errorThrown) {\n          //error proccessing\n      }\n  });\n</script>\n","language":"javascript"}]},"method":"post","params":[{"required":false,"desc":"A group id assigned to the attachment","default":"","type":"string","name":"group_id","in":"path","_id":"56e75117e7d54f3200c70859","ref":""}],"results":{"codes":[{"status":200,"language":"json","code":"[{\n  \"file_name\":\"myfile.png\",\n  \"url\":\"https://storage.file.com/myfile.png\",\n  \"bytes\",\"43563452\"\n}]","name":""},{"status":400,"language":"json","code":"{}","name":""}]}},"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Result Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"file_name\",\n    \"0-1\": \"The file name of the file uploaded\",\n    \"1-0\": \"url\",\n    \"1-1\": \"The uploaded url of the file.\",\n    \"0-2\": \"The case id to update.\",\n    \"1-2\": \"The agent id to assign the case to.  This must be set if the queue id is not.\",\n    \"2-0\": \"bytes\",\n    \"2-1\": \"The size of the file in bytes.\",\n    \"2-2\": \"The queue id to assign the case to.  This must be set if the agent id is not.  \\n\\nIf both the agent and queue id's are set, the queue_id will be taken as the authoritative assignment location.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]","link_url":"","title":"Upload Attachment (HTML5 Form)","updates":[],"version":"565416f4ac09cc2100feb2d8","type":"post","order":3,"__v":0,"category":"56580701c4744f0d008a25a8","editedParams":true,"excerpt":"","githubsync":"","isReference":true,"link_external":false,"project":"565416f3ac09cc2100feb2d5","slug":"upload-attachment-html5-form","sync_unique":"","childrenPages":[]}

postUpload Attachment (HTML5 Form)


Path Params

group_id:
string
A group id assigned to the attachment
[block:api-header] { "type": "basic", "title": "Result Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Description", "h-2": "Description", "0-0": "file_name", "0-1": "The file name of the file uploaded", "1-0": "url", "1-1": "The uploaded url of the file.", "0-2": "The case id to update.", "1-2": "The agent id to assign the case to. This must be set if the queue id is not.", "2-0": "bytes", "2-1": "The size of the file in bytes.", "2-2": "The queue id to assign the case to. This must be set if the agent id is not. \n\nIf both the agent and queue id's are set, the queue_id will be taken as the authoritative assignment location." }, "cols": 2, "rows": 3 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



[block:api-header] { "type": "basic", "title": "Result Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Description", "h-2": "Description", "0-0": "file_name", "0-1": "The file name of the file uploaded", "1-0": "url", "1-1": "The uploaded url of the file.", "0-2": "The case id to update.", "1-2": "The agent id to assign the case to. This must be set if the queue id is not.", "2-0": "bytes", "2-1": "The size of the file in bytes.", "2-2": "The queue id to assign the case to. This must be set if the agent id is not. \n\nIf both the agent and queue id's are set, the queue_id will be taken as the authoritative assignment location." }, "cols": 2, "rows": 3 } [/block]
{"_id":"56e85449464cbd17004815d7","category":"56580701c4744f0d008a25a8","excerpt":"","slug":"delete-attachment","updates":[],"__v":0,"user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","link_url":"","project":"565416f3ac09cc2100feb2d5","editedParams2":true,"githubsync":"","hidden":false,"isReference":true,"sync_unique":"","type":"delete","createdAt":"2016-03-15T18:28:25.467Z","editedParams":true,"link_external":false,"order":4,"parentDoc":null,"title":"Delete Attachment","api":{"method":"delete","params":[{"desc":"The id of the attachment to delete","default":"0","type":"string","name":"id","in":"path","_id":"56bd6fb9d1fb1323003fda86","ref":"","required":false}],"results":{"codes":[{"language":"json","status":200,"name":"","code":"{\n    \"success\": \"true\"\n}"},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":"","url":"/attachment/delete/:id","auth":"required","examples":{"codes":[{"language":"javascript","name":"jQuery","code":"var result = null;\nvar attachment_id = '123456';\n\n$.ajax({\n    url: 'https://api.supportbench.net/attachment/delete/' + attachment_id,\n    type: 'delete',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n          alert(r.success);        \n    }\n});"}]}},"body":"Delete a notification from your Bench.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning notification delete object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"success\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"Whether the attachment was successfully deleted.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]","childrenPages":[]}

deleteDelete Attachment


Path Params

id:
string0
The id of the attachment to delete
Delete a notification from your Bench. [block:api-header] { "type": "basic", "title": "Returning notification delete object" } [/block] [block:parameters] { "data": { "0-0": "success", "h-0": "Name", "h-1": "Description", "0-1": "Whether the attachment was successfully deleted." }, "cols": 2, "rows": 1 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Delete a notification from your Bench. [block:api-header] { "type": "basic", "title": "Returning notification delete object" } [/block] [block:parameters] { "data": { "0-0": "success", "h-0": "Name", "h-1": "Description", "0-1": "Whether the attachment was successfully deleted." }, "cols": 2, "rows": 1 } [/block]
{"_id":"56580d9c2498a10d006a2543","type":"basic","version":"565416f4ac09cc2100feb2d8","order":5,"api":{"settings":"","url":"","auth":"required","params":[],"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]}},"category":"56580701c4744f0d008a25a8","link_external":false,"sync_unique":"","title":"Activity Object","__v":4,"createdAt":"2015-11-27T08:00:28.380Z","excerpt":"","hidden":false,"link_url":"","project":"565416f3ac09cc2100feb2d5","updates":[],"user":"565416cace43aa21002b2566","body":"[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"The activity id.\",\n    \"1-0\": \"case_id\",\n    \"1-1\": \"The case id of the activity.\",\n    \"2-0\": \"type_id\",\n    \"3-0\": \"type\",\n    \"5-0\": \"contact_id\",\n    \"6-0\": \"contact\",\n    \"8-0\": \"time_spent\",\n    \"9-0\": \"subject\",\n    \"2-1\": \"The activity type id.\",\n    \"3-1\": \"The display name of the activity type.\",\n    \"5-1\": \"The contact id of the activity.\",\n    \"6-1\": \"The contact name of the activity.\",\n    \"8-1\": \"Time spent on the activity in minutes.\",\n    \"9-1\": \"The subject of the activity if an incoming email.\",\n    \"10-0\": \"public\",\n    \"14-0\": \"email_from\",\n    \"15-0\": \"email_to\",\n    \"16-0\": \"email_cc\",\n    \"17-0\": \"content\",\n    \"19-0\": \"createdby_id\",\n    \"10-1\": \"Is the activity publicly view-able in the communities.\",\n    \"14-1\": \"The from address of the the incoming email if the activity was one.\",\n    \"15-1\": \"The to addresses of the incoming / outgoing email.\",\n    \"16-1\": \"The cc addresses of the incoming / outgoing email.\",\n    \"17-1\": \"The activity content as HTML.\",\n    \"19-1\": \"The agent id who created the activity if created by one.\",\n    \"20-0\": \"createdby\",\n    \"20-1\": \"The agent name who created the activity if created by one.\",\n    \"21-0\": \"created\",\n    \"21-1\": \"The date the activity was created in UTC.\",\n    \"30-0\": \"response_time\",\n    \"30-1\": \"The response time from the last activity.\",\n    \"31-0\": \"sla_response_time\",\n    \"31-1\": \"The SLA response time if there was an SLA set on the case.\",\n    \"32-0\": \"sla_response_time_expected\",\n    \"33-0\": \"attachments\",\n    \"32-1\": \"The SLA response time that was expected on this activity.\",\n    \"33-1\": \"An array of attachments linked to this activity.  Please see the attachment object in the next section.\",\n    \"11-0\": \"important\",\n    \"12-0\": \"logs\",\n    \"13-0\": \"solution\",\n    \"11-1\": \"Important flag is set.\",\n    \"12-1\": \"logs flag is set.\",\n    \"13-1\": \"solution flag is set.\",\n    \"4-0\": \"type_icon\",\n    \"4-1\": \"The icon of the activity type.\",\n    \"22-0\": \"created_unix\",\n    \"23-0\": \"created_ago\",\n    \"22-1\": \"The date the activity was created as a time stamp.\",\n    \"23-1\": \"The date the activity was created in a friendly time.\",\n    \"7-0\": \"contact_email\",\n    \"7-1\": \"The contact email address.\",\n    \"18-0\": \"content_plaintext\",\n    \"18-1\": \"The activity content with no HTML.\",\n    \"24-0\": \"due\",\n    \"25-0\": \"due_unix\",\n    \"26-0\": \"due_ago\",\n    \"27-0\": \"completed_on\",\n    \"28-0\": \"completed_on_unix\",\n    \"29-0\": \"completed_on_ago\",\n    \"24-1\": \"The date the activity was is due on in UTC. Only used for tasks.\",\n    \"25-1\": \"The date the activity was is due on in UTC as a UNIX time stamp. Only used for tasks.\",\n    \"26-1\": \"The date the activity was is due on in UTC in a friendly format. Only used for tasks.\",\n    \"29-1\": \"The date the activity was completed on in UTC in a friendly format. Only used for tasks.\",\n    \"27-1\": \"The date the activity was completed on in UTC.  Only used for tasks.\",\n    \"28-1\": \"The date the activity was completed on in UTC as a UNIX time stamp. Only used for tasks.\"\n  },\n  \"cols\": 2,\n  \"rows\": 34\n}\n[/block]","githubsync":"","isReference":true,"next":{"pages":[],"description":""},"parentDoc":null,"slug":"activity-object-1","childrenPages":[]}

Activity Object


[block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The activity id.", "1-0": "case_id", "1-1": "The case id of the activity.", "2-0": "type_id", "3-0": "type", "5-0": "contact_id", "6-0": "contact", "8-0": "time_spent", "9-0": "subject", "2-1": "The activity type id.", "3-1": "The display name of the activity type.", "5-1": "The contact id of the activity.", "6-1": "The contact name of the activity.", "8-1": "Time spent on the activity in minutes.", "9-1": "The subject of the activity if an incoming email.", "10-0": "public", "14-0": "email_from", "15-0": "email_to", "16-0": "email_cc", "17-0": "content", "19-0": "createdby_id", "10-1": "Is the activity publicly view-able in the communities.", "14-1": "The from address of the the incoming email if the activity was one.", "15-1": "The to addresses of the incoming / outgoing email.", "16-1": "The cc addresses of the incoming / outgoing email.", "17-1": "The activity content as HTML.", "19-1": "The agent id who created the activity if created by one.", "20-0": "createdby", "20-1": "The agent name who created the activity if created by one.", "21-0": "created", "21-1": "The date the activity was created in UTC.", "30-0": "response_time", "30-1": "The response time from the last activity.", "31-0": "sla_response_time", "31-1": "The SLA response time if there was an SLA set on the case.", "32-0": "sla_response_time_expected", "33-0": "attachments", "32-1": "The SLA response time that was expected on this activity.", "33-1": "An array of attachments linked to this activity. Please see the attachment object in the next section.", "11-0": "important", "12-0": "logs", "13-0": "solution", "11-1": "Important flag is set.", "12-1": "logs flag is set.", "13-1": "solution flag is set.", "4-0": "type_icon", "4-1": "The icon of the activity type.", "22-0": "created_unix", "23-0": "created_ago", "22-1": "The date the activity was created as a time stamp.", "23-1": "The date the activity was created in a friendly time.", "7-0": "contact_email", "7-1": "The contact email address.", "18-0": "content_plaintext", "18-1": "The activity content with no HTML.", "24-0": "due", "25-0": "due_unix", "26-0": "due_ago", "27-0": "completed_on", "28-0": "completed_on_unix", "29-0": "completed_on_ago", "24-1": "The date the activity was is due on in UTC. Only used for tasks.", "25-1": "The date the activity was is due on in UTC as a UNIX time stamp. Only used for tasks.", "26-1": "The date the activity was is due on in UTC in a friendly format. Only used for tasks.", "29-1": "The date the activity was completed on in UTC in a friendly format. Only used for tasks.", "27-1": "The date the activity was completed on in UTC. Only used for tasks.", "28-1": "The date the activity was completed on in UTC as a UNIX time stamp. Only used for tasks." }, "cols": 2, "rows": 34 } [/block]
[block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The activity id.", "1-0": "case_id", "1-1": "The case id of the activity.", "2-0": "type_id", "3-0": "type", "5-0": "contact_id", "6-0": "contact", "8-0": "time_spent", "9-0": "subject", "2-1": "The activity type id.", "3-1": "The display name of the activity type.", "5-1": "The contact id of the activity.", "6-1": "The contact name of the activity.", "8-1": "Time spent on the activity in minutes.", "9-1": "The subject of the activity if an incoming email.", "10-0": "public", "14-0": "email_from", "15-0": "email_to", "16-0": "email_cc", "17-0": "content", "19-0": "createdby_id", "10-1": "Is the activity publicly view-able in the communities.", "14-1": "The from address of the the incoming email if the activity was one.", "15-1": "The to addresses of the incoming / outgoing email.", "16-1": "The cc addresses of the incoming / outgoing email.", "17-1": "The activity content as HTML.", "19-1": "The agent id who created the activity if created by one.", "20-0": "createdby", "20-1": "The agent name who created the activity if created by one.", "21-0": "created", "21-1": "The date the activity was created in UTC.", "30-0": "response_time", "30-1": "The response time from the last activity.", "31-0": "sla_response_time", "31-1": "The SLA response time if there was an SLA set on the case.", "32-0": "sla_response_time_expected", "33-0": "attachments", "32-1": "The SLA response time that was expected on this activity.", "33-1": "An array of attachments linked to this activity. Please see the attachment object in the next section.", "11-0": "important", "12-0": "logs", "13-0": "solution", "11-1": "Important flag is set.", "12-1": "logs flag is set.", "13-1": "solution flag is set.", "4-0": "type_icon", "4-1": "The icon of the activity type.", "22-0": "created_unix", "23-0": "created_ago", "22-1": "The date the activity was created as a time stamp.", "23-1": "The date the activity was created in a friendly time.", "7-0": "contact_email", "7-1": "The contact email address.", "18-0": "content_plaintext", "18-1": "The activity content with no HTML.", "24-0": "due", "25-0": "due_unix", "26-0": "due_ago", "27-0": "completed_on", "28-0": "completed_on_unix", "29-0": "completed_on_ago", "24-1": "The date the activity was is due on in UTC. Only used for tasks.", "25-1": "The date the activity was is due on in UTC as a UNIX time stamp. Only used for tasks.", "26-1": "The date the activity was is due on in UTC in a friendly format. Only used for tasks.", "29-1": "The date the activity was completed on in UTC in a friendly format. Only used for tasks.", "27-1": "The date the activity was completed on in UTC. Only used for tasks.", "28-1": "The date the activity was completed on in UTC as a UNIX time stamp. Only used for tasks." }, "cols": 2, "rows": 34 } [/block]
{"_id":"56580db383633a0d00cadbea","githubsync":"","hidden":false,"isReference":true,"next":{"description":"","pages":[]},"order":6,"title":"Attachment Object","api":{"url":"","auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":""},"createdAt":"2015-11-27T08:00:51.368Z","excerpt":"","link_external":false,"parentDoc":null,"__v":3,"project":"565416f3ac09cc2100feb2d5","sync_unique":"","user":"565416cace43aa21002b2566","body":"The attachment object is what is returned within the attachments property when retrieving an activity.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"1-0\": \"name\",\n    \"1-1\": \"The name of the file.\",\n    \"2-0\": \"size\",\n    \"2-1\": \"The size of the file in bytes.\",\n    \"3-0\": \"url\",\n    \"3-1\": \"The download URL of the file.  This includes an expiring security signature in the URL.\",\n    \"0-0\": \"id\",\n    \"0-1\": \"The unique attachment id\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","category":"56580701c4744f0d008a25a8","link_url":"","slug":"attachment-object-2","type":"basic","updates":[],"version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

Attachment Object


The attachment object is what is returned within the attachments property when retrieving an activity. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "1-0": "name", "1-1": "The name of the file.", "2-0": "size", "2-1": "The size of the file in bytes.", "3-0": "url", "3-1": "The download URL of the file. This includes an expiring security signature in the URL.", "0-0": "id", "0-1": "The unique attachment id" }, "cols": 2, "rows": 4 } [/block]
The attachment object is what is returned within the attachments property when retrieving an activity. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "1-0": "name", "1-1": "The name of the file.", "2-0": "size", "2-1": "The size of the file in bytes.", "3-0": "url", "3-1": "The download URL of the file. This includes an expiring security signature in the URL.", "0-0": "id", "0-1": "The unique attachment id" }, "cols": 2, "rows": 4 } [/block]
{"_id":"5658fe5a5a9e990d004a5ce8","title":"Create / Update Company","updates":[],"user":"565416cace43aa21002b2566","api":{"examples":{"codes":[{"name":"jQuery","code":"var company_id = null;\nvar company_data = {\n  \t\"id_prefix\":\"CP\", //not required for company updates\n    \"id_source\":\"12345\", //not required for company updates, only if you want to customize your id\n  \t\"id\":\"CP-1000\", //required for company updates, omit of null value to create a new company\n    \"name\": \"My Company\", //required for company creations\n    \"address\": \"123 Fake Street\",\n    \"city\": \"Los Angeles\",\n    \"zip\": \"90210\", \n    \"state\": \"CA\",\n    \"country\": \"USA\",\n    \"support_level_id\": 1,\n    \"active\": 1,\n    \"fields\": [{\n        'id': 10,\n        'value': '1234567890'\n    }, {\n        'id': 11,\n        'value': true\n    }]\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/company',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(company_data),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        company_id = jQuery.parseJSON(r).id;\n    }\n});","language":"javascript"}]},"method":"post","params":[],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{\"id\":\"CP-1000\"}"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/company","auth":"required"},"createdAt":"2015-11-28T01:07:38.951Z","isReference":true,"order":0,"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","sync_unique":"","githubsync":"","link_external":false,"version":"565416f4ac09cc2100feb2d8","hidden":false,"link_url":"","slug":"create-update-company","type":"post","__v":10,"body":"Creating and updating a company from the API can be done by posting your company object to Supportbench. \n\nThe only difference between company creations and updates is including a company id within the company object.\n\nWhen creating or updating a company, the below fields are available to you.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Availability\",\n    \"0-0\": \"id_prefix\",\n    \"2-0\": \"id\",\n    \"3-0\": \"name\",\n    \"4-0\": \"address\",\n    \"5-0\": \"city\",\n    \"6-0\": \"zip\",\n    \"7-0\": \"state\",\n    \"8-0\": \"country\",\n    \"9-0\": \"support_level_id\",\n    \"10-0\": \"active\",\n    \"11-0\": \"fields\",\n    \"0-1\": \"no\",\n    \"2-1\": \"no - when creating \\nyes - when updating\",\n    \"0-2\": \"5 characters\",\n    \"0-3\": \"\\\"CP\\\"\",\n    \"2-3\": \"-\",\n    \"0-4\": \"New\",\n    \"2-4\": \"Update\",\n    \"2-2\": \"30 characters\",\n    \"3-1\": \"**yes**\",\n    \"3-2\": \"500 characters\",\n    \"3-3\": \"-\",\n    \"3-4\": \"New / Update\",\n    \"4-1\": \"no\",\n    \"5-1\": \"no\",\n    \"6-1\": \"no\",\n    \"7-1\": \"no\",\n    \"8-1\": \"no\",\n    \"9-1\": \"no\",\n    \"10-1\": \"no\",\n    \"11-1\": \"no\",\n    \"4-2\": \"250 characters\",\n    \"5-2\": \"100 characters\",\n    \"6-2\": \"25 characters\",\n    \"7-2\": \"50 characters\",\n    \"8-2\": \"5 characters\",\n    \"9-2\": \"Integer\",\n    \"10-2\": \"Boolean\",\n    \"11-2\": \"See field object\",\n    \"4-3\": \"-\",\n    \"5-3\": \"-\",\n    \"6-3\": \"-\",\n    \"7-3\": \"-\",\n    \"8-3\": \"-\",\n    \"9-3\": \"-\",\n    \"10-3\": \"-\",\n    \"11-3\": \"-\",\n    \"4-4\": \"New / Update\",\n    \"5-4\": \"New / Update\",\n    \"6-4\": \"New / Update\",\n    \"7-4\": \"New / Update\",\n    \"8-4\": \"New / Update\",\n    \"9-4\": \"New / Update\",\n    \"10-4\": \"New / Update\",\n    \"11-4\": \"New / Update\",\n    \"h-5\": \"Summary\",\n    \"2-5\": \"The full company id including the prefix.\",\n    \"0-5\": \"The prefix of the company. You can assign new company prefix's within the API administration section.\",\n    \"3-5\": \"The company name.\",\n    \"4-5\": \"The mailing address of the company.\",\n    \"5-5\": \"The mailing city of the company.\",\n    \"6-5\": \"The mailing zip / postal code of the company.\",\n    \"7-5\": \"The mailing state or province of the company.\",\n    \"9-5\": \"The support level id of the company.\",\n    \"8-5\": \"The 2 character ISO country code of the company. i.e. US, CA. Country code can be found here: [https://countrycode.org/](https://countrycode.org/)\",\n    \"10-5\": \"Is the company active or not.\",\n    \"11-5\": \"A field array of custom fields to insert or update. Please see the field object below.\",\n    \"1-0\": \"id_source\",\n    \"1-1\": \"no\",\n    \"1-2\": \"25 characters\",\n    \"1-3\": \"-\",\n    \"1-4\": \"New\",\n    \"1-5\": \"The source id of the company. You can assign custom ID's from existing systems or assign your own id.\"\n  },\n  \"cols\": 6,\n  \"rows\": 12\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Fields Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"**yes**\",\n    \"0-2\": \"Integer\",\n    \"0-3\": \"-\",\n    \"0-4\": \"The field id of the field you wish to update.  The field id must map to a valid field in the company.\",\n    \"1-0\": \"value\",\n    \"1-1\": \"**yes**\",\n    \"1-2\": \"Dropdown list - Integer\\nCheckbox - Boolean\\nText box - Unlimited\",\n    \"1-3\": \"-\",\n    \"1-4\": \"The value of the custom field.  The value is dependent on the field type.\"\n  },\n  \"cols\": 5,\n  \"rows\": 2\n}\n[/block]","category":"5658b1205a9e990d004a5cb6","excerpt":"","childrenPages":[]}

postCreate / Update Company


Creating and updating a company from the API can be done by posting your company object to Supportbench. The only difference between company creations and updates is including a company id within the company object. When creating or updating a company, the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "id_prefix", "2-0": "id", "3-0": "name", "4-0": "address", "5-0": "city", "6-0": "zip", "7-0": "state", "8-0": "country", "9-0": "support_level_id", "10-0": "active", "11-0": "fields", "0-1": "no", "2-1": "no - when creating \nyes - when updating", "0-2": "5 characters", "0-3": "\"CP\"", "2-3": "-", "0-4": "New", "2-4": "Update", "2-2": "30 characters", "3-1": "**yes**", "3-2": "500 characters", "3-3": "-", "3-4": "New / Update", "4-1": "no", "5-1": "no", "6-1": "no", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "11-1": "no", "4-2": "250 characters", "5-2": "100 characters", "6-2": "25 characters", "7-2": "50 characters", "8-2": "5 characters", "9-2": "Integer", "10-2": "Boolean", "11-2": "See field object", "4-3": "-", "5-3": "-", "6-3": "-", "7-3": "-", "8-3": "-", "9-3": "-", "10-3": "-", "11-3": "-", "4-4": "New / Update", "5-4": "New / Update", "6-4": "New / Update", "7-4": "New / Update", "8-4": "New / Update", "9-4": "New / Update", "10-4": "New / Update", "11-4": "New / Update", "h-5": "Summary", "2-5": "The full company id including the prefix.", "0-5": "The prefix of the company. You can assign new company prefix's within the API administration section.", "3-5": "The company name.", "4-5": "The mailing address of the company.", "5-5": "The mailing city of the company.", "6-5": "The mailing zip / postal code of the company.", "7-5": "The mailing state or province of the company.", "9-5": "The support level id of the company.", "8-5": "The 2 character ISO country code of the company. i.e. US, CA. Country code can be found here: [https://countrycode.org/](https://countrycode.org/)", "10-5": "Is the company active or not.", "11-5": "A field array of custom fields to insert or update. Please see the field object below.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the company. You can assign custom ID's from existing systems or assign your own id." }, "cols": 6, "rows": 12 } [/block] [block:api-header] { "type": "basic", "title": "Fields Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the company.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Creating and updating a company from the API can be done by posting your company object to Supportbench. The only difference between company creations and updates is including a company id within the company object. When creating or updating a company, the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "id_prefix", "2-0": "id", "3-0": "name", "4-0": "address", "5-0": "city", "6-0": "zip", "7-0": "state", "8-0": "country", "9-0": "support_level_id", "10-0": "active", "11-0": "fields", "0-1": "no", "2-1": "no - when creating \nyes - when updating", "0-2": "5 characters", "0-3": "\"CP\"", "2-3": "-", "0-4": "New", "2-4": "Update", "2-2": "30 characters", "3-1": "**yes**", "3-2": "500 characters", "3-3": "-", "3-4": "New / Update", "4-1": "no", "5-1": "no", "6-1": "no", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "11-1": "no", "4-2": "250 characters", "5-2": "100 characters", "6-2": "25 characters", "7-2": "50 characters", "8-2": "5 characters", "9-2": "Integer", "10-2": "Boolean", "11-2": "See field object", "4-3": "-", "5-3": "-", "6-3": "-", "7-3": "-", "8-3": "-", "9-3": "-", "10-3": "-", "11-3": "-", "4-4": "New / Update", "5-4": "New / Update", "6-4": "New / Update", "7-4": "New / Update", "8-4": "New / Update", "9-4": "New / Update", "10-4": "New / Update", "11-4": "New / Update", "h-5": "Summary", "2-5": "The full company id including the prefix.", "0-5": "The prefix of the company. You can assign new company prefix's within the API administration section.", "3-5": "The company name.", "4-5": "The mailing address of the company.", "5-5": "The mailing city of the company.", "6-5": "The mailing zip / postal code of the company.", "7-5": "The mailing state or province of the company.", "9-5": "The support level id of the company.", "8-5": "The 2 character ISO country code of the company. i.e. US, CA. Country code can be found here: [https://countrycode.org/](https://countrycode.org/)", "10-5": "Is the company active or not.", "11-5": "A field array of custom fields to insert or update. Please see the field object below.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the company. You can assign custom ID's from existing systems or assign your own id." }, "cols": 6, "rows": 12 } [/block] [block:api-header] { "type": "basic", "title": "Fields Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the company.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]
{"_id":"5658b15364950b0d00e78da7","editedParams":true,"editedParams2":true,"hidden":false,"isReference":true,"type":"get","updates":[],"order":1,"createdAt":"2015-11-27T19:38:59.275Z","githubsync":"","link_external":false,"link_url":"","next":{"description":"","pages":[]},"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","api":{"examples":{"codes":[{"name":"jQuery","language":"javascript","code":"var company_data = null;\nvar company_id = 'CP-1000';\n\n$.ajax({\n    url: 'https://api.supportbench.net/company/' + company_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        company_data = r;\n        alert(company_data.id);\n    }\n});"}]},"method":"get","params":[{"name":"id","ref":"","required":false,"type":"string","_id":"5658b15364950b0d00e78da8","default":"","desc":"A company id","in":"path"}],"results":{"codes":[{"name":"","code":"{\n    \"id_prefix\": \"CP\",\n    \"id\": \"CP-1000\",\n    \"name\": \"Company Name\",\n    \"address\": \"525 S. Lexington Ave\",\n    \"city\": \"Los Angeles\",\n    \"zip\": \"90210\",\n    \"state\": \"California\",\n    \"state_code\": \"CA\",\n    \"country\": \"United States\",\n    \"country_code\": \"US\",\n    \"support_level_id\": 0,\n    \"support_level\": \"\",\n    \"active\": false,\n    \"fields\": [],\n    \"modified\": \"Jun 20 2015  8:02PM\",\n    \"created\": \"Jun 4 2015  9:28PM\"\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/company/:id","auth":"required"},"title":"Return a Company","sync_unique":"","body":"You can retrieve a company and all of its data.  All activity fields are returned.","category":"5658b1205a9e990d004a5cb6","excerpt":"","slug":"retrieve-a-company","user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","__v":1,"childrenPages":[]}

getReturn a Company


Path Params

id:
string
A company id
You can retrieve a company and all of its data. All activity fields are returned.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



You can retrieve a company and all of its data. All activity fields are returned.
{"_id":"56c27c39dbb166190042382f","user":"565416cace43aa21002b2566","body":"This call allows you to search for a company based on its name.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Search Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"result_type\",\n    \"1-0\": \"id\",\n    \"2-0\": \"name\",\n    \"3-0\": \"support_level_id\",\n    \"4-0\": \"support_level\",\n    \"5-0\": \"support_level_color\",\n    \"6-0\": \"email\",\n    \"7-0\": \"company_id\",\n    \"8-0\": \"active\",\n    \"0-1\": \"The search result type.  The value for this search will always return \\\"0\\\".\",\n    \"1-1\": \"The company id.\",\n    \"7-1\": \"The company id.\",\n    \"2-1\": \"The name of the returned company.\",\n    \"3-1\": \"The support level id of the company.\",\n    \"4-1\": \"The name of the support level of the found company.\",\n    \"5-1\": \"The support level color of the support level.\",\n    \"6-1\": \"Not relevant in this search result.\",\n    \"8-1\": \"Whether the company is active or not.\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]","editedParams":true,"excerpt":"","hidden":false,"link_url":"","order":2,"project":"565416f3ac09cc2100feb2d5","version":"565416f4ac09cc2100feb2d8","type":"get","category":"5658b1205a9e990d004a5cb6","createdAt":"2016-02-16T01:32:41.569Z","editedParams2":true,"githubsync":"","next":{"description":"","pages":[]},"sync_unique":"","title":"Search for Company by Name","api":{"auth":"required","examples":{"codes":[{"name":"jQuery","code":"var search_data = null;\nvar search_string = 'company one';\n\n$.ajax({\n    url: 'https://api.supportbench.net/search/company/' + encodeURIComponent(search_string),\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        search_data = jQuery.parseJSON(r);\n    }\n});","language":"javascript"}]},"method":"get","params":[{"in":"path","name":"term","ref":"","required":false,"type":"string","_id":"5658b15364950b0d00e78da8","default":"","desc":"A company name to search for"}],"results":{"codes":[{"code":"{\n    \"result_type\": \"0\", //will always return 0 for a company result\n    \"id\": \"CP-1000\",\n    \"name\": \"Company Name\",\n    \"support_level_id\": \"2\",\n    \"support_level\": \"Standard Support\",\n    \"support_level_color\": \"#fff\",\n    \"email\": \"\", //always will return empty\n    \"company_id\": \"CP-1000\",\n    \"active\": \"false\"\n}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","url":"/search/company/:terms"},"link_external":false,"slug":"search-for-company-by-name","__v":1,"isReference":true,"parentDoc":null,"updates":[],"childrenPages":[]}

getSearch for Company by Name


Path Params

term:
string
A company name to search for
This call allows you to search for a company based on its name. [block:api-header] { "type": "basic", "title": "Return Search Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Description", "0-0": "result_type", "1-0": "id", "2-0": "name", "3-0": "support_level_id", "4-0": "support_level", "5-0": "support_level_color", "6-0": "email", "7-0": "company_id", "8-0": "active", "0-1": "The search result type. The value for this search will always return \"0\".", "1-1": "The company id.", "7-1": "The company id.", "2-1": "The name of the returned company.", "3-1": "The support level id of the company.", "4-1": "The name of the support level of the found company.", "5-1": "The support level color of the support level.", "6-1": "Not relevant in this search result.", "8-1": "Whether the company is active or not." }, "cols": 2, "rows": 9 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



This call allows you to search for a company based on its name. [block:api-header] { "type": "basic", "title": "Return Search Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Description", "0-0": "result_type", "1-0": "id", "2-0": "name", "3-0": "support_level_id", "4-0": "support_level", "5-0": "support_level_color", "6-0": "email", "7-0": "company_id", "8-0": "active", "0-1": "The search result type. The value for this search will always return \"0\".", "1-1": "The company id.", "7-1": "The company id.", "2-1": "The name of the returned company.", "3-1": "The support level id of the company.", "4-1": "The name of the support level of the found company.", "5-1": "The support level color of the support level.", "6-1": "Not relevant in this search result.", "8-1": "Whether the company is active or not." }, "cols": 2, "rows": 9 } [/block]
{"_id":"5658fe0a8752730d0076243f","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"","auth":"required","params":[]},"category":"5658b1205a9e990d004a5cb6","createdAt":"2015-11-28T01:06:18.390Z","parentDoc":null,"title":"Company Object","type":"basic","updates":[],"__v":3,"excerpt":"","next":{"description":"","pages":[]},"slug":"company-object","sync_unique":"","version":"565416f4ac09cc2100feb2d8","body":"The company object is returned when returning a single company or querying for companies.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id_prefix\",\n    \"1-0\": \"id\",\n    \"2-0\": \"name\",\n    \"3-0\": \"address\",\n    \"4-0\": \"city\",\n    \"5-0\": \"zip\",\n    \"6-0\": \"state\",\n    \"8-0\": \"country\",\n    \"10-0\": \"support_level_id\",\n    \"11-0\": \"support_level\",\n    \"12-0\": \"active\",\n    \"13-0\": \"fields\",\n    \"14-0\": \"modified\",\n    \"15-0\": \"created\",\n    \"0-1\": \"The prefix of the id.\",\n    \"1-1\": \"The company id with the prefix.\",\n    \"2-1\": \"The company name.\",\n    \"3-1\": \"The mailing address of the company.\",\n    \"4-1\": \"The city the company resides in.\",\n    \"5-1\": \"The zip or postal code of the company.\",\n    \"6-1\": \"The state or province of the company.\",\n    \"8-1\": \"The full country name.\",\n    \"10-1\": \"The support level id.\",\n    \"11-1\": \"The support level name.\",\n    \"12-1\": \"The active state of the company.\",\n    \"13-1\": \"A field array of custom fields.\",\n    \"14-1\": \"The last date the company was modified.\",\n    \"15-1\": \"The date the company was created in the system.\",\n    \"7-0\": \"state_code\",\n    \"7-1\": \"The state or province 2 digit code (if applicable).\",\n    \"9-0\": \"country_code\",\n    \"9-1\": \"The 2 character ISO country code of the company. i.e. US, CA. Country code can be found here: https://countrycode.org/\"\n  },\n  \"cols\": 2,\n  \"rows\": 16\n}\n[/block]","hidden":false,"link_url":"","githubsync":"","isReference":true,"link_external":false,"order":3,"project":"565416f3ac09cc2100feb2d5","user":"565416cace43aa21002b2566","childrenPages":[]}

Company Object


The company object is returned when returning a single company or querying for companies. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id_prefix", "1-0": "id", "2-0": "name", "3-0": "address", "4-0": "city", "5-0": "zip", "6-0": "state", "8-0": "country", "10-0": "support_level_id", "11-0": "support_level", "12-0": "active", "13-0": "fields", "14-0": "modified", "15-0": "created", "0-1": "The prefix of the id.", "1-1": "The company id with the prefix.", "2-1": "The company name.", "3-1": "The mailing address of the company.", "4-1": "The city the company resides in.", "5-1": "The zip or postal code of the company.", "6-1": "The state or province of the company.", "8-1": "The full country name.", "10-1": "The support level id.", "11-1": "The support level name.", "12-1": "The active state of the company.", "13-1": "A field array of custom fields.", "14-1": "The last date the company was modified.", "15-1": "The date the company was created in the system.", "7-0": "state_code", "7-1": "The state or province 2 digit code (if applicable).", "9-0": "country_code", "9-1": "The 2 character ISO country code of the company. i.e. US, CA. Country code can be found here: https://countrycode.org/" }, "cols": 2, "rows": 16 } [/block]
The company object is returned when returning a single company or querying for companies. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id_prefix", "1-0": "id", "2-0": "name", "3-0": "address", "4-0": "city", "5-0": "zip", "6-0": "state", "8-0": "country", "10-0": "support_level_id", "11-0": "support_level", "12-0": "active", "13-0": "fields", "14-0": "modified", "15-0": "created", "0-1": "The prefix of the id.", "1-1": "The company id with the prefix.", "2-1": "The company name.", "3-1": "The mailing address of the company.", "4-1": "The city the company resides in.", "5-1": "The zip or postal code of the company.", "6-1": "The state or province of the company.", "8-1": "The full country name.", "10-1": "The support level id.", "11-1": "The support level name.", "12-1": "The active state of the company.", "13-1": "A field array of custom fields.", "14-1": "The last date the company was modified.", "15-1": "The date the company was created in the system.", "7-0": "state_code", "7-1": "The state or province 2 digit code (if applicable).", "9-0": "country_code", "9-1": "The 2 character ISO country code of the company. i.e. US, CA. Country code can be found here: https://countrycode.org/" }, "cols": 2, "rows": 16 } [/block]
{"_id":"565f8cefde5dc50d00acfeff","createdAt":"2015-12-03T00:29:35.973Z","hidden":false,"isReference":true,"link_url":"","slug":"fields-object-2-1","type":"basic","version":"565416f4ac09cc2100feb2d8","category":"5658b1205a9e990d004a5cb6","link_external":false,"next":{"description":"","pages":[]},"parentDoc":null,"sync_unique":"","body":"The custom fields object returned within the fields property from the company object.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"The id of the custom field.\",\n    \"2-0\": \"value\",\n    \"2-1\": \"The value of the field. This could be a Boolean, name of a field item, or content depending on the field type.\",\n    \"1-0\": \"name\",\n    \"1-1\": \"The field display name.\",\n    \"4-0\": \"type_id\",\n    \"4-1\": \"The type id of the field.  Each type will have a unique id assigned.\",\n    \"5-0\": \"type\",\n    \"5-1\": \"The type name of the field. i.e. dropdown, checkbox, textbox, etc ..\",\n    \"3-0\": \"value_id\",\n    \"3-1\": \"If this was a list item, will return the id of that field list item.\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]","order":4,"project":"565416f3ac09cc2100feb2d5","updates":[],"user":"565416cace43aa21002b2566","__v":4,"api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"excerpt":"","githubsync":"","title":"Field Object","childrenPages":[]}

Field Object


The custom fields object returned within the fields property from the company object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The id of the custom field.", "2-0": "value", "2-1": "The value of the field. This could be a Boolean, name of a field item, or content depending on the field type.", "1-0": "name", "1-1": "The field display name.", "4-0": "type_id", "4-1": "The type id of the field. Each type will have a unique id assigned.", "5-0": "type", "5-1": "The type name of the field. i.e. dropdown, checkbox, textbox, etc ..", "3-0": "value_id", "3-1": "If this was a list item, will return the id of that field list item." }, "cols": 2, "rows": 6 } [/block]
The custom fields object returned within the fields property from the company object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The id of the custom field.", "2-0": "value", "2-1": "The value of the field. This could be a Boolean, name of a field item, or content depending on the field type.", "1-0": "name", "1-1": "The field display name.", "4-0": "type_id", "4-1": "The type id of the field. Each type will have a unique id assigned.", "5-0": "type", "5-1": "The type name of the field. i.e. dropdown, checkbox, textbox, etc ..", "3-0": "value_id", "3-1": "If this was a list item, will return the id of that field list item." }, "cols": 2, "rows": 6 } [/block]
{"_id":"582cd33d5acf7e25006c08b6","category":"5658b1205a9e990d004a5cb6","link_external":false,"link_url":"","project":"565416f3ac09cc2100feb2d5","user":"565416cace43aa21002b2566","excerpt":"","githubsync":"","hidden":false,"next":{"description":"","pages":[]},"parentDoc":null,"slug":"search-for-customer","sync_unique":"","version":"565416f4ac09cc2100feb2d8","body":"This call allows you to search for a contact based on their name or email address.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Search Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"result_type\",\n    \"1-0\": \"id\",\n    \"2-0\": \"name\",\n    \"3-0\": \"support_level_id\",\n    \"4-0\": \"support_level\",\n    \"5-0\": \"support_level_color\",\n    \"6-0\": \"email\",\n    \"7-0\": \"company_id\",\n    \"8-0\": \"active\",\n    \"0-1\": \"The search result type. \\n\\n0 = Company result\\n1 = Contact result\",\n    \"1-1\": \"The contact or company id.\",\n    \"7-1\": \"The company id.\",\n    \"2-1\": \"The name of the returned contact or company.\",\n    \"3-1\": \"The support level id of the contact or company.\",\n    \"4-1\": \"The name of the support level of the found contact or company.\",\n    \"5-1\": \"The support level color of the support level.\",\n    \"6-1\": \"The email address of the contact if the result is one.\",\n    \"8-1\": \"Whether the contact or company is active or not.\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]","createdAt":"2016-11-16T21:44:29.580Z","isReference":true,"order":5,"updates":[],"__v":0,"api":{"settings":"","url":"/search/customers/:terms","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var search_data = null;\nvar search_string = 'Jack';\n\n$.ajax({\n    url: 'https://api.supportbench.net/search/customers/' + encodeURIComponent(search_string),\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        search_data = jQuery.parseJSON(r);\n    }\n});","language":"javascript"}]},"method":"get","params":[{"name":"term","_id":"5658b15364950b0d00e78da8","ref":"","in":"path","required":false,"desc":"A contact name or email to search for","default":"","type":"string"}],"results":{"codes":[{"status":200,"language":"json","code":"[{\n    \"result_type\": \"1\", //will always return 1 for a contact result\n    \"id\": \"CT-1000\",\n    \"name\": \"Jack Crow\",\n    \"support_level_id\": \"2\",\n    \"support_level\": \"Standard Support\",\n    \"support_level_color\": \"#fff\",\n    \"email\": \"jcrow@domain.com\", \n    \"company_id\": \"CP-1000\",   \n    \"company_name\": \"Jack Industries Inc.\",\n    \"active\": \"true\"\n},\n {\n    \"result_type\": \"2\", //will always return 2 for a company result\n    \"id\": \"CP-1000\",\n    \"name\": \"Jack Industries Inc.\",\n    \"support_level_id\": \"2\",\n    \"support_level\": \"Standard Support\",\n    \"support_level_color\": \"#fff\",\n    \"email\": \"\",\n    \"company_id\": \"CP-1000\",\n    \"company_name\": \"Jack Industries Inc.\",\n    \"active\": \"true\"\n}]","name":""},{"status":400,"language":"json","code":"{}","name":""}]}},"title":"Search for Customer","type":"get","childrenPages":[]}

getSearch for Customer


Path Params

term:
string
A contact name or email to search for
This call allows you to search for a contact based on their name or email address. [block:api-header] { "type": "basic", "title": "Return Search Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Description", "0-0": "result_type", "1-0": "id", "2-0": "name", "3-0": "support_level_id", "4-0": "support_level", "5-0": "support_level_color", "6-0": "email", "7-0": "company_id", "8-0": "active", "0-1": "The search result type. \n\n0 = Company result\n1 = Contact result", "1-1": "The contact or company id.", "7-1": "The company id.", "2-1": "The name of the returned contact or company.", "3-1": "The support level id of the contact or company.", "4-1": "The name of the support level of the found contact or company.", "5-1": "The support level color of the support level.", "6-1": "The email address of the contact if the result is one.", "8-1": "Whether the contact or company is active or not." }, "cols": 2, "rows": 9 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



This call allows you to search for a contact based on their name or email address. [block:api-header] { "type": "basic", "title": "Return Search Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Description", "0-0": "result_type", "1-0": "id", "2-0": "name", "3-0": "support_level_id", "4-0": "support_level", "5-0": "support_level_color", "6-0": "email", "7-0": "company_id", "8-0": "active", "0-1": "The search result type. \n\n0 = Company result\n1 = Contact result", "1-1": "The contact or company id.", "7-1": "The company id.", "2-1": "The name of the returned contact or company.", "3-1": "The support level id of the contact or company.", "4-1": "The name of the support level of the found contact or company.", "5-1": "The support level color of the support level.", "6-1": "The email address of the contact if the result is one.", "8-1": "Whether the contact or company is active or not." }, "cols": 2, "rows": 9 } [/block]
{"_id":"565f515cbca87d0d006bc6fb","category":"565f4a30649b951900c8978f","excerpt":"","link_external":false,"parentDoc":null,"type":"post","updates":[],"__v":4,"api":{"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\"id\":\"CT-1000\"}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/contact","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var contact_id = null;\nvar contact_data = {\n  \t\"id_prefix\":\"CT\", //not required for contact updates\n    \"id_source\":\"12345\", //not required for updates, only if you want to customize your id\n  \t\"id\":\"CT-1000\", //required for contact updates, omit of null value to create a new contact\n    \"company_id\":\"CP-1000\",\n    \"first_name\": \"Jake\", //required for contact creations\n    \"last_name\": \"Jones\", //required for contact creations\n    \"title\": \"CEO\",\n    \"address\": \"123 Fake Street\",\n    \"city\": \"Los Angeles\",\n    \"zip\": \"90210\", \n    \"state\": \"CA\",\n    \"country\": \"USA\",\n    \"email\": \"jake.jones@mydomain.com\",\n  \t\"phone\": null,\n    \"phone_ext\": null,\n    \"mobile\": null,\n    \"active\": 1,\n    \"fields\": [{\n        'id': 10,\n        'value': '1234567890'\n    }, {\n        'id': 11,\n        'value': true\n    }]\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/contact',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(contact_data),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        contact_id = jQuery.parseJSON(r).id;\n    }\n});","language":"javascript"}]},"method":"post"},"isReference":true,"link_url":"","order":0,"sync_unique":"","version":"565416f4ac09cc2100feb2d8","createdAt":"2015-12-02T20:15:24.109Z","githubsync":"","user":"565416cace43aa21002b2566","title":"Create / Update Contact","project":"565416f3ac09cc2100feb2d5","slug":"create-update-contact","body":"Creating and updating a contact from the API can be done by posting your contact object to Supportbench. \n\nThe only difference between contact creations and updates is including a contact id within the contact object.\n\nWhen creating or updating a contact, the below fields are available to you.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Availability\",\n    \"0-0\": \"id_prefix\",\n    \"2-0\": \"id\",\n    \"7-0\": \"address\",\n    \"8-0\": \"city\",\n    \"9-0\": \"zip\",\n    \"10-0\": \"state\",\n    \"11-0\": \"country\",\n    \"12-0\": \"email\",\n    \"16-0\": \"active\",\n    \"17-0\": \"fields\",\n    \"0-1\": \"no\",\n    \"2-1\": \"no - when creating \\nyes - when updating\",\n    \"0-2\": \"5 characters\",\n    \"0-3\": \"\\\"CT\\\"\",\n    \"2-3\": \"-\",\n    \"0-4\": \"New\",\n    \"2-4\": \"Update\",\n    \"2-2\": \"30 characters\",\n    \"7-1\": \"no\",\n    \"8-1\": \"no\",\n    \"9-1\": \"no\",\n    \"10-1\": \"no\",\n    \"11-1\": \"no\",\n    \"12-1\": \"no\",\n    \"16-1\": \"no\",\n    \"17-1\": \"no\",\n    \"7-2\": \"250 characters\",\n    \"8-2\": \"100 characters\",\n    \"9-2\": \"25 characters\",\n    \"10-2\": \"50 characters\",\n    \"11-2\": \"5 characters\",\n    \"12-2\": \"500 characters\",\n    \"16-2\": \"Boolean\",\n    \"17-2\": \"See field object\",\n    \"7-3\": \"-\",\n    \"8-3\": \"-\",\n    \"9-3\": \"-\",\n    \"10-3\": \"-\",\n    \"11-3\": \"-\",\n    \"12-3\": \"-\",\n    \"16-3\": \"-\",\n    \"17-3\": \"-\",\n    \"7-4\": \"New / Update\",\n    \"8-4\": \"New / Update\",\n    \"9-4\": \"New / Update\",\n    \"10-4\": \"New / Update\",\n    \"11-4\": \"New / Update\",\n    \"12-4\": \"New / Update\",\n    \"16-4\": \"New / Update\",\n    \"17-4\": \"New / Update\",\n    \"h-5\": \"Summary\",\n    \"2-5\": \"The full company id including the prefix.\",\n    \"0-5\": \"The prefix of the company. You can assign new contact prefix's within the API administration section.\",\n    \"7-5\": \"The mailing address of the company.\",\n    \"8-5\": \"The mailing city of the company.\",\n    \"9-5\": \"The mailing zip / postal code of the company.\",\n    \"10-5\": \"The mailing state or province of the company.\",\n    \"12-5\": \"The primary email address of the user.\",\n    \"11-5\": \"The 2 character ISO country code of the company. i.e. US, CA. Country code can be found here: [https://countrycode.org/](https://countrycode.org/)\",\n    \"16-5\": \"Is the company active or not.\",\n    \"17-5\": \"A field array of custom fields to insert or update. Please see the field object below.\",\n    \"3-0\": \"company_id\",\n    \"3-1\": \"no\",\n    \"3-2\": \"30 characters\",\n    \"3-3\": \"-\",\n    \"3-4\": \"New / Update\",\n    \"3-5\": \"The company id to assign to this company.\",\n    \"4-0\": \"first_name\",\n    \"5-1\": \"**yes**\",\n    \"4-1\": \"**yes**\",\n    \"5-0\": \"last_name\",\n    \"4-2\": \"250 characters\",\n    \"5-2\": \"250 characters\",\n    \"4-3\": \"-\",\n    \"4-4\": \"New / Update\",\n    \"5-4\": \"New / Update\",\n    \"5-3\": \"-\",\n    \"4-5\": \"The contact's first name.\",\n    \"5-5\": \"The contact's last name.\",\n    \"6-0\": \"title\",\n    \"6-1\": \"no\",\n    \"6-2\": \"100 characters\",\n    \"6-3\": \"-\",\n    \"6-4\": \"New / Update\",\n    \"6-5\": \"The job title of the contact.\",\n    \"13-0\": \"phone\",\n    \"14-0\": \"phone_ext\",\n    \"15-0\": \"mobile\",\n    \"13-1\": \"no\",\n    \"14-1\": \"no\",\n    \"15-1\": \"no\",\n    \"13-2\": \"50 characters\",\n    \"14-2\": \"50 characters\",\n    \"15-2\": \"10 characters\",\n    \"13-3\": \"-\",\n    \"14-3\": \"-\",\n    \"15-3\": \"-\",\n    \"13-4\": \"New / Update\",\n    \"14-4\": \"New / Update\",\n    \"15-4\": \"New / Update\",\n    \"13-5\": \"The primary phone number of the contact.\",\n    \"14-5\": \"The extension of the primary phone number of the contact.\",\n    \"15-5\": \"The primary mobile / cell number of the contact.\",\n    \"1-0\": \"id_source\",\n    \"1-1\": \"no\",\n    \"1-2\": \"25 characters\",\n    \"1-3\": \"-\",\n    \"1-4\": \"New\",\n    \"1-5\": \"The source id of the contact. You can assign custom ID's from existing systems or assign your own id.\"\n  },\n  \"cols\": 6,\n  \"rows\": 18\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Field Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"**yes**\",\n    \"0-2\": \"Integer\",\n    \"0-3\": \"-\",\n    \"0-4\": \"The field id of the field you wish to update.  The field id must map to a valid field in the contact.\",\n    \"1-0\": \"value\",\n    \"1-1\": \"**yes**\",\n    \"1-2\": \"Dropdown list - Integer\\nCheckbox - Boolean\\nText box - Unlimited\",\n    \"1-3\": \"-\",\n    \"1-4\": \"The value of the custom field.  The value is dependent on the field type.\"\n  },\n  \"cols\": 5,\n  \"rows\": 2\n}\n[/block]","hidden":false,"childrenPages":[]}

postCreate / Update Contact


Creating and updating a contact from the API can be done by posting your contact object to Supportbench. The only difference between contact creations and updates is including a contact id within the contact object. When creating or updating a contact, the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "id_prefix", "2-0": "id", "7-0": "address", "8-0": "city", "9-0": "zip", "10-0": "state", "11-0": "country", "12-0": "email", "16-0": "active", "17-0": "fields", "0-1": "no", "2-1": "no - when creating \nyes - when updating", "0-2": "5 characters", "0-3": "\"CT\"", "2-3": "-", "0-4": "New", "2-4": "Update", "2-2": "30 characters", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "11-1": "no", "12-1": "no", "16-1": "no", "17-1": "no", "7-2": "250 characters", "8-2": "100 characters", "9-2": "25 characters", "10-2": "50 characters", "11-2": "5 characters", "12-2": "500 characters", "16-2": "Boolean", "17-2": "See field object", "7-3": "-", "8-3": "-", "9-3": "-", "10-3": "-", "11-3": "-", "12-3": "-", "16-3": "-", "17-3": "-", "7-4": "New / Update", "8-4": "New / Update", "9-4": "New / Update", "10-4": "New / Update", "11-4": "New / Update", "12-4": "New / Update", "16-4": "New / Update", "17-4": "New / Update", "h-5": "Summary", "2-5": "The full company id including the prefix.", "0-5": "The prefix of the company. You can assign new contact prefix's within the API administration section.", "7-5": "The mailing address of the company.", "8-5": "The mailing city of the company.", "9-5": "The mailing zip / postal code of the company.", "10-5": "The mailing state or province of the company.", "12-5": "The primary email address of the user.", "11-5": "The 2 character ISO country code of the company. i.e. US, CA. Country code can be found here: [https://countrycode.org/](https://countrycode.org/)", "16-5": "Is the company active or not.", "17-5": "A field array of custom fields to insert or update. Please see the field object below.", "3-0": "company_id", "3-1": "no", "3-2": "30 characters", "3-3": "-", "3-4": "New / Update", "3-5": "The company id to assign to this company.", "4-0": "first_name", "5-1": "**yes**", "4-1": "**yes**", "5-0": "last_name", "4-2": "250 characters", "5-2": "250 characters", "4-3": "-", "4-4": "New / Update", "5-4": "New / Update", "5-3": "-", "4-5": "The contact's first name.", "5-5": "The contact's last name.", "6-0": "title", "6-1": "no", "6-2": "100 characters", "6-3": "-", "6-4": "New / Update", "6-5": "The job title of the contact.", "13-0": "phone", "14-0": "phone_ext", "15-0": "mobile", "13-1": "no", "14-1": "no", "15-1": "no", "13-2": "50 characters", "14-2": "50 characters", "15-2": "10 characters", "13-3": "-", "14-3": "-", "15-3": "-", "13-4": "New / Update", "14-4": "New / Update", "15-4": "New / Update", "13-5": "The primary phone number of the contact.", "14-5": "The extension of the primary phone number of the contact.", "15-5": "The primary mobile / cell number of the contact.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the contact. You can assign custom ID's from existing systems or assign your own id." }, "cols": 6, "rows": 18 } [/block] [block:api-header] { "type": "basic", "title": "Field Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the contact.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Creating and updating a contact from the API can be done by posting your contact object to Supportbench. The only difference between contact creations and updates is including a contact id within the contact object. When creating or updating a contact, the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "id_prefix", "2-0": "id", "7-0": "address", "8-0": "city", "9-0": "zip", "10-0": "state", "11-0": "country", "12-0": "email", "16-0": "active", "17-0": "fields", "0-1": "no", "2-1": "no - when creating \nyes - when updating", "0-2": "5 characters", "0-3": "\"CT\"", "2-3": "-", "0-4": "New", "2-4": "Update", "2-2": "30 characters", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "11-1": "no", "12-1": "no", "16-1": "no", "17-1": "no", "7-2": "250 characters", "8-2": "100 characters", "9-2": "25 characters", "10-2": "50 characters", "11-2": "5 characters", "12-2": "500 characters", "16-2": "Boolean", "17-2": "See field object", "7-3": "-", "8-3": "-", "9-3": "-", "10-3": "-", "11-3": "-", "12-3": "-", "16-3": "-", "17-3": "-", "7-4": "New / Update", "8-4": "New / Update", "9-4": "New / Update", "10-4": "New / Update", "11-4": "New / Update", "12-4": "New / Update", "16-4": "New / Update", "17-4": "New / Update", "h-5": "Summary", "2-5": "The full company id including the prefix.", "0-5": "The prefix of the company. You can assign new contact prefix's within the API administration section.", "7-5": "The mailing address of the company.", "8-5": "The mailing city of the company.", "9-5": "The mailing zip / postal code of the company.", "10-5": "The mailing state or province of the company.", "12-5": "The primary email address of the user.", "11-5": "The 2 character ISO country code of the company. i.e. US, CA. Country code can be found here: [https://countrycode.org/](https://countrycode.org/)", "16-5": "Is the company active or not.", "17-5": "A field array of custom fields to insert or update. Please see the field object below.", "3-0": "company_id", "3-1": "no", "3-2": "30 characters", "3-3": "-", "3-4": "New / Update", "3-5": "The company id to assign to this company.", "4-0": "first_name", "5-1": "**yes**", "4-1": "**yes**", "5-0": "last_name", "4-2": "250 characters", "5-2": "250 characters", "4-3": "-", "4-4": "New / Update", "5-4": "New / Update", "5-3": "-", "4-5": "The contact's first name.", "5-5": "The contact's last name.", "6-0": "title", "6-1": "no", "6-2": "100 characters", "6-3": "-", "6-4": "New / Update", "6-5": "The job title of the contact.", "13-0": "phone", "14-0": "phone_ext", "15-0": "mobile", "13-1": "no", "14-1": "no", "15-1": "no", "13-2": "50 characters", "14-2": "50 characters", "15-2": "10 characters", "13-3": "-", "14-3": "-", "15-3": "-", "13-4": "New / Update", "14-4": "New / Update", "15-4": "New / Update", "13-5": "The primary phone number of the contact.", "14-5": "The extension of the primary phone number of the contact.", "15-5": "The primary mobile / cell number of the contact.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the contact. You can assign custom ID's from existing systems or assign your own id." }, "cols": 6, "rows": 18 } [/block] [block:api-header] { "type": "basic", "title": "Field Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the contact.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]
{"_id":"565f4b320dc99e1900f24c1e","project":"565416f3ac09cc2100feb2d5","slug":"retrieve-a-contact","user":"565416cace43aa21002b2566","body":"You can retrieve a contact and all of its data.  All contact fields are returned.","link_external":false,"parentDoc":null,"editedParams":true,"excerpt":"","githubsync":"","next":{"description":"","pages":[]},"sync_unique":"","api":{"params":[{"required":false,"type":"string","_id":"5658b15364950b0d00e78da8","default":"","desc":"A contact id","in":"path","name":"id","ref":""}],"results":{"codes":[{"code":"{\n    \"id_prefix\": \"CT\",\n    \"id\": \"CT-1000\",\n    \"company_id\": \"CP-1000\",\n    \"company_name\": \"Company Name\",\n    \"support_level_id\": 1,\n    \"support_level\": \"Standard\",\n    \"first_name\": \"Joe\",\n    \"last_name\": \"Jones\",\n    \"full_name\": \"Jow Jones\",\n  \t\"title\": \"CEO\",\n    \"address\": \"525 S. Lexington Ave\",\n    \"city\": \"Los Angeles\",\n    \"zip\": \"90210\",\n    \"state\": \"California\",\n    \"state_code\": \"CA\",\n    \"country\": \"United States\",\n    \"country_code\": \"US\",\n    \"email\": \"joe@joe.com\",\n    \"phone\": \"\",\n    \"mobile\": \"\",\n    \"phone_ext\": \"\",\n    \"active\": false,\n    \"fields\": [],\n    \"modified\": \"Jun 20 2015  8:02PM\",\n    \"created\": \"Jun 4 2015  9:28PM\"\n}","language":"json","status":200,"name":""},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/contact/:id","auth":"required","examples":{"codes":[{"language":"javascript","code":"var contact_data = null;\nvar contact_id = 'CT-1000';\n\n$.ajax({\n    url: 'https://api.supportbench.net/contact/' + contact_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        contact_data = r;\n        alert(contact_data.id);\n    }\n});","name":"jQuery"}]},"method":"get"},"category":"565f4a30649b951900c8978f","type":"get","isReference":true,"link_url":"","order":1,"version":"565416f4ac09cc2100feb2d8","__v":1,"editedParams2":true,"hidden":false,"createdAt":"2015-12-02T19:49:06.620Z","title":"Return a Contact","updates":[],"childrenPages":[]}

getReturn a Contact


Path Params

id:
string
A contact id
You can retrieve a contact and all of its data. All contact fields are returned.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



You can retrieve a contact and all of its data. All contact fields are returned.
{"_id":"56c2cd9b3c81ca0d008c8a5e","parentDoc":null,"type":"get","__v":1,"editedParams2":true,"excerpt":"","githubsync":"","next":{"pages":[],"description":""},"order":2,"project":"565416f3ac09cc2100feb2d5","user":"565416cace43aa21002b2566","body":"This call allows you to search for a contact based on their name or email address.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Return Search Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"result_type\",\n    \"1-0\": \"id\",\n    \"2-0\": \"name\",\n    \"3-0\": \"support_level_id\",\n    \"4-0\": \"support_level\",\n    \"5-0\": \"support_level_color\",\n    \"6-0\": \"email\",\n    \"7-0\": \"company_id\",\n    \"8-0\": \"active\",\n    \"0-1\": \"The search result type.  The value for this search will always return \\\"1\\\".\",\n    \"1-1\": \"The contact id.\",\n    \"7-1\": \"The company id.\",\n    \"2-1\": \"The name of the returned contact.\",\n    \"3-1\": \"The support level id of the contact.\",\n    \"4-1\": \"The name of the support level of the found contact.\",\n    \"5-1\": \"The support level color of the support level.\",\n    \"6-1\": \"The email address of the contact.\",\n    \"8-1\": \"Whether the contact is active or not.\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]","category":"565f4a30649b951900c8978f","editedParams":true,"link_external":false,"updates":[],"api":{"method":"get","params":[{"default":"","desc":"A contact name or email to search for","in":"path","name":"term","ref":"","required":false,"type":"string","_id":"5658b15364950b0d00e78da8"}],"results":{"codes":[{"code":"{\n    \"result_type\": \"1\", //will always return 1 for a contact result\n    \"id\": \"CT-1000\",\n    \"name\": \"John Crow\",\n    \"support_level_id\": \"2\",\n    \"support_level\": \"Standard Support\",\n    \"support_level_color\": \"#fff\",\n    \"email\": \"jcrow@domain.com\", //always will return empty\n    \"company_id\": \"CP-1000\",\n    \"active\": \"false\"\n}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/search/company/:terms","auth":"required","examples":{"codes":[{"code":"var search_data = null;\nvar search_string = 'Jack Crow';\n\n$.ajax({\n    url: 'https://api.supportbench.net/search/contact/' + encodeURIComponent(search_string),\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        search_data = jQuery.parseJSON(r);\n    }\n});","language":"javascript","name":"jQuery"}]}},"hidden":false,"sync_unique":"","title":"Search for Contact by Name","version":"565416f4ac09cc2100feb2d8","createdAt":"2016-02-16T07:19:55.857Z","isReference":true,"link_url":"","slug":"search-for-contact-by-name","childrenPages":[]}

getSearch for Contact by Name


Path Params

term:
string
A contact name or email to search for
This call allows you to search for a contact based on their name or email address. [block:api-header] { "type": "basic", "title": "Return Search Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Description", "0-0": "result_type", "1-0": "id", "2-0": "name", "3-0": "support_level_id", "4-0": "support_level", "5-0": "support_level_color", "6-0": "email", "7-0": "company_id", "8-0": "active", "0-1": "The search result type. The value for this search will always return \"1\".", "1-1": "The contact id.", "7-1": "The company id.", "2-1": "The name of the returned contact.", "3-1": "The support level id of the contact.", "4-1": "The name of the support level of the found contact.", "5-1": "The support level color of the support level.", "6-1": "The email address of the contact.", "8-1": "Whether the contact is active or not." }, "cols": 2, "rows": 9 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



This call allows you to search for a contact based on their name or email address. [block:api-header] { "type": "basic", "title": "Return Search Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Description", "0-0": "result_type", "1-0": "id", "2-0": "name", "3-0": "support_level_id", "4-0": "support_level", "5-0": "support_level_color", "6-0": "email", "7-0": "company_id", "8-0": "active", "0-1": "The search result type. The value for this search will always return \"1\".", "1-1": "The contact id.", "7-1": "The company id.", "2-1": "The name of the returned contact.", "3-1": "The support level id of the contact.", "4-1": "The name of the support level of the found contact.", "5-1": "The support level color of the support level.", "6-1": "The email address of the contact.", "8-1": "Whether the contact is active or not." }, "cols": 2, "rows": 9 } [/block]
{"_id":"56e202b826a9f20e00bde20c","hidden":false,"sync_unique":"","type":"get","__v":0,"createdAt":"2016-03-10T23:26:48.492Z","title":"Company Contacts","githubsync":"","link_url":"","parentDoc":null,"api":{"params":[{"ref":"","required":false,"desc":"The company id of the company contacts to return","default":"","type":"string","name":"company_id","in":"path","_id":"5658b15364950b0d00e78da8"}],"results":{"codes":[{"status":200,"language":"json","code":"[{\n    \"id_prefix\": \"CT\",\n    \"id\": \"CT-1000\",\n    \"company_id\": \"CP-1000\",\n    \"company_name\": \"Company Name\",\n    \"support_level_id\": 1,\n    \"support_level\": \"Standard\",\n    \"first_name\": \"Joe\",\n    \"last_name\": \"Jones\",\n    \"full_name\": \"Jow Jones\",\n  \t\"title\": \"CEO\",\n    \"address\": \"525 S. Lexington Ave\",\n    \"city\": \"Los Angeles\",\n    \"zip\": \"90210\",\n    \"state\": \"CA\",\n    \"country\": \"USA\",\n    \"email\": \"Jow@company.com\",\n    \"phone\": \"\",\n    \"mobile\": \"\",\n    \"phone_ext\": \"\",\n    \"active\": true,\n    \"fields\": [],\n    \"modified\": \"Jun 20 2015  8:02PM\",\n    \"created\": \"Jun 4 2015  9:28PM\"\n},\n {\n    \"id_prefix\": \"CT\",\n    \"id\": \"CT-1001\",\n    \"company_id\": \"CP-1000\",\n    \"company_name\": \"Company Name\",\n    \"support_level_id\": 1,\n    \"support_level\": \"Standard\",\n    \"first_name\": \"Jane\",\n    \"last_name\": \"Doe\",\n    \"full_name\": \"Jane Dow\",\n  \t\"title\": \"CTO\",\n    \"address\": \"525 S. Lexington Ave\",\n    \"city\": \"Los Angeles\",\n    \"zip\": \"90210\",\n    \"state\": \"CA\",\n    \"country\": \"USA\",\n    \"email\": \"jane@company.com\",\n    \"phone\": \"\",\n    \"mobile\": \"\",\n    \"phone_ext\": \"\",\n    \"active\": true,\n    \"fields\": [],\n    \"modified\": \"Jun 21 2015  8:00PM\",\n    \"created\": \"Jun 6 2015  9:00PM\"\n}]","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/company/contacts/:company_id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var list_data = null;\nvar company_id = 'CP-1';\n\n$.ajax({\n    url: 'https://api.supportbench.net/company/contacts/' + company_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        list_data = jQuery.parseJSON(r);\n    }\n});","language":"javascript"}]},"method":"get"},"category":"565f4a30649b951900c8978f","editedParams2":true,"excerpt":"","isReference":true,"link_external":false,"order":3,"project":"565416f3ac09cc2100feb2d5","body":"You can retrieve a list of contacts and all of its data based for a particular company.","editedParams":true,"user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","slug":"company-contacts","updates":[],"childrenPages":[]}

getCompany Contacts


Path Params

company_id:
string
The company id of the company contacts to return
You can retrieve a list of contacts and all of its data based for a particular company.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



You can retrieve a list of contacts and all of its data based for a particular company.
{"_id":"565f4c54649b951900c8979d","user":"565416cace43aa21002b2566","category":"565f4a30649b951900c8978f","link_url":"","order":4,"slug":"contact-object","type":"basic","__v":2,"createdAt":"2015-12-02T19:53:56.818Z","excerpt":"","githubsync":"","isReference":true,"next":{"description":"","pages":[]},"parentDoc":null,"version":"565416f4ac09cc2100feb2d8","project":"565416f3ac09cc2100feb2d5","sync_unique":"","title":"Contact Object","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"The contact object is returned when returning a single contact or querying for contacts.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id_prefix\",\n    \"1-0\": \"id\",\n    \"8-0\": \"full_name\",\n    \"10-0\": \"address\",\n    \"11-0\": \"city\",\n    \"12-0\": \"zip\",\n    \"13-0\": \"state\",\n    \"15-0\": \"country\",\n    \"21-0\": \"active\",\n    \"22-0\": \"fields\",\n    \"23-0\": \"modified\",\n    \"24-0\": \"created\",\n    \"0-1\": \"The prefix of the id.\",\n    \"1-1\": \"The contact id with the prefix.\",\n    \"8-1\": \"The company name.\",\n    \"10-1\": \"The mailing address of the contact.\",\n    \"11-1\": \"The city the contact resides in.\",\n    \"12-1\": \"The zip or postal code of the contact.\",\n    \"13-1\": \"The state or province of the contact.\",\n    \"15-1\": \"The full country name of the contact.\",\n    \"21-1\": \"The active state of the contact.\",\n    \"22-1\": \"A field array of custom fields.\",\n    \"23-1\": \"The last date the company was modified.\",\n    \"24-1\": \"The date the company was created in the system.\",\n    \"2-0\": \"company_id\",\n    \"2-1\": \"The assigned company id of the contact.\",\n    \"3-0\": \"company\",\n    \"3-1\": \"The company name of the assigned company.\",\n    \"6-0\": \"first_name\",\n    \"6-1\": \"The first name of the contact.\",\n    \"7-0\": \"last_name\",\n    \"7-1\": \"The last name of the contact.\",\n    \"9-0\": \"title\",\n    \"9-1\": \"The job title.\",\n    \"17-0\": \"email\",\n    \"18-0\": \"phone\",\n    \"20-0\": \"phone_ext\",\n    \"19-0\": \"mobile\",\n    \"17-1\": \"The email address of the contact.\",\n    \"18-1\": \"The phone number of the contact.\",\n    \"19-1\": \"The mobile number of the contact.\",\n    \"20-1\": \"The phone number's extension.\",\n    \"4-0\": \"support_level_id\",\n    \"4-1\": \"The support level id of the assigned company.\",\n    \"5-1\": \"The support level name of the assigned company.\",\n    \"5-0\": \"support_level\",\n    \"14-0\": \"state_code\",\n    \"14-1\": \"The state or province 2 letter code of the contact (if applicable).\",\n    \"16-0\": \"country_code\",\n    \"16-1\": \"The 2 character ISO country code of the contact. i.e. US, CA. Country code can be found here: https://countrycode.org/\"\n  },\n  \"cols\": 2,\n  \"rows\": 25\n}\n[/block]","hidden":false,"link_external":false,"updates":[],"childrenPages":[]}

Contact Object


The contact object is returned when returning a single contact or querying for contacts. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id_prefix", "1-0": "id", "8-0": "full_name", "10-0": "address", "11-0": "city", "12-0": "zip", "13-0": "state", "15-0": "country", "21-0": "active", "22-0": "fields", "23-0": "modified", "24-0": "created", "0-1": "The prefix of the id.", "1-1": "The contact id with the prefix.", "8-1": "The company name.", "10-1": "The mailing address of the contact.", "11-1": "The city the contact resides in.", "12-1": "The zip or postal code of the contact.", "13-1": "The state or province of the contact.", "15-1": "The full country name of the contact.", "21-1": "The active state of the contact.", "22-1": "A field array of custom fields.", "23-1": "The last date the company was modified.", "24-1": "The date the company was created in the system.", "2-0": "company_id", "2-1": "The assigned company id of the contact.", "3-0": "company", "3-1": "The company name of the assigned company.", "6-0": "first_name", "6-1": "The first name of the contact.", "7-0": "last_name", "7-1": "The last name of the contact.", "9-0": "title", "9-1": "The job title.", "17-0": "email", "18-0": "phone", "20-0": "phone_ext", "19-0": "mobile", "17-1": "The email address of the contact.", "18-1": "The phone number of the contact.", "19-1": "The mobile number of the contact.", "20-1": "The phone number's extension.", "4-0": "support_level_id", "4-1": "The support level id of the assigned company.", "5-1": "The support level name of the assigned company.", "5-0": "support_level", "14-0": "state_code", "14-1": "The state or province 2 letter code of the contact (if applicable).", "16-0": "country_code", "16-1": "The 2 character ISO country code of the contact. i.e. US, CA. Country code can be found here: https://countrycode.org/" }, "cols": 2, "rows": 25 } [/block]
The contact object is returned when returning a single contact or querying for contacts. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id_prefix", "1-0": "id", "8-0": "full_name", "10-0": "address", "11-0": "city", "12-0": "zip", "13-0": "state", "15-0": "country", "21-0": "active", "22-0": "fields", "23-0": "modified", "24-0": "created", "0-1": "The prefix of the id.", "1-1": "The contact id with the prefix.", "8-1": "The company name.", "10-1": "The mailing address of the contact.", "11-1": "The city the contact resides in.", "12-1": "The zip or postal code of the contact.", "13-1": "The state or province of the contact.", "15-1": "The full country name of the contact.", "21-1": "The active state of the contact.", "22-1": "A field array of custom fields.", "23-1": "The last date the company was modified.", "24-1": "The date the company was created in the system.", "2-0": "company_id", "2-1": "The assigned company id of the contact.", "3-0": "company", "3-1": "The company name of the assigned company.", "6-0": "first_name", "6-1": "The first name of the contact.", "7-0": "last_name", "7-1": "The last name of the contact.", "9-0": "title", "9-1": "The job title.", "17-0": "email", "18-0": "phone", "20-0": "phone_ext", "19-0": "mobile", "17-1": "The email address of the contact.", "18-1": "The phone number of the contact.", "19-1": "The mobile number of the contact.", "20-1": "The phone number's extension.", "4-0": "support_level_id", "4-1": "The support level id of the assigned company.", "5-1": "The support level name of the assigned company.", "5-0": "support_level", "14-0": "state_code", "14-1": "The state or province 2 letter code of the contact (if applicable).", "16-0": "country_code", "16-1": "The 2 character ISO country code of the contact. i.e. US, CA. Country code can be found here: https://countrycode.org/" }, "cols": 2, "rows": 25 } [/block]
{"_id":"565f8d02bca87d0d006bc76b","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"category":"565f4a30649b951900c8978f","excerpt":"","hidden":false,"link_external":false,"__v":3,"createdAt":"2015-12-03T00:29:54.043Z","next":{"description":"","pages":[]},"parentDoc":null,"title":"Field Object","user":"565416cace43aa21002b2566","body":"The custom fields object returned within the fields property from the contact object.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"The id of the custom field.\",\n    \"2-0\": \"value\",\n    \"2-1\": \"The value of the field. This could be a Boolean, name of a field item, or content depending on the field type.\",\n    \"1-0\": \"name\",\n    \"1-1\": \"The field display name.\",\n    \"4-0\": \"type_id\",\n    \"4-1\": \"The type id of the field.  Each type will have a unique id assigned.\",\n    \"5-0\": \"type\",\n    \"5-1\": \"The type name of the field. i.e. dropdown, checkbox, textbox, etc ..\",\n    \"3-0\": \"value_id\",\n    \"3-1\": \"If this was a list item, will return the id of that field list item.\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]","isReference":true,"slug":"fields-object-2-2","sync_unique":"","githubsync":"","link_url":"","order":5,"project":"565416f3ac09cc2100feb2d5","type":"basic","updates":[],"version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

Field Object


The custom fields object returned within the fields property from the contact object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The id of the custom field.", "2-0": "value", "2-1": "The value of the field. This could be a Boolean, name of a field item, or content depending on the field type.", "1-0": "name", "1-1": "The field display name.", "4-0": "type_id", "4-1": "The type id of the field. Each type will have a unique id assigned.", "5-0": "type", "5-1": "The type name of the field. i.e. dropdown, checkbox, textbox, etc ..", "3-0": "value_id", "3-1": "If this was a list item, will return the id of that field list item." }, "cols": 2, "rows": 6 } [/block]
The custom fields object returned within the fields property from the contact object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The id of the custom field.", "2-0": "value", "2-1": "The value of the field. This could be a Boolean, name of a field item, or content depending on the field type.", "1-0": "name", "1-1": "The field display name.", "4-0": "type_id", "4-1": "The type id of the field. Each type will have a unique id assigned.", "5-0": "type", "5-1": "The type name of the field. i.e. dropdown, checkbox, textbox, etc ..", "3-0": "value_id", "3-1": "If this was a list item, will return the id of that field list item." }, "cols": 2, "rows": 6 } [/block]
{"_id":"565f8da0813aeb0d007b75ac","createdAt":"2015-12-03T00:32:32.052Z","link_external":false,"link_url":"","user":"565416cace43aa21002b2566","api":{"url":"/contact","auth":"required","examples":{"codes":[{"code":"var contact_id = null;\nvar contact_data = {\n  \t\"id_prefix\":\"CT\", //not required for contact updates\n    \"id_source\":\"12345\", //not required for updates, only if you want to customize your id\n  \t\"id\":\"CT-1000\", //required for contact updates, omit of null value to create a new contact\n    \"company_id\":\"CP-1000\",\n    \"first_name\": \"Jake\", //required for contact creations\n    \"last_name\": \"Jones\", //required for contact creations\n    \"title\": \"CEO\",\n    \"address\": \"123 Fake Street\",\n    \"city\": \"Los Angeles\",\n    \"zip\": \"90210\", \n    \"state\": \"CA\",\n    \"country\": \"USA\",\n    \"email\": \"jake.jones@mydomain.com\",\n  \t\"phone\": null,\n    \"phone_ext\": null,\n    \"mobile\": null,\n    \"active\": 1,\n    \"fields\": [{\n        'id': 10,\n        'value': '1234567890'\n    }, {\n        'id': 11,\n        'value': true\n    }]\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/contact',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(contact_data),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        contact_id = jQuery.parseJSON(r).id;\n    }\n});","language":"javascript","name":"jQuery"}]},"method":"post","params":[],"results":{"codes":[{"code":"{\"id\":\"CT-1000\"}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":""},"hidden":false,"order":0,"parentDoc":null,"slug":"create-update-asset","sync_unique":"","version":"565416f4ac09cc2100feb2d8","body":"Creating and updating an asset from the API can be done by posting your asset object to Supportbench. \n\nThe only difference between asset creations and updates is including an asset id within the asset object.\n\nWhen creating or updating an asset, the below fields are available to you.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Availability\",\n    \"0-0\": \"id_prefix\",\n    \"2-0\": \"id\",\n    \"7-0\": \"active_on\",\n    \"8-0\": \"expires_on\",\n    \"9-0\": \"active\",\n    \"10-0\": \"fields\",\n    \"0-1\": \"no\",\n    \"2-1\": \"no - when creating \\nyes - when updating\",\n    \"0-2\": \"5 characters\",\n    \"0-3\": \"\\\"A\\\"\",\n    \"2-3\": \"-\",\n    \"0-4\": \"New\",\n    \"2-4\": \"Update\",\n    \"2-2\": \"30 characters\",\n    \"7-1\": \"no\",\n    \"8-1\": \"no\",\n    \"9-1\": \"no\",\n    \"10-1\": \"no\",\n    \"7-2\": \"DateTime\",\n    \"8-2\": \"DateTime\",\n    \"9-2\": \"Boolean\",\n    \"10-2\": \"See field object\",\n    \"7-3\": \"-\",\n    \"8-3\": \"-\",\n    \"9-3\": \"-\",\n    \"10-3\": \"-\",\n    \"7-4\": \"New / Update\",\n    \"8-4\": \"New / Update\",\n    \"9-4\": \"New / Update\",\n    \"10-4\": \"New / Update\",\n    \"h-5\": \"Summary\",\n    \"2-5\": \"The full asset id including the prefix.\",\n    \"0-5\": \"The prefix of the asset. You can assign new asset prefix's within the API administration section.\",\n    \"7-5\": \"The date the asset was or will be active on in UTC.\",\n    \"8-5\": \"The date the asset was or will be expired on in UTC.\",\n    \"9-5\": \"Is the company active or not.\",\n    \"10-5\": \"A field array of custom fields to insert or update. Please see the field object below.\",\n    \"3-0\": \"parent_id\",\n    \"3-1\": \"no\",\n    \"3-2\": \"30 characters\",\n    \"3-3\": \"-\",\n    \"3-4\": \"New / Update\",\n    \"3-5\": \"The parent asset id to assign to this asset.\",\n    \"4-0\": \"name\",\n    \"5-1\": \"no\",\n    \"4-1\": \"**yes**\",\n    \"5-0\": \"version\",\n    \"4-2\": \"50 characters\",\n    \"5-2\": \"10 characters\",\n    \"4-3\": \"-\",\n    \"4-4\": \"New / Update\",\n    \"5-4\": \"New / Update\",\n    \"5-3\": \"-\",\n    \"4-5\": \"The asset name.\",\n    \"5-5\": \"The asset version.\",\n    \"6-0\": \"description\",\n    \"6-1\": \"no\",\n    \"6-2\": \"250 characters\",\n    \"6-3\": \"-\",\n    \"6-4\": \"New / Update\",\n    \"6-5\": \"The description of the asset.\",\n    \"1-0\": \"id_source\",\n    \"1-1\": \"no\",\n    \"1-2\": \"25 characters\",\n    \"1-3\": \"-\",\n    \"1-4\": \"New\",\n    \"1-5\": \"The source id of the asset. You can assign custom ID's from existing systems or assign your own id.\"\n  },\n  \"cols\": 6,\n  \"rows\": 11\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Fields Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"**yes**\",\n    \"0-2\": \"Integer\",\n    \"0-3\": \"-\",\n    \"0-4\": \"The field id of the field you wish to update.  The field id must map to a valid field in the asset.\",\n    \"1-0\": \"value\",\n    \"1-1\": \"**yes**\",\n    \"1-2\": \"Dropdown list - Integer\\nCheckbox - Boolean\\nText box - Unlimited\",\n    \"1-3\": \"-\",\n    \"1-4\": \"The value of the custom field.  The value is dependent on the field type.\"\n  },\n  \"cols\": 5,\n  \"rows\": 2\n}\n[/block]","category":"565f8a1c813aeb0d007b759d","project":"565416f3ac09cc2100feb2d5","title":"Create / Update Asset","updates":[],"__v":5,"excerpt":"","githubsync":"","isReference":true,"type":"post","childrenPages":[]}

postCreate / Update Asset


Creating and updating an asset from the API can be done by posting your asset object to Supportbench. The only difference between asset creations and updates is including an asset id within the asset object. When creating or updating an asset, the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "id_prefix", "2-0": "id", "7-0": "active_on", "8-0": "expires_on", "9-0": "active", "10-0": "fields", "0-1": "no", "2-1": "no - when creating \nyes - when updating", "0-2": "5 characters", "0-3": "\"A\"", "2-3": "-", "0-4": "New", "2-4": "Update", "2-2": "30 characters", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "7-2": "DateTime", "8-2": "DateTime", "9-2": "Boolean", "10-2": "See field object", "7-3": "-", "8-3": "-", "9-3": "-", "10-3": "-", "7-4": "New / Update", "8-4": "New / Update", "9-4": "New / Update", "10-4": "New / Update", "h-5": "Summary", "2-5": "The full asset id including the prefix.", "0-5": "The prefix of the asset. You can assign new asset prefix's within the API administration section.", "7-5": "The date the asset was or will be active on in UTC.", "8-5": "The date the asset was or will be expired on in UTC.", "9-5": "Is the company active or not.", "10-5": "A field array of custom fields to insert or update. Please see the field object below.", "3-0": "parent_id", "3-1": "no", "3-2": "30 characters", "3-3": "-", "3-4": "New / Update", "3-5": "The parent asset id to assign to this asset.", "4-0": "name", "5-1": "no", "4-1": "**yes**", "5-0": "version", "4-2": "50 characters", "5-2": "10 characters", "4-3": "-", "4-4": "New / Update", "5-4": "New / Update", "5-3": "-", "4-5": "The asset name.", "5-5": "The asset version.", "6-0": "description", "6-1": "no", "6-2": "250 characters", "6-3": "-", "6-4": "New / Update", "6-5": "The description of the asset.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the asset. You can assign custom ID's from existing systems or assign your own id." }, "cols": 6, "rows": 11 } [/block] [block:api-header] { "type": "basic", "title": "Fields Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the asset.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Creating and updating an asset from the API can be done by posting your asset object to Supportbench. The only difference between asset creations and updates is including an asset id within the asset object. When creating or updating an asset, the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "id_prefix", "2-0": "id", "7-0": "active_on", "8-0": "expires_on", "9-0": "active", "10-0": "fields", "0-1": "no", "2-1": "no - when creating \nyes - when updating", "0-2": "5 characters", "0-3": "\"A\"", "2-3": "-", "0-4": "New", "2-4": "Update", "2-2": "30 characters", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "7-2": "DateTime", "8-2": "DateTime", "9-2": "Boolean", "10-2": "See field object", "7-3": "-", "8-3": "-", "9-3": "-", "10-3": "-", "7-4": "New / Update", "8-4": "New / Update", "9-4": "New / Update", "10-4": "New / Update", "h-5": "Summary", "2-5": "The full asset id including the prefix.", "0-5": "The prefix of the asset. You can assign new asset prefix's within the API administration section.", "7-5": "The date the asset was or will be active on in UTC.", "8-5": "The date the asset was or will be expired on in UTC.", "9-5": "Is the company active or not.", "10-5": "A field array of custom fields to insert or update. Please see the field object below.", "3-0": "parent_id", "3-1": "no", "3-2": "30 characters", "3-3": "-", "3-4": "New / Update", "3-5": "The parent asset id to assign to this asset.", "4-0": "name", "5-1": "no", "4-1": "**yes**", "5-0": "version", "4-2": "50 characters", "5-2": "10 characters", "4-3": "-", "4-4": "New / Update", "5-4": "New / Update", "5-3": "-", "4-5": "The asset name.", "5-5": "The asset version.", "6-0": "description", "6-1": "no", "6-2": "250 characters", "6-3": "-", "6-4": "New / Update", "6-5": "The description of the asset.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the asset. You can assign custom ID's from existing systems or assign your own id." }, "cols": 6, "rows": 11 } [/block] [block:api-header] { "type": "basic", "title": "Fields Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the asset.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]
{"_id":"565f8baa6c2a8d0d0027656d","api":{"results":{"codes":[{"name":"","code":"{\n    \"id_prefix\": \"A\",\n    \"id\": \"A-1001\",\n    \"parent_id\": \"A-1000\",\n    \"name\": \"Product A\",\n    \"version\": \"1.5.1\",\n    \"full_name\": \"Product A 1.5.1\",\n    \"description\": \"Product A v1.5.1\",\n    \"active_on\": \"Jan 01 2015  9:00AM\",\n    \"expires_on\": null,\n    \"active\": false,\n    \"fields\": [{\n    \t\"id\":\"20\",\n      \"value\":\"true\"\n    }],\n    \"modified\": \"Jun 20 2015  8:02PM\",\n    \"created\": \"Jun 4 2015  9:28PM\"\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/asset/:id","auth":"required","examples":{"codes":[{"language":"javascript","code":"var asset_data = null;\nvar asset_id = 'A-1000';\n\n$.ajax({\n    url: 'https://api.supportbench.net/asset/' + asset_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        asset_data = r;\n        alert(asset_data.id);\n    }\n});","name":"jQuery"}]},"method":"get","params":[{"required":false,"desc":"An asset id","default":"","type":"string","name":"id","in":"path","_id":"5658b15364950b0d00e78da8"}]},"category":"565f8a1c813aeb0d007b759d","order":1,"title":"Return an Asset","updates":[],"user":"565416cace43aa21002b2566","body":"You can retrieve an asset and all of its data.  All asset fields are returned.","hidden":false,"link_url":"","parentDoc":null,"project":"565416f3ac09cc2100feb2d5","__v":0,"createdAt":"2015-12-03T00:24:10.771Z","excerpt":"","githubsync":"","version":"565416f4ac09cc2100feb2d8","editedParams":true,"editedParams2":true,"isReference":true,"link_external":false,"slug":"retrieve-a-asset","sync_unique":"","type":"get","childrenPages":[]}

getReturn an Asset


Path Params

id:
string
An asset id
You can retrieve an asset and all of its data. All asset fields are returned.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



You can retrieve an asset and all of its data. All asset fields are returned.
{"_id":"56cf9ca4287eb20b009f9fce","excerpt":"","order":2,"project":"565416f3ac09cc2100feb2d5","__v":0,"createdAt":"2016-02-26T00:30:28.128Z","hidden":false,"type":"get","version":"565416f4ac09cc2100feb2d8","api":{"examples":{"codes":[{"name":"jQuery","code":"var search_data = null;\nvar search_string = 'product';\n\n$.ajax({\n    url: 'https://api.supportbench.net/search/asset/' + encodeURIComponent(search_string),\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        search_data = jQuery.parseJSON(r);\n    }\n});","language":"javascript"}]},"method":"get","params":[{"required":false,"desc":"A asset name to search for","default":"","type":"string","name":"term","in":"path","_id":"5658b15364950b0d00e78da8"}],"results":{"codes":[{"name":"","status":200,"language":"json","code":"[{\n    \"id_prefix\": \"A\",\n    \"id\": \"A-1001\",\n    \"parent_id\": \"\",\n    \"name\": \"Product A\",\n    \"version\": \"1.5.1\",\n    \"full_name\": \"Product A 1.5.1\",\n    \"description\": \"Product A v1.5.1\",\n    \"active_on\": \"Jan 01 2015  9:00AM\",\n    \"expires_on\": null,\n    \"active\": true,\n    \"fields\": [{\n    \t\"id\":\"20\",\n      \"value\":\"true\"\n    }],\n    \"modified\": \"Jun 20 2015  8:02PM\",\n    \"created\": \"Jun 4 2015  9:28PM\"\n},{\n    \"id_prefix\": \"A\",\n    \"id\": \"A-1002\",\n    \"parent_id\": \"A-1000\",\n    \"name\": \"Product B\",\n    \"version\": \"2.1\",\n    \"full_name\": \"\",\n    \"description\": \"Product B v2.1\",\n    \"active_on\": \"Jan 01 2016  9:00AM\",\n    \"expires_on\": null,\n    \"active\": true,\n    \"fields\": [{\n    \t\"id\":\"20\",\n      \"value\":\"true\"\n    }],\n    \"modified\": \"Jun 26 2015  3:00PM\",\n    \"created\": \"Jun 23 2015  9:23PM\"\n}]"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/search/asset/:term","auth":"required"},"body":"Returns a list of [asset objects](https://supportbench.readme.io/docs/asset-object)","isReference":true,"updates":[],"editedParams2":true,"githubsync":"","link_external":false,"link_url":"","parentDoc":null,"slug":"search-for-assets-by-name","category":"565f8a1c813aeb0d007b759d","editedParams":true,"user":"565416cace43aa21002b2566","sync_unique":"","title":"Search for Assets by Name","childrenPages":[]}

getSearch for Assets by Name


Path Params

term:
string
A asset name to search for
Returns a list of [asset objects](https://supportbench.readme.io/docs/asset-object)

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Returns a list of [asset objects](https://supportbench.readme.io/docs/asset-object)
{"_id":"565f8cd06c2a8d0d0027656f","isReference":true,"sync_unique":"","api":{"url":"","auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":""},"createdAt":"2015-12-03T00:29:04.870Z","excerpt":"","hidden":false,"type":"basic","category":"565f8a1c813aeb0d007b759d","link_url":"","order":3,"title":"Asset Object","slug":"asset-object","version":"565416f4ac09cc2100feb2d8","parentDoc":null,"project":"565416f3ac09cc2100feb2d5","updates":[],"user":"565416cace43aa21002b2566","__v":1,"body":"The asset object is returned when returning a single asset or querying for assets.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id_prefix\",\n    \"1-0\": \"id\",\n    \"8-0\": \"expires_on\",\n    \"9-0\": \"active\",\n    \"10-0\": \"fields\",\n    \"11-0\": \"modified\",\n    \"12-0\": \"created\",\n    \"0-1\": \"The prefix of the id.\",\n    \"1-1\": \"The contact id with the prefix.\",\n    \"8-1\": \"The date and time the asset expired or will be expire and no longer be active.\",\n    \"9-1\": \"The active state of the asset.\",\n    \"10-1\": \"A field array of custom fields.\",\n    \"11-1\": \"The last date the asset was modified.\",\n    \"12-1\": \"The date the asset was created in the system.\",\n    \"2-0\": \"parent_id\",\n    \"2-1\": \"The parent asset id of the contact.\",\n    \"3-0\": \"name\",\n    \"3-1\": \"The display name of the asset.\",\n    \"6-0\": \"description\",\n    \"6-1\": \"The description of the asset.\",\n    \"7-0\": \"active_on\",\n    \"7-1\": \"The date and time the asset was or will be active.\",\n    \"4-0\": \"version\",\n    \"4-1\": \"The version number or variable of the asset.\",\n    \"5-1\": \"The combined name and version.\",\n    \"5-0\": \"full_name\"\n  },\n  \"cols\": 2,\n  \"rows\": 13\n}\n[/block]","githubsync":"","link_external":false,"childrenPages":[]}

Asset Object


The asset object is returned when returning a single asset or querying for assets. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id_prefix", "1-0": "id", "8-0": "expires_on", "9-0": "active", "10-0": "fields", "11-0": "modified", "12-0": "created", "0-1": "The prefix of the id.", "1-1": "The contact id with the prefix.", "8-1": "The date and time the asset expired or will be expire and no longer be active.", "9-1": "The active state of the asset.", "10-1": "A field array of custom fields.", "11-1": "The last date the asset was modified.", "12-1": "The date the asset was created in the system.", "2-0": "parent_id", "2-1": "The parent asset id of the contact.", "3-0": "name", "3-1": "The display name of the asset.", "6-0": "description", "6-1": "The description of the asset.", "7-0": "active_on", "7-1": "The date and time the asset was or will be active.", "4-0": "version", "4-1": "The version number or variable of the asset.", "5-1": "The combined name and version.", "5-0": "full_name" }, "cols": 2, "rows": 13 } [/block]
The asset object is returned when returning a single asset or querying for assets. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id_prefix", "1-0": "id", "8-0": "expires_on", "9-0": "active", "10-0": "fields", "11-0": "modified", "12-0": "created", "0-1": "The prefix of the id.", "1-1": "The contact id with the prefix.", "8-1": "The date and time the asset expired or will be expire and no longer be active.", "9-1": "The active state of the asset.", "10-1": "A field array of custom fields.", "11-1": "The last date the asset was modified.", "12-1": "The date the asset was created in the system.", "2-0": "parent_id", "2-1": "The parent asset id of the contact.", "3-0": "name", "3-1": "The display name of the asset.", "6-0": "description", "6-1": "The description of the asset.", "7-0": "active_on", "7-1": "The date and time the asset was or will be active.", "4-0": "version", "4-1": "The version number or variable of the asset.", "5-1": "The combined name and version.", "5-0": "full_name" }, "cols": 2, "rows": 13 } [/block]
{"_id":"565f8d586c2a8d0d00276574","link_external":false,"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","updates":[],"__v":1,"api":{"params":[],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"","auth":"required"},"excerpt":"","hidden":false,"isReference":true,"order":4,"slug":"fields-object","version":"565416f4ac09cc2100feb2d8","link_url":"","sync_unique":"","type":"basic","user":"565416cace43aa21002b2566","body":"The custom fields object returned within the fields property from the asset object.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"name\",\n    \"0-1\": \"The field display name.\",\n    \"1-0\": \"value\",\n    \"1-1\": \"The value of the field. This could be a Boolean, integer, or content depending on the field type.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]","category":"565f8a1c813aeb0d007b759d","createdAt":"2015-12-03T00:31:20.623Z","githubsync":"","title":"Field Object","childrenPages":[]}

Field Object


The custom fields object returned within the fields property from the asset object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "name", "0-1": "The field display name.", "1-0": "value", "1-1": "The value of the field. This could be a Boolean, integer, or content depending on the field type." }, "cols": 2, "rows": 2 } [/block]
The custom fields object returned within the fields property from the asset object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "name", "0-1": "The field display name.", "1-0": "value", "1-1": "The value of the field. This could be a Boolean, integer, or content depending on the field type." }, "cols": 2, "rows": 2 } [/block]
{"_id":"566274b1f5ca460d00f41873","createdAt":"2015-12-05T05:22:57.453Z","excerpt":"Create or update a knowledge base article.","link_url":"","slug":"create-update-article","sync_unique":"","updates":[],"__v":3,"api":{"method":"post","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\"success\":true}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"/article","auth":"required","examples":{"codes":[{"language":"javascript","code":"var article_id = null;\nvar article_data = {\n  \t\"id_prefix\":\"AR\", //not required for article updates\n    \"id_source\":\"12345\", //not required for article updates, only if you want to customize your article id\n  \t\"id\":\"AR-1000\", //required for article updates, omit of null value to create a new article\n    \"title\": \"My new article\", //required for article creations\n    \"summary\": \"This is my new article\",   \n    \"content\": \"<b>This is the article body</b>\",\n    \"published\": 1, //0 = internal only, 1 = community facing\n    \"status_id\": \"10\",\n    \"hot\": null,\n    \"owner_id\": null,\n    \"queue_id\": null,\n  \t\"review_date\": \"01/01/2017\",\n    \"review_action\": null,\n    \"category_id\": null,\n    \"priority_id\": null,    \n    \"issue_id\": null,\n    \"outcome_id\": null,  \n    \"tags\": [\"api\", \"api_article\"],\n    \"fields\": [{\n        'id': 6,\n        'value': '1234567890'\n    }, {\n        'id': 7,\n        'value': 'true'\n    }]\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/article',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(article_data),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        article_id = jQuery.parseJSON(r).id;\n    }\n});","name":"jQuery"}]}},"project":"565416f3ac09cc2100feb2d5","title":"Create / Update Article","body":"Creating and updating an article from the API can be done by posting your article object to Supportbench. \n\nThe only difference between article creations and updates is including a article id within the article object.\n\nWhen creating or updating a article , the below fields are available to you.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Availability\",\n    \"0-0\": \"id_prefix\",\n    \"2-0\": \"id\",\n    \"3-0\": \"title\",\n    \"4-0\": \"summary\",\n    \"5-0\": \"content\",\n    \"6-0\": \"published\",\n    \"7-0\": \"status_id\",\n    \"8-0\": \"owner_id\",\n    \"9-0\": \"hot\",\n    \"10-0\": \"queue_id\",\n    \"18-0\": \"fields\",\n    \"0-1\": \"no\",\n    \"2-1\": \"no - when creating \\nyes - when updating\",\n    \"0-2\": \"5 characters\",\n    \"0-3\": \"\\\"AR\\\"\",\n    \"2-3\": \"-\",\n    \"0-4\": \"New\",\n    \"2-4\": \"Update\",\n    \"2-2\": \"30 characters\",\n    \"3-1\": \"**yes**\",\n    \"3-2\": \"250 characters\",\n    \"3-3\": \"-\",\n    \"3-4\": \"New / Update\",\n    \"4-1\": \"no\",\n    \"5-1\": \"no\",\n    \"6-1\": \"no\",\n    \"7-1\": \"no\",\n    \"8-1\": \"no\",\n    \"9-1\": \"no\",\n    \"10-1\": \"no\",\n    \"18-1\": \"no\",\n    \"4-2\": \"250 characters\",\n    \"5-2\": \"Unlimited\",\n    \"6-2\": \"Boolean\",\n    \"7-2\": \"Integer\",\n    \"8-2\": \"Integer\",\n    \"9-2\": \"Boolean\",\n    \"10-2\": \"Integer\",\n    \"18-2\": \"See field object\",\n    \"4-3\": \"-\",\n    \"5-3\": \"-\",\n    \"6-3\": \"False\",\n    \"7-3\": \"10\",\n    \"8-3\": \"-\",\n    \"9-3\": \"False\",\n    \"10-3\": \"-\",\n    \"18-3\": \"-\",\n    \"4-4\": \"New / Update\",\n    \"5-4\": \"New / Update\",\n    \"6-4\": \"New / Update\",\n    \"7-4\": \"New / Update\",\n    \"8-4\": \"New / Update\",\n    \"9-4\": \"New / Update\",\n    \"10-4\": \"New / Update\",\n    \"18-4\": \"New / Update\",\n    \"h-5\": \"Summary\",\n    \"2-5\": \"The full article id including the prefix.\",\n    \"0-5\": \"The prefix of the article. You can assign new article prefix's within the API administration section.\",\n    \"3-5\": \"The article title.\",\n    \"4-5\": \"The article summary.\",\n    \"5-5\": \"The article content as HTML.\",\n    \"6-5\": \"The published state of the article.  0 = Internal, 1 = available to the community.\",\n    \"7-5\": \"The status of the article.\",\n    \"9-5\": \"Whether the article is a hot article or not and available within the case addition screen.\",\n    \"8-5\": \"The agent who owns this article.\",\n    \"10-5\": \"The queue this article is assigned to.\",\n    \"18-5\": \"A field array of custom fields to insert or update. Please see the field object below.\",\n    \"11-0\": \"review_date\",\n    \"11-1\": \"no\",\n    \"11-2\": \"DateTime\",\n    \"11-3\": \"-\",\n    \"11-4\": \"New / Update\",\n    \"11-5\": \"The date this article will expire and trigger the review action.\",\n    \"12-0\": \"review_action\",\n    \"12-1\": \"no\",\n    \"12-2\": \"Integer\",\n    \"12-3\": \"10\",\n    \"12-4\": \"New / Update\",\n    \"12-5\": \"The action that takes place once the article has expired.\",\n    \"13-0\": \"category_id\",\n    \"14-0\": \"priority_id\",\n    \"15-0\": \"issue_id\",\n    \"16-0\": \"outcome_id\",\n    \"17-0\": \"tags\",\n    \"13-1\": \"no\",\n    \"14-1\": \"no\",\n    \"15-1\": \"no\",\n    \"16-1\": \"no\",\n    \"17-1\": \"no\",\n    \"13-2\": \"Integer\",\n    \"14-2\": \"Integer\",\n    \"15-2\": \"Integer\",\n    \"16-2\": \"Integer\",\n    \"17-2\": \"100 characters per tag\",\n    \"17-5\": \"A tag array assigned to the article. If updating, the tags defined here will overwrite any existing tags.\",\n    \"13-4\": \"New / Update\",\n    \"14-4\": \"New / Update\",\n    \"15-4\": \"New / Update\",\n    \"16-4\": \"New / Update\",\n    \"17-4\": \"New / Update\",\n    \"13-3\": \"-\",\n    \"14-3\": \"-\",\n    \"15-3\": \"-\",\n    \"16-3\": \"-\",\n    \"17-3\": \"-\",\n    \"13-5\": \"The related  case category id of the article.\",\n    \"14-5\": \"The related case priority id of the article.\",\n    \"15-5\": \"The related case issue id of the article.\",\n    \"16-5\": \"The related case outcome id of the article.\",\n    \"1-0\": \"id_source\",\n    \"1-1\": \"no\",\n    \"1-2\": \"25 characters\",\n    \"1-3\": \"-\",\n    \"1-4\": \"New\",\n    \"1-5\": \"The source id of the article. You can assign custom ID's from existing systems or assign your own id.\"\n  },\n  \"cols\": 6,\n  \"rows\": 19\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Fields Object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"**yes**\",\n    \"0-2\": \"Integer\",\n    \"0-3\": \"-\",\n    \"0-4\": \"The field id of the field you wish to update.  The field id must map to a valid field in the article.\",\n    \"1-0\": \"value\",\n    \"1-1\": \"**yes**\",\n    \"1-2\": \"Dropdown list - Integer\\nCheckbox - Boolean\\nText box - Unlimited\",\n    \"1-3\": \"-\",\n    \"1-4\": \"The value of the custom field.  The value is dependent on the field type.\"\n  },\n  \"cols\": 5,\n  \"rows\": 2\n}\n[/block]","githubsync":"","type":"post","user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","isReference":true,"link_external":false,"hidden":false,"order":0,"parentDoc":null,"category":"56627466cd54d50d005015cc","childrenPages":[]}

postCreate / Update Article

Create or update a knowledge base article.

Creating and updating an article from the API can be done by posting your article object to Supportbench. The only difference between article creations and updates is including a article id within the article object. When creating or updating a article , the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "id_prefix", "2-0": "id", "3-0": "title", "4-0": "summary", "5-0": "content", "6-0": "published", "7-0": "status_id", "8-0": "owner_id", "9-0": "hot", "10-0": "queue_id", "18-0": "fields", "0-1": "no", "2-1": "no - when creating \nyes - when updating", "0-2": "5 characters", "0-3": "\"AR\"", "2-3": "-", "0-4": "New", "2-4": "Update", "2-2": "30 characters", "3-1": "**yes**", "3-2": "250 characters", "3-3": "-", "3-4": "New / Update", "4-1": "no", "5-1": "no", "6-1": "no", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "18-1": "no", "4-2": "250 characters", "5-2": "Unlimited", "6-2": "Boolean", "7-2": "Integer", "8-2": "Integer", "9-2": "Boolean", "10-2": "Integer", "18-2": "See field object", "4-3": "-", "5-3": "-", "6-3": "False", "7-3": "10", "8-3": "-", "9-3": "False", "10-3": "-", "18-3": "-", "4-4": "New / Update", "5-4": "New / Update", "6-4": "New / Update", "7-4": "New / Update", "8-4": "New / Update", "9-4": "New / Update", "10-4": "New / Update", "18-4": "New / Update", "h-5": "Summary", "2-5": "The full article id including the prefix.", "0-5": "The prefix of the article. You can assign new article prefix's within the API administration section.", "3-5": "The article title.", "4-5": "The article summary.", "5-5": "The article content as HTML.", "6-5": "The published state of the article. 0 = Internal, 1 = available to the community.", "7-5": "The status of the article.", "9-5": "Whether the article is a hot article or not and available within the case addition screen.", "8-5": "The agent who owns this article.", "10-5": "The queue this article is assigned to.", "18-5": "A field array of custom fields to insert or update. Please see the field object below.", "11-0": "review_date", "11-1": "no", "11-2": "DateTime", "11-3": "-", "11-4": "New / Update", "11-5": "The date this article will expire and trigger the review action.", "12-0": "review_action", "12-1": "no", "12-2": "Integer", "12-3": "10", "12-4": "New / Update", "12-5": "The action that takes place once the article has expired.", "13-0": "category_id", "14-0": "priority_id", "15-0": "issue_id", "16-0": "outcome_id", "17-0": "tags", "13-1": "no", "14-1": "no", "15-1": "no", "16-1": "no", "17-1": "no", "13-2": "Integer", "14-2": "Integer", "15-2": "Integer", "16-2": "Integer", "17-2": "100 characters per tag", "17-5": "A tag array assigned to the article. If updating, the tags defined here will overwrite any existing tags.", "13-4": "New / Update", "14-4": "New / Update", "15-4": "New / Update", "16-4": "New / Update", "17-4": "New / Update", "13-3": "-", "14-3": "-", "15-3": "-", "16-3": "-", "17-3": "-", "13-5": "The related case category id of the article.", "14-5": "The related case priority id of the article.", "15-5": "The related case issue id of the article.", "16-5": "The related case outcome id of the article.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the article. You can assign custom ID's from existing systems or assign your own id." }, "cols": 6, "rows": 19 } [/block] [block:api-header] { "type": "basic", "title": "Fields Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the article.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Creating and updating an article from the API can be done by posting your article object to Supportbench. The only difference between article creations and updates is including a article id within the article object. When creating or updating a article , the below fields are available to you. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "id_prefix", "2-0": "id", "3-0": "title", "4-0": "summary", "5-0": "content", "6-0": "published", "7-0": "status_id", "8-0": "owner_id", "9-0": "hot", "10-0": "queue_id", "18-0": "fields", "0-1": "no", "2-1": "no - when creating \nyes - when updating", "0-2": "5 characters", "0-3": "\"AR\"", "2-3": "-", "0-4": "New", "2-4": "Update", "2-2": "30 characters", "3-1": "**yes**", "3-2": "250 characters", "3-3": "-", "3-4": "New / Update", "4-1": "no", "5-1": "no", "6-1": "no", "7-1": "no", "8-1": "no", "9-1": "no", "10-1": "no", "18-1": "no", "4-2": "250 characters", "5-2": "Unlimited", "6-2": "Boolean", "7-2": "Integer", "8-2": "Integer", "9-2": "Boolean", "10-2": "Integer", "18-2": "See field object", "4-3": "-", "5-3": "-", "6-3": "False", "7-3": "10", "8-3": "-", "9-3": "False", "10-3": "-", "18-3": "-", "4-4": "New / Update", "5-4": "New / Update", "6-4": "New / Update", "7-4": "New / Update", "8-4": "New / Update", "9-4": "New / Update", "10-4": "New / Update", "18-4": "New / Update", "h-5": "Summary", "2-5": "The full article id including the prefix.", "0-5": "The prefix of the article. You can assign new article prefix's within the API administration section.", "3-5": "The article title.", "4-5": "The article summary.", "5-5": "The article content as HTML.", "6-5": "The published state of the article. 0 = Internal, 1 = available to the community.", "7-5": "The status of the article.", "9-5": "Whether the article is a hot article or not and available within the case addition screen.", "8-5": "The agent who owns this article.", "10-5": "The queue this article is assigned to.", "18-5": "A field array of custom fields to insert or update. Please see the field object below.", "11-0": "review_date", "11-1": "no", "11-2": "DateTime", "11-3": "-", "11-4": "New / Update", "11-5": "The date this article will expire and trigger the review action.", "12-0": "review_action", "12-1": "no", "12-2": "Integer", "12-3": "10", "12-4": "New / Update", "12-5": "The action that takes place once the article has expired.", "13-0": "category_id", "14-0": "priority_id", "15-0": "issue_id", "16-0": "outcome_id", "17-0": "tags", "13-1": "no", "14-1": "no", "15-1": "no", "16-1": "no", "17-1": "no", "13-2": "Integer", "14-2": "Integer", "15-2": "Integer", "16-2": "Integer", "17-2": "100 characters per tag", "17-5": "A tag array assigned to the article. If updating, the tags defined here will overwrite any existing tags.", "13-4": "New / Update", "14-4": "New / Update", "15-4": "New / Update", "16-4": "New / Update", "17-4": "New / Update", "13-3": "-", "14-3": "-", "15-3": "-", "16-3": "-", "17-3": "-", "13-5": "The related case category id of the article.", "14-5": "The related case priority id of the article.", "15-5": "The related case issue id of the article.", "16-5": "The related case outcome id of the article.", "1-0": "id_source", "1-1": "no", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The source id of the article. You can assign custom ID's from existing systems or assign your own id." }, "cols": 6, "rows": 19 } [/block] [block:api-header] { "type": "basic", "title": "Fields Object" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Summary", "0-0": "id", "0-1": "**yes**", "0-2": "Integer", "0-3": "-", "0-4": "The field id of the field you wish to update. The field id must map to a valid field in the article.", "1-0": "value", "1-1": "**yes**", "1-2": "Dropdown list - Integer\nCheckbox - Boolean\nText box - Unlimited", "1-3": "-", "1-4": "The value of the custom field. The value is dependent on the field type." }, "cols": 5, "rows": 2 } [/block]
{"_id":"56627edad30ed10d004d4356","updates":[],"user":"565416cace43aa21002b2566","api":{"auth":"required","examples":{"codes":[{"language":"javascript","name":"jQuery","code":"var article_data = null;\nvar article_id = 'AR-1000';\n\n$.ajax({\n    url: 'https://api.supportbench.net/case/' + case_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        article_data = r;\n        article_id = article_data.id;\n    }\n});"}]},"method":"get","params":[{"in":"path","name":"id","ref":"","required":false,"type":"string","_id":"56578fe91edfb90d005c241f","default":"","desc":"The Article ID"}],"results":{"codes":[{"status":200,"language":"json","code":"{  \n   \"id_prefix\":\"AR\",\n   \"id\":\"AR-1000\",\n   \"title\":\"My Article\",\n   \"summary\":\"This is my article.\",\n   \"content\":\"<b>My API article.</b>\",\n   \"published\":true,\n   \"status_id\":10,\n   \"status\":\"Published\",\n   \"hot\":false,\n   \"owner_id\":\"1\",\n   \"owner\":\"Joe Smith\",\n   \"queue_id\":null,\n   \"queue\":\"\",\n   \"review_date\":\"Dec 31 2017  7:00AM\",\n   \"review_action_id\":10,\n   \"review_action\":\"Retire\",\n   \"tags\":[  \n      \"api\",\n      \"api_article\"\n   ],\n   \"category_id\":1,\n   \"category\":\"Support Case\",\n   \"priority_id\":\"5\",\n   \"priority\":\"Low\",\n   \"issue_id\":\"1\",\n   \"issue\":\"Installation\",\n   \"outcome_id\":null,\n   \"outcome\":\"\",\n   \"case_id\":\"C-1000\",\n   \"activity_id\":1000,\n   \"containers\":[  \n      {  \n         \"id\":5,\n         \"public\":true,\n         \"name\":\"Container 1\"\n      },\n      {  \n         \"id\":10,\n         \"public\":false,\n         \"name\":\"Container 2\"\n      }\n   ],\n   \"fields\":[  \n      {  \n         \"name\":\"Was a rebuild\",\n         \"value\":true\n      },\n      {  \n         \"name\":\"Operating System\",\n         \"value\":\"Windows 10\"\n      }\n   ],\n   \"attachments\":[  \n      {  \n         \"id\" : 124,\n         \"name\":\"image.png\",\n         \"size\":\"16786\",\n         \"url\":\"https://kustorage.blob.core.windows.net/acc1/article/AR-1000/image.png?sv=2015-04-05&sr=c&si=accountpolicy&sig=TxsdfTicDsjfhgVpwrPoOx5NuOD1FtnfkKQVFffhf5enaocf4gjM%3D\"\n      }\n   ],\n   \"modified\":\"Nov 30 2015  9:00PM\",\n   \"created\":\"Nov 24 2015  8:26AM\"\n}","name":"Success"},{"code":"{}","name":"Failure","status":400,"language":"json"}]},"settings":"","url":"/article/:id"},"excerpt":"","link_url":"","parentDoc":null,"project":"565416f3ac09cc2100feb2d5","slug":"returning-an-article","editedParams":true,"hidden":false,"sync_unique":"","version":"565416f4ac09cc2100feb2d8","__v":1,"createdAt":"2015-12-05T06:06:18.891Z","githubsync":"","isReference":true,"link_external":false,"next":{"description":"","pages":[]},"type":"get","body":"You can retrieve an article and all of its data.  All article fields and its attachments are returned.","category":"56627466cd54d50d005015cc","editedParams2":true,"order":1,"title":"Returning an Article","childrenPages":[]}

getReturning an Article


Path Params

id:
string
The Article ID
You can retrieve an article and all of its data. All article fields and its attachments are returned.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



You can retrieve an article and all of its data. All article fields and its attachments are returned.
{"_id":"56628491cd54d50d005015d2","githubsync":"","project":"565416f3ac09cc2100feb2d5","sync_unique":"","type":"basic","version":"565416f4ac09cc2100feb2d8","api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","url":""},"excerpt":"","parentDoc":null,"createdAt":"2015-12-05T06:30:41.265Z","link_external":false,"order":2,"slug":"article-object","updates":[],"user":"565416cace43aa21002b2566","hidden":false,"isReference":true,"body":"The article object is what is returned when retrieving an article or querying articles.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-2\": \"Summary\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id_prefix\",\n    \"0-1\": \"The prefix of the id.\",\n    \"1-0\": \"id\",\n    \"1-1\": \"The article id with the prefix.\",\n    \"13-0\": \"review_date\",\n    \"14-0\": \"review_action_id\",\n    \"13-1\": \"The date the article expires and fires the selected action.\",\n    \"14-1\": \"The action id of the reviewed article.\",\n    \"15-0\": \"review_action\",\n    \"16-0\": \"tags\",\n    \"20-0\": \"priority\",\n    \"21-0\": \"issue_id\",\n    \"22-0\": \"issue\",\n    \"15-1\": \"The name of the review action.\",\n    \"16-1\": \"An array of tags associated to the article.\",\n    \"20-1\": \"The display name of the related case  priority.\",\n    \"21-1\": \"The related case issue id.\",\n    \"22-1\": \"The display name of the related case issue.\",\n    \"23-0\": \"outcome_id\",\n    \"24-0\": \"outcome\",\n    \"23-1\": \"The related case outcome id.\",\n    \"24-1\": \"The display name of the related case outcome id.\",\n    \"25-0\": \"case_id\",\n    \"26-0\": \"activity_id\",\n    \"25-1\": \"The case id where this article was created from.\",\n    \"26-1\": \"The activity id where this article was created from.\",\n    \"28-0\": \"fields\",\n    \"30-0\": \"modified\",\n    \"31-0\": \"created\",\n    \"30-1\": \"The last date the case was modified in UTC.\",\n    \"31-1\": \"The date the case was created in UTC.\",\n    \"28-1\": \"An object array of key value pairs for custom fields related to this case if they exist.\\nname = The field name.\\nvalue = The value of the field.\",\n    \"2-0\": \"title\",\n    \"3-0\": \"summary\",\n    \"4-0\": \"content\",\n    \"5-0\": \"published\",\n    \"6-0\": \"status_id\",\n    \"7-0\": \"status\",\n    \"6-1\": \"The article status id.\",\n    \"7-1\": \"The display name of the state.\",\n    \"2-1\": \"The title of the article.\",\n    \"3-1\": \"The summary of the article.\",\n    \"4-1\": \"The contents of the article in HTML.\",\n    \"5-1\": \"Whether the article is published to the community or just internally.\",\n    \"8-0\": \"hot\",\n    \"8-1\": \"Whether the article is a hot article and available within the case creation screen in Supportbench.\",\n    \"9-0\": \"owner_id\",\n    \"9-1\": \"The agent owner id.\",\n    \"10-0\": \"owner\",\n    \"10-1\": \"The full name of the agent owner.\",\n    \"11-0\": \"queue_id\",\n    \"11-1\": \"The queue id the case is in.\",\n    \"12-0\": \"queue\",\n    \"12-1\": \"The display name of the queue the case is in.\",\n    \"17-0\": \"category_id\",\n    \"18-0\": \"category\",\n    \"17-1\": \"The related case category id of the article.\",\n    \"18-1\": \"The display name of the related category.\",\n    \"19-0\": \"priority_id\",\n    \"19-1\": \"The related case priority id.\",\n    \"27-0\": \"containers\",\n    \"27-1\": \"An array of containers that this article is related to.  Please see the container object below.\",\n    \"29-0\": \"attachments\",\n    \"29-1\": \"An array of attachments that this article contains.  Please see the attachment object below.\"\n  },\n  \"cols\": 2,\n  \"rows\": 32\n}\n[/block]","category":"56627466cd54d50d005015cc","link_url":"","title":"Article Object","__v":1,"childrenPages":[]}

Article Object


The article object is what is returned when retrieving an article or querying articles. [block:parameters] { "data": { "h-0": "Name", "h-2": "Summary", "h-1": "Summary", "0-0": "id_prefix", "0-1": "The prefix of the id.", "1-0": "id", "1-1": "The article id with the prefix.", "13-0": "review_date", "14-0": "review_action_id", "13-1": "The date the article expires and fires the selected action.", "14-1": "The action id of the reviewed article.", "15-0": "review_action", "16-0": "tags", "20-0": "priority", "21-0": "issue_id", "22-0": "issue", "15-1": "The name of the review action.", "16-1": "An array of tags associated to the article.", "20-1": "The display name of the related case priority.", "21-1": "The related case issue id.", "22-1": "The display name of the related case issue.", "23-0": "outcome_id", "24-0": "outcome", "23-1": "The related case outcome id.", "24-1": "The display name of the related case outcome id.", "25-0": "case_id", "26-0": "activity_id", "25-1": "The case id where this article was created from.", "26-1": "The activity id where this article was created from.", "28-0": "fields", "30-0": "modified", "31-0": "created", "30-1": "The last date the case was modified in UTC.", "31-1": "The date the case was created in UTC.", "28-1": "An object array of key value pairs for custom fields related to this case if they exist.\nname = The field name.\nvalue = The value of the field.", "2-0": "title", "3-0": "summary", "4-0": "content", "5-0": "published", "6-0": "status_id", "7-0": "status", "6-1": "The article status id.", "7-1": "The display name of the state.", "2-1": "The title of the article.", "3-1": "The summary of the article.", "4-1": "The contents of the article in HTML.", "5-1": "Whether the article is published to the community or just internally.", "8-0": "hot", "8-1": "Whether the article is a hot article and available within the case creation screen in Supportbench.", "9-0": "owner_id", "9-1": "The agent owner id.", "10-0": "owner", "10-1": "The full name of the agent owner.", "11-0": "queue_id", "11-1": "The queue id the case is in.", "12-0": "queue", "12-1": "The display name of the queue the case is in.", "17-0": "category_id", "18-0": "category", "17-1": "The related case category id of the article.", "18-1": "The display name of the related category.", "19-0": "priority_id", "19-1": "The related case priority id.", "27-0": "containers", "27-1": "An array of containers that this article is related to. Please see the container object below.", "29-0": "attachments", "29-1": "An array of attachments that this article contains. Please see the attachment object below." }, "cols": 2, "rows": 32 } [/block]
The article object is what is returned when retrieving an article or querying articles. [block:parameters] { "data": { "h-0": "Name", "h-2": "Summary", "h-1": "Summary", "0-0": "id_prefix", "0-1": "The prefix of the id.", "1-0": "id", "1-1": "The article id with the prefix.", "13-0": "review_date", "14-0": "review_action_id", "13-1": "The date the article expires and fires the selected action.", "14-1": "The action id of the reviewed article.", "15-0": "review_action", "16-0": "tags", "20-0": "priority", "21-0": "issue_id", "22-0": "issue", "15-1": "The name of the review action.", "16-1": "An array of tags associated to the article.", "20-1": "The display name of the related case priority.", "21-1": "The related case issue id.", "22-1": "The display name of the related case issue.", "23-0": "outcome_id", "24-0": "outcome", "23-1": "The related case outcome id.", "24-1": "The display name of the related case outcome id.", "25-0": "case_id", "26-0": "activity_id", "25-1": "The case id where this article was created from.", "26-1": "The activity id where this article was created from.", "28-0": "fields", "30-0": "modified", "31-0": "created", "30-1": "The last date the case was modified in UTC.", "31-1": "The date the case was created in UTC.", "28-1": "An object array of key value pairs for custom fields related to this case if they exist.\nname = The field name.\nvalue = The value of the field.", "2-0": "title", "3-0": "summary", "4-0": "content", "5-0": "published", "6-0": "status_id", "7-0": "status", "6-1": "The article status id.", "7-1": "The display name of the state.", "2-1": "The title of the article.", "3-1": "The summary of the article.", "4-1": "The contents of the article in HTML.", "5-1": "Whether the article is published to the community or just internally.", "8-0": "hot", "8-1": "Whether the article is a hot article and available within the case creation screen in Supportbench.", "9-0": "owner_id", "9-1": "The agent owner id.", "10-0": "owner", "10-1": "The full name of the agent owner.", "11-0": "queue_id", "11-1": "The queue id the case is in.", "12-0": "queue", "12-1": "The display name of the queue the case is in.", "17-0": "category_id", "18-0": "category", "17-1": "The related case category id of the article.", "18-1": "The display name of the related category.", "19-0": "priority_id", "19-1": "The related case priority id.", "27-0": "containers", "27-1": "An array of containers that this article is related to. Please see the container object below.", "29-0": "attachments", "29-1": "An array of attachments that this article contains. Please see the attachment object below." }, "cols": 2, "rows": 32 } [/block]
{"_id":"56628736ff49ec0d00380899","order":3,"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","body":"The attachment object is what is returned within the attachments property when retrieving an article.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"1-0\": \"name\",\n    \"1-1\": \"The name of the file.\",\n    \"2-0\": \"size\",\n    \"2-1\": \"The size of the file in bytes.\",\n    \"3-0\": \"url\",\n    \"3-1\": \"The download URL of the file.  This includes an expiring security signature in the URL.\",\n    \"0-0\": \"id\",\n    \"0-1\": \"The unique attachment id\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","category":"56627466cd54d50d005015cc","excerpt":"","isReference":true,"next":{"description":"","pages":[]},"updates":[],"hidden":false,"title":"Attachment Object","version":"565416f4ac09cc2100feb2d8","user":"565416cace43aa21002b2566","__v":2,"createdAt":"2015-12-05T06:41:58.116Z","githubsync":"","link_external":false,"api":{"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"","auth":"required"},"link_url":"","slug":"article-object-1","sync_unique":"","type":"basic","childrenPages":[]}

Attachment Object


The attachment object is what is returned within the attachments property when retrieving an article. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "1-0": "name", "1-1": "The name of the file.", "2-0": "size", "2-1": "The size of the file in bytes.", "3-0": "url", "3-1": "The download URL of the file. This includes an expiring security signature in the URL.", "0-0": "id", "0-1": "The unique attachment id" }, "cols": 2, "rows": 4 } [/block]
The attachment object is what is returned within the attachments property when retrieving an article. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "1-0": "name", "1-1": "The name of the file.", "2-0": "size", "2-1": "The size of the file in bytes.", "3-0": "url", "3-1": "The download URL of the file. This includes an expiring security signature in the URL.", "0-0": "id", "0-1": "The unique attachment id" }, "cols": 2, "rows": 4 } [/block]
{"_id":"56579286a795770d00a2afa9","user":"565416cace43aa21002b2566","githubsync":"","link_url":"","project":"565416f3ac09cc2100feb2d5","slug":"fields","type":"basic","body":"The custom fields object returned within the fields property from the case object.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"name\",\n    \"0-1\": \"The field display name.\",\n    \"1-0\": \"value\",\n    \"1-1\": \"The value of the field. This could be a Boolean, integer, or content depending on the field type.\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]","isReference":true,"order":4,"parentDoc":null,"version":"565416f4ac09cc2100feb2d8","api":{"auth":"required","params":[],"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","url":""},"category":"56627466cd54d50d005015cc","title":"Field Object","updates":[],"link_external":false,"sync_unique":"","__v":3,"createdAt":"2015-11-26T23:15:18.774Z","excerpt":"","hidden":false,"childrenPages":[]}

Field Object


The custom fields object returned within the fields property from the case object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "name", "0-1": "The field display name.", "1-0": "value", "1-1": "The value of the field. This could be a Boolean, integer, or content depending on the field type." }, "cols": 2, "rows": 2 } [/block]
The custom fields object returned within the fields property from the case object. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "name", "0-1": "The field display name.", "1-0": "value", "1-1": "The value of the field. This could be a Boolean, integer, or content depending on the field type." }, "cols": 2, "rows": 2 } [/block]
{"_id":"566287fbcd54d50d005015d5","updates":[],"api":{"settings":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"auth":"required","params":[],"url":""},"githubsync":"","link_external":false,"project":"565416f3ac09cc2100feb2d5","slug":"container-object","sync_unique":"","type":"basic","__v":0,"body":"A container is what is returned within the article containers property when retrieving an article or list of articles.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Summary\",\n    \"0-0\": \"id\",\n    \"0-1\": \"The id of the container.\",\n    \"1-0\": \"public\",\n    \"1-1\": \"Whether the container is publicly viewable or not.\",\n    \"2-0\": \"name\",\n    \"2-1\": \"The download URL of the file.  This includes an expiring security signature in the URL.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]","order":5,"user":"565416cace43aa21002b2566","category":"56627466cd54d50d005015cc","excerpt":"","hidden":false,"parentDoc":null,"version":"565416f4ac09cc2100feb2d8","createdAt":"2015-12-05T06:45:15.631Z","isReference":true,"link_url":"","title":"Container Object","childrenPages":[]}

Container Object


A container is what is returned within the article containers property when retrieving an article or list of articles. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The id of the container.", "1-0": "public", "1-1": "Whether the container is publicly viewable or not.", "2-0": "name", "2-1": "The download URL of the file. This includes an expiring security signature in the URL." }, "cols": 2, "rows": 3 } [/block]
A container is what is returned within the article containers property when retrieving an article or list of articles. [block:parameters] { "data": { "h-0": "Name", "h-1": "Summary", "0-0": "id", "0-1": "The id of the container.", "1-0": "public", "1-1": "Whether the container is publicly viewable or not.", "2-0": "name", "2-1": "The download URL of the file. This includes an expiring security signature in the URL." }, "cols": 2, "rows": 3 } [/block]
{"_id":"56bd272dfb9be80d003280e0","slug":"user-counts","user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","hidden":false,"isReference":true,"title":"User Counts","type":"post","body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Options to query the data\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Usage\",\n    \"h-2\": \"Default\",\n    \"0-0\": \"user_id\",\n    \"0-1\": \"\\\"1256\\\"\",\n    \"0-2\": \"Logged in user id\",\n    \"1-0\": \"utc_offset\",\n    \"1-1\": \"\\\"-480\\\"\",\n    \"1-2\": \"0 *(UTC time)*\",\n    \"h-3\": \"Description\",\n    \"0-3\": \"The user id to query. If this field is null or set to 0, then the user id will default to the logged in user.\",\n    \"1-3\": \"The UTC offset of the time frame to query for.  This is used specifically for returning the number events in the last day.\"\n  },\n  \"cols\": 4,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning user count object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"notifications\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"1-0\": \"bookmarks\",\n    \"2-0\": \"cases\",\n    \"3-0\": \"workcases\",\n    \"4-0\": \"events\",\n    \"5-0\": \"tour\",\n    \"0-1\": \"The number of notifications  / alerts the user currently has.\",\n    \"1-1\": \"The number of bookmarks the user has. i.e. Companies, Contacts, views, etc..\",\n    \"2-1\": \"The number of cases the user currently owns.\",\n    \"3-1\": \"The number of cases within the users work queues.\",\n    \"4-1\": \"The number of events for today that has not passed.  **The UTC Offset is important for this to work correctly for your time zone.**\",\n    \"5-1\": \"If the tours have been completed.\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]","createdAt":"2016-02-12T00:28:29.914Z","githubsync":"","updates":[],"project":"565416f3ac09cc2100feb2d5","sync_unique":"","__v":6,"api":{"settings":"","url":"/user/counts","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var count_data = null;\nvar query_args = {\n    \"user_id\": \"1256\", //The user id to query\n    \"utc_offset\": \"-480\" //This is for the pacific time zone\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/user/counts',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(query_args),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        count_data = jQuery.parseJSON(r);\n    }\n});","language":"javascript"}]},"method":"post","params":[],"results":{"codes":[{"name":"","code":"{\n    \"notifications\": \"5\",\n    \"bookmarks\": \"11\",\n    \"workcases\": \"23\",\n    \"cases\": \"5\",\n    \"events\": \"0\",\n    \"tour\": \"1\"\n}","language":"json","status":200},{"language":"json","status":400,"name":"","code":"{}"}]}},"link_url":"","order":0,"category":"56bd262dac1c5c1900b2dbf9","excerpt":"","link_external":false,"parentDoc":null,"childrenPages":[]}

postUser Counts


Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Options to query the data" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Usage", "h-2": "Default", "0-0": "user_id", "0-1": "\"1256\"", "0-2": "Logged in user id", "1-0": "utc_offset", "1-1": "\"-480\"", "1-2": "0 *(UTC time)*", "h-3": "Description", "0-3": "The user id to query. If this field is null or set to 0, then the user id will default to the logged in user.", "1-3": "The UTC offset of the time frame to query for. This is used specifically for returning the number events in the last day." }, "cols": 4, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Returning user count object" } [/block] [block:parameters] { "data": { "0-0": "notifications", "h-0": "Name", "h-1": "Description", "1-0": "bookmarks", "2-0": "cases", "3-0": "workcases", "4-0": "events", "5-0": "tour", "0-1": "The number of notifications / alerts the user currently has.", "1-1": "The number of bookmarks the user has. i.e. Companies, Contacts, views, etc..", "2-1": "The number of cases the user currently owns.", "3-1": "The number of cases within the users work queues.", "4-1": "The number of events for today that has not passed. **The UTC Offset is important for this to work correctly for your time zone.**", "5-1": "If the tours have been completed." }, "cols": 2, "rows": 6 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Options to query the data" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Usage", "h-2": "Default", "0-0": "user_id", "0-1": "\"1256\"", "0-2": "Logged in user id", "1-0": "utc_offset", "1-1": "\"-480\"", "1-2": "0 *(UTC time)*", "h-3": "Description", "0-3": "The user id to query. If this field is null or set to 0, then the user id will default to the logged in user.", "1-3": "The UTC offset of the time frame to query for. This is used specifically for returning the number events in the last day." }, "cols": 4, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Returning user count object" } [/block] [block:parameters] { "data": { "0-0": "notifications", "h-0": "Name", "h-1": "Description", "1-0": "bookmarks", "2-0": "cases", "3-0": "workcases", "4-0": "events", "5-0": "tour", "0-1": "The number of notifications / alerts the user currently has.", "1-1": "The number of bookmarks the user has. i.e. Companies, Contacts, views, etc..", "2-1": "The number of cases the user currently owns.", "3-1": "The number of cases within the users work queues.", "4-1": "The number of events for today that has not passed. **The UTC Offset is important for this to work correctly for your time zone.**", "5-1": "If the tours have been completed." }, "cols": 2, "rows": 6 } [/block]
{"_id":"58351c8961b4300f0032e6cb","link_url":"","sync_unique":"","title":"User Notifications","type":"get","user":"565416cace43aa21002b2566","slug":"user-notifications","api":{"settings":"","url":"/user/notifications/:id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var notification_data = null;\nvar user_id = '0'; //If left as 0 or null, the logged in user will be returned\n\n$.ajax({\n    url: 'https://api.supportbench.net/user/notifications/' + user_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        }\n    }\n});","language":"javascript"}]},"method":"get","params":[{"in":"path","required":false,"desc":"The user id to return notifications for","default":"0","type":"string","name":"id","_id":"58352e90501f060f001f53ef","ref":""}],"results":{"codes":[{"name":"","code":"{\n    \"id\": \"98765\",    \n    \"notification_id\": \"C-12345\",\n    \"notification_id_type\": \"2\",\n    \"type\": \"3\",\n    \"message\": \"This is a notification\",\n    \"created\": \"01/31/2016 23:45\",\n    \"created_unix\": \"1455255726\",\n    \"ago\": \"1 day(s) ago\"\n}","language":"json","status":200},{"status":400,"name":"","code":"{}","language":"json"}]}},"body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning user notification object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"2-0\": \"notification_id_type\",\n    \"3-0\": \"type\",\n    \"4-0\": \"message\",\n    \"5-0\": \"created\",\n    \"6-0\": \"created_unix\",\n    \"0-1\": \"The unique id of the notification.\",\n    \"2-1\": \"This is the type of id that is being referenced.\\n\\n1 = Activity id\\n2 = Case id\\n3 = Article id\\n4 = Contact id\\n5 = Company id\\n6 = Twitter handle id\\n7 = System message id\\n8 = Message id\",\n    \"3-1\": \"The type of notification that has occurred.\\n\\n1 = System wide message\\n2 = User notification\\n3 = Case watcher notification\\n4 = Company watcher notification\\n5 = Contact watcher notification\\n6 = Queue watcher notification\\n7 = Article watcher notification\\n8 = Forum watcher notification\\n9 = Team message\\n10 = Global message\\n11 = Twitter handle notification\",\n    \"4-1\": \"The notification content.\",\n    \"5-1\": \"The date the notification was sent.\",\n    \"6-1\": \"The date the notification was sent as a UNIX time stamp.\",\n    \"1-1\": \"The id of the notification.  This could be a case number, article, company, contact, etc ..\",\n    \"1-0\": \"notification_id\",\n    \"7-0\": \"ago\",\n    \"7-1\": \"The time difference as a readable string since the notification was received.\"\n  },\n  \"cols\": 2,\n  \"rows\": 8\n}\n[/block]","createdAt":"2016-11-23T04:35:21.580Z","hidden":false,"next":{"description":"","pages":[]},"project":"565416f3ac09cc2100feb2d5","category":"56bd262dac1c5c1900b2dbf9","githubsync":"","parentDoc":null,"updates":[],"__v":1,"excerpt":"","isReference":true,"link_external":false,"order":1,"version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

getUser Notifications


Path Params

id:
string0
The user id to return notifications for
Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning user notification object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "notification_id_type", "3-0": "type", "4-0": "message", "5-0": "created", "6-0": "created_unix", "0-1": "The unique id of the notification.", "2-1": "This is the type of id that is being referenced.\n\n1 = Activity id\n2 = Case id\n3 = Article id\n4 = Contact id\n5 = Company id\n6 = Twitter handle id\n7 = System message id\n8 = Message id", "3-1": "The type of notification that has occurred.\n\n1 = System wide message\n2 = User notification\n3 = Case watcher notification\n4 = Company watcher notification\n5 = Contact watcher notification\n6 = Queue watcher notification\n7 = Article watcher notification\n8 = Forum watcher notification\n9 = Team message\n10 = Global message\n11 = Twitter handle notification", "4-1": "The notification content.", "5-1": "The date the notification was sent.", "6-1": "The date the notification was sent as a UNIX time stamp.", "1-1": "The id of the notification. This could be a case number, article, company, contact, etc ..", "1-0": "notification_id", "7-0": "ago", "7-1": "The time difference as a readable string since the notification was received." }, "cols": 2, "rows": 8 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning user notification object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "notification_id_type", "3-0": "type", "4-0": "message", "5-0": "created", "6-0": "created_unix", "0-1": "The unique id of the notification.", "2-1": "This is the type of id that is being referenced.\n\n1 = Activity id\n2 = Case id\n3 = Article id\n4 = Contact id\n5 = Company id\n6 = Twitter handle id\n7 = System message id\n8 = Message id", "3-1": "The type of notification that has occurred.\n\n1 = System wide message\n2 = User notification\n3 = Case watcher notification\n4 = Company watcher notification\n5 = Contact watcher notification\n6 = Queue watcher notification\n7 = Article watcher notification\n8 = Forum watcher notification\n9 = Team message\n10 = Global message\n11 = Twitter handle notification", "4-1": "The notification content.", "5-1": "The date the notification was sent.", "6-1": "The date the notification was sent as a UNIX time stamp.", "1-1": "The id of the notification. This could be a case number, article, company, contact, etc ..", "1-0": "notification_id", "7-0": "ago", "7-1": "The time difference as a readable string since the notification was received." }, "cols": 2, "rows": 8 } [/block]
{"_id":"56bd6fb9d1fb1323003fda85","next":{"description":"","pages":[]},"order":2,"sync_unique":"","__v":3,"createdAt":"2016-02-12T05:38:01.260Z","githubsync":"","isReference":true,"project":"565416f3ac09cc2100feb2d5","title":"User Notifications Since X Date","updates":[],"user":"565416cace43aa21002b2566","editedParams":true,"excerpt":"","body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning user notification object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"2-0\": \"notification_id_type\",\n    \"3-0\": \"type\",\n    \"4-0\": \"message\",\n    \"5-0\": \"created\",\n    \"6-0\": \"created_unix\",\n    \"0-1\": \"The unique id of the notification.\",\n    \"2-1\": \"This is the type of id that is being referenced.\\n\\n1 = Activity id\\n2 = Case id\\n3 = Article id\\n4 = Contact id\\n5 = Company id\\n6 = Twitter handle id\\n7 = System message id\\n8 = Message id\",\n    \"3-1\": \"The type of notification that has occurred.\\n\\n1 = System wide message\\n2 = User notification\\n3 = Case watcher notification\\n4 = Company watcher notification\\n5 = Contact watcher notification\\n6 = Queue watcher notification\\n7 = Article watcher notification\\n8 = Forum watcher notification\\n9 = Team message\\n10 = Global message\\n11 = Twitter handle notification\",\n    \"4-1\": \"The notification content.\",\n    \"5-1\": \"The date the notification was sent.\",\n    \"6-1\": \"The date the notification was sent as a UNIX time stamp.\",\n    \"1-1\": \"The id of the notification.  This could be a case number, article, company, contact, etc ..\",\n    \"1-0\": \"notification_id\",\n    \"7-0\": \"ago\",\n    \"7-1\": \"The time difference as a readable string since the notification was received.\"\n  },\n  \"cols\": 2,\n  \"rows\": 8\n}\n[/block]","hidden":false,"link_external":false,"link_url":"","api":{"params":[],"results":{"codes":[{"name":"","code":"{\n    \"id\": \"98765\",    \n    \"notification_id\": \"C-12345\",\n    \"notification_id_type\": \"2\",\n    \"type\": \"3\",\n    \"message\": \"This is a notification\",\n    \"created\": \"01/31/2016 23:45\",\n    \"created_unix\": \"1455255726\",\n    \"ago\": \"1 day(s) ago\"\n}","language":"json","status":200},{"language":"json","status":400,"name":"","code":"{}"}]},"settings":"","url":"/user/notifications/since","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var notification_data = null;\nvar query_args = {\n    \"user_id\": \"1256\", //The user id to query or leave empty to retuen the logged in user\n    \"date_time\": \"01/30/2017 09:00:00\" //UTC date in the format MM/dd/yyyy hh:mm\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/user/notifications/since',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(query_args),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        notification_data = jQuery.parseJSON(r);\n    }\n});","language":"javascript"}]},"method":"post"},"parentDoc":null,"slug":"user-notifications-since-x-date","type":"post","version":"565416f4ac09cc2100feb2d8","category":"56bd262dac1c5c1900b2dbf9","editedParams2":true,"childrenPages":[]}

postUser Notifications Since X Date


Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning user notification object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "notification_id_type", "3-0": "type", "4-0": "message", "5-0": "created", "6-0": "created_unix", "0-1": "The unique id of the notification.", "2-1": "This is the type of id that is being referenced.\n\n1 = Activity id\n2 = Case id\n3 = Article id\n4 = Contact id\n5 = Company id\n6 = Twitter handle id\n7 = System message id\n8 = Message id", "3-1": "The type of notification that has occurred.\n\n1 = System wide message\n2 = User notification\n3 = Case watcher notification\n4 = Company watcher notification\n5 = Contact watcher notification\n6 = Queue watcher notification\n7 = Article watcher notification\n8 = Forum watcher notification\n9 = Team message\n10 = Global message\n11 = Twitter handle notification", "4-1": "The notification content.", "5-1": "The date the notification was sent.", "6-1": "The date the notification was sent as a UNIX time stamp.", "1-1": "The id of the notification. This could be a case number, article, company, contact, etc ..", "1-0": "notification_id", "7-0": "ago", "7-1": "The time difference as a readable string since the notification was received." }, "cols": 2, "rows": 8 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning user notification object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "notification_id_type", "3-0": "type", "4-0": "message", "5-0": "created", "6-0": "created_unix", "0-1": "The unique id of the notification.", "2-1": "This is the type of id that is being referenced.\n\n1 = Activity id\n2 = Case id\n3 = Article id\n4 = Contact id\n5 = Company id\n6 = Twitter handle id\n7 = System message id\n8 = Message id", "3-1": "The type of notification that has occurred.\n\n1 = System wide message\n2 = User notification\n3 = Case watcher notification\n4 = Company watcher notification\n5 = Contact watcher notification\n6 = Queue watcher notification\n7 = Article watcher notification\n8 = Forum watcher notification\n9 = Team message\n10 = Global message\n11 = Twitter handle notification", "4-1": "The notification content.", "5-1": "The date the notification was sent.", "6-1": "The date the notification was sent as a UNIX time stamp.", "1-1": "The id of the notification. This could be a case number, article, company, contact, etc ..", "1-0": "notification_id", "7-0": "ago", "7-1": "The time difference as a readable string since the notification was received." }, "cols": 2, "rows": 8 } [/block]
{"_id":"581e4819a1ae5219000ef87c","order":3,"title":"Add History Item","type":"post","__v":0,"hidden":false,"isReference":true,"link_external":false,"next":{"pages":[],"description":""},"project":"565416f3ac09cc2100feb2d5","slug":"add-history-item","sync_unique":"","updates":[],"version":"565416f4ac09cc2100feb2d8","category":"56bd262dac1c5c1900b2dbf9","createdAt":"2016-11-05T20:59:05.885Z","githubsync":"","link_url":"","parentDoc":null,"user":"565416cace43aa21002b2566","api":{"method":"post","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\"id\":123456}","name":""},{"status":400,"language":"json","code":"{\"id\":0}","name":""}]},"settings":"","url":"/user/history","auth":"required","examples":{"codes":[{"language":"javascript","code":"var item_id = null;\nvar history_data = {\n  \t\"type_id\":\"1\",\n    \"item_id\":\"C-123456\", //required id of the item\n  \t\"user_id\":\"5000\" //Who to add this history item to\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/user/history',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(history_data),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        item_id = jQuery.parseJSON(r).id;\n    }\n});","name":"jQuery"}]}},"body":"A user history item will be recorded for the user.  This history item will be available in the users recent history.  \n\nNote: When calling this function, the objects alerts for the user will be cleared for that item as well.\n\nThe following arguments must be filled in.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Limit\",\n    \"h-3\": \"Default\",\n    \"h-4\": \"Availability\",\n    \"0-0\": \"type_id\",\n    \"2-0\": \"user_id\",\n    \"0-1\": \"**yes** \",\n    \"2-1\": \"no\",\n    \"0-2\": \"Integer\",\n    \"0-3\": \"-\",\n    \"2-3\": \"-\",\n    \"0-4\": \"New\",\n    \"2-4\": \"New\",\n    \"2-2\": \"Integer\",\n    \"h-5\": \"Summary\",\n    \"2-5\": \"The id of the user you want to assign this history item to.  If left blank, this will default to the logged in user.\",\n    \"0-5\": \"The type of history item this is.  The following values are allowed:\\n\\n0 = Case item\\n1 = Company item\\n2 = Contact item\\n3 = Article item\",\n    \"1-0\": \"item_id\",\n    \"1-1\": \"**yes**\",\n    \"1-2\": \"25 characters\",\n    \"1-3\": \"-\",\n    \"1-4\": \"New\",\n    \"1-5\": \"The id of the history item defined by the type_id above.\"\n  },\n  \"cols\": 6,\n  \"rows\": 3\n}\n[/block]","excerpt":"Create a new history based item for the user.","childrenPages":[]}

postAdd History Item

Create a new history based item for the user.

A user history item will be recorded for the user. This history item will be available in the users recent history. Note: When calling this function, the objects alerts for the user will be cleared for that item as well. The following arguments must be filled in. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "type_id", "2-0": "user_id", "0-1": "**yes** ", "2-1": "no", "0-2": "Integer", "0-3": "-", "2-3": "-", "0-4": "New", "2-4": "New", "2-2": "Integer", "h-5": "Summary", "2-5": "The id of the user you want to assign this history item to. If left blank, this will default to the logged in user.", "0-5": "The type of history item this is. The following values are allowed:\n\n0 = Case item\n1 = Company item\n2 = Contact item\n3 = Article item", "1-0": "item_id", "1-1": "**yes**", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The id of the history item defined by the type_id above." }, "cols": 6, "rows": 3 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



A user history item will be recorded for the user. This history item will be available in the users recent history. Note: When calling this function, the objects alerts for the user will be cleared for that item as well. The following arguments must be filled in. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Limit", "h-3": "Default", "h-4": "Availability", "0-0": "type_id", "2-0": "user_id", "0-1": "**yes** ", "2-1": "no", "0-2": "Integer", "0-3": "-", "2-3": "-", "0-4": "New", "2-4": "New", "2-2": "Integer", "h-5": "Summary", "2-5": "The id of the user you want to assign this history item to. If left blank, this will default to the logged in user.", "0-5": "The type of history item this is. The following values are allowed:\n\n0 = Case item\n1 = Company item\n2 = Contact item\n3 = Article item", "1-0": "item_id", "1-1": "**yes**", "1-2": "25 characters", "1-3": "-", "1-4": "New", "1-5": "The id of the history item defined by the type_id above." }, "cols": 6, "rows": 3 } [/block]
{"_id":"5802abcf128cba2d00c43123","user":"565416cace43aa21002b2566","__v":0,"excerpt":"","isReference":true,"link_external":false,"project":"565416f3ac09cc2100feb2d5","type":"get","body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning user notification object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"1-0\": \"type_id\",\n    \"2-0\": \"summary\",\n    \"3-0\": \"created\",\n    \"4-0\": \"created_unix\",\n    \"0-1\": \"The id of the history item.  This could be the case id, company id, contact id, or article id\",\n    \"1-1\": \"This is the type of id that is being referenced.\\n\\n0 = Case id\\n1 = Company id\\n2 = Contact id\\n3 = Article id\\n4 = System setting id\",\n    \"2-1\": \"The summary of the item.\",\n    \"3-1\": \"The date the item was accessed.\",\n    \"4-1\": \"The date the item was accessed as a UNIX time stamp.\",\n    \"5-0\": \"ago\",\n    \"5-1\": \"The time difference as a readable string since the item was viewed.\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]","createdAt":"2016-10-15T22:21:03.998Z","hidden":false,"order":4,"updates":[],"category":"56bd262dac1c5c1900b2dbf9","githubsync":"","parentDoc":null,"slug":"user-history","title":"User History","api":{"method":"get","params":[{"desc":"The user id to return the history for","default":"0","type":"string","name":"id","_id":"56bd6fb9d1fb1323003fda86","ref":"","in":"path","required":false}],"results":{"codes":[{"name":"","code":"[{\n    \"id\": \"c-10000\",    \n    \"summary\": \"This is the case subject\",\n    \"type_id\": \"2\",\n    \"created\": \"12/31/2016 23:45\",\n    \"created_unix\": \"1455255726\",\n    \"ago\": \"1 day(s) ago\"\n},\n{\n    \"id\": \"cp-1000\",    \n    \"summary\": \"My company\",\n    \"created\": \"12/30/2016 23:45\",\n    \"created_unix\": \"1455252526\",\n    \"ago\": \"2 day(s) ago\"\n}]","language":"json","status":200},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":"","url":"/user/history/:id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var notification_data = null;\nvar user_id = '0'; //If left as 0 or null, the logged in user will be returned\n\n$.ajax({\n    url: 'https://api.supportbench.net/user/notifications/' + user_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        }\n    }\n});","language":"javascript"}]}},"link_url":"","sync_unique":"","version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

getUser History


Path Params

id:
string0
The user id to return the history for
Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning user notification object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "1-0": "type_id", "2-0": "summary", "3-0": "created", "4-0": "created_unix", "0-1": "The id of the history item. This could be the case id, company id, contact id, or article id", "1-1": "This is the type of id that is being referenced.\n\n0 = Case id\n1 = Company id\n2 = Contact id\n3 = Article id\n4 = System setting id", "2-1": "The summary of the item.", "3-1": "The date the item was accessed.", "4-1": "The date the item was accessed as a UNIX time stamp.", "5-0": "ago", "5-1": "The time difference as a readable string since the item was viewed." }, "cols": 2, "rows": 6 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning user notification object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "1-0": "type_id", "2-0": "summary", "3-0": "created", "4-0": "created_unix", "0-1": "The id of the history item. This could be the case id, company id, contact id, or article id", "1-1": "This is the type of id that is being referenced.\n\n0 = Case id\n1 = Company id\n2 = Contact id\n3 = Article id\n4 = System setting id", "2-1": "The summary of the item.", "3-1": "The date the item was accessed.", "4-1": "The date the item was accessed as a UNIX time stamp.", "5-0": "ago", "5-1": "The time difference as a readable string since the item was viewed." }, "cols": 2, "rows": 6 } [/block]
{"_id":"56be5173c6f8710d002b7ac8","createdAt":"2016-02-12T21:41:07.876Z","isReference":true,"title":"User Notification Delete","project":"565416f3ac09cc2100feb2d5","slug":"user-notification-delete","sync_unique":"","__v":0,"category":"56bd262dac1c5c1900b2dbf9","editedParams":true,"excerpt":"","hidden":false,"version":"565416f4ac09cc2100feb2d8","updates":[],"body":"Delete a notification from your Bench.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning notification delete object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"success\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The unique id of the notification.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]","editedParams2":true,"githubsync":"","link_external":false,"type":"delete","user":"565416cace43aa21002b2566","api":{"params":[{"in":"path","_id":"56bd6fb9d1fb1323003fda86","required":false,"desc":"The id of the notification to delete","default":"0","type":"string","name":"id"}],"results":{"codes":[{"name":"","code":"{\n    \"success\": \"true\"\n}","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/user/notification/:id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var notification_data = null;\nvar notification_id = '123456';\n\n$.ajax({\n    url: 'https://api.supportbench.net/user/notification/' + notification_id,\n    type: 'delete',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n          alert(r.success);        \n    }\n});","language":"javascript"}]},"method":"delete"},"link_url":"","order":5,"parentDoc":null,"childrenPages":[]}

deleteUser Notification Delete


Path Params

id:
string0
The id of the notification to delete
Delete a notification from your Bench. [block:api-header] { "type": "basic", "title": "Returning notification delete object" } [/block] [block:parameters] { "data": { "0-0": "success", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the notification." }, "cols": 2, "rows": 1 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Delete a notification from your Bench. [block:api-header] { "type": "basic", "title": "Returning notification delete object" } [/block] [block:parameters] { "data": { "0-0": "success", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the notification." }, "cols": 2, "rows": 1 } [/block]
{"_id":"56be58723d39ac170039b1b3","excerpt":"","link_external":false,"parentDoc":null,"slug":"user-work-queues","isReference":true,"order":6,"project":"565416f3ac09cc2100feb2d5","body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning work queue object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The queue id of the queue the user is part of.\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]","category":"56bd262dac1c5c1900b2dbf9","createdAt":"2016-02-12T22:10:58.673Z","editedParams":true,"githubsync":"","title":"User Work Queues","updates":[],"api":{"method":"get","params":[{"type":"string","name":"id","in":"path","_id":"56bd6fb9d1fb1323003fda86","required":false,"desc":"The user id to return the work queues for","default":"0"}],"results":{"codes":[{"name":"","code":"[\n  {\"id\": \"123456\"},\n  {\"id\": \"987654\"},\n  {\"id\": \"9874563\"}\n]","language":"json","status":200},{"code":"{}","language":"json","status":400,"name":""}]},"settings":"","url":"/user/workqueues/:id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var user_id = '0'; //If left as 0 or null, the logged in user will be returned\n\n$.ajax({\n    url: 'https://api.supportbench.net/user/workqueues/' + user_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript"}]}},"hidden":false,"link_url":"","user":"565416cace43aa21002b2566","__v":0,"editedParams2":true,"sync_unique":"","type":"get","version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

getUser Work Queues


Path Params

id:
string0
The user id to return the work queues for
Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning work queue object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The queue id of the queue the user is part of." }, "cols": 2, "rows": 1 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning work queue object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The queue id of the queue the user is part of." }, "cols": 2, "rows": 1 } [/block]
{"_id":"56c37c8de1e4190d003429a0","updates":[],"__v":0,"api":{"auth":"required","examples":{"codes":[{"name":"jQuery","code":"var list_data = null;\nvar team_id = '0'; //If left as 0 or null, all agents will be returned\n\n$.ajax({\n    url: 'https://api.supportbench.net/users/' + team_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript"}]},"method":"get","params":[{"ref":"","required":false,"type":"string","in":"path","_id":"56bd6fb9d1fb1323003fda86","default":"0","desc":"The team id to filter for","name":"team_id"}],"results":{"codes":[{"name":"","code":"[{\n    \"id\": \"57\",    \n    \"username\":\"joe@domain.com\",\n    \"name\": \"Joe the Manager\",\n    \"parent_id\": \"0\",\n    \"level\":\"0\"\n},{\n    \"id\": \"56\",   \n    \"username\":\"john@domain.com\",\n    \"name\": \"John Snow\",\n    \"parent_id\": \"57\",\n  \t\"level\": \"1\"\n}]","language":"json","status":200},{"code":"{}","language":"json","status":400,"name":""}]},"settings":"","url":"/users/:team_id"},"category":"56bd262dac1c5c1900b2dbf9","createdAt":"2016-02-16T19:46:21.052Z","sync_unique":"","type":"get","body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"2-0\": \"parent_id\",\n    \"0-1\": \"The unique id of the agent.\",\n    \"2-1\": \"The parent id of the agent.  This typically is the agent's manager.\",\n    \"1-1\": \"The full name of the agent.\",\n    \"1-0\": \"name\",\n    \"3-0\": \"level\",\n    \"3-1\": \"The hierarchy level of the agent.\",\n    \"4-0\": \"username\",\n    \"4-1\": \"The username / email of the user.\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]","excerpt":"","githubsync":"","parentDoc":null,"title":"User List","link_external":false,"link_url":"","project":"565416f3ac09cc2100feb2d5","slug":"user-list","user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","editedParams":true,"editedParams2":true,"hidden":false,"isReference":true,"order":7,"childrenPages":[]}

getUser List


Path Params

team_id:
string0
The team id to filter for
Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "parent_id", "0-1": "The unique id of the agent.", "2-1": "The parent id of the agent. This typically is the agent's manager.", "1-1": "The full name of the agent.", "1-0": "name", "3-0": "level", "3-1": "The hierarchy level of the agent.", "4-0": "username", "4-1": "The username / email of the user." }, "cols": 2, "rows": 5 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "parent_id", "0-1": "The unique id of the agent.", "2-1": "The parent id of the agent. This typically is the agent's manager.", "1-1": "The full name of the agent.", "1-0": "name", "3-0": "level", "3-1": "The hierarchy level of the agent.", "4-0": "username", "4-1": "The username / email of the user." }, "cols": 2, "rows": 5 } [/block]
{"_id":"56bfc8c6d991050d005fa1af","__v":4,"api":{"url":"/calendar/events","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var event_data = null;\nvar query_args = {\n    \"start_date\": \"01/31/2016 00:00\", //When to start searching in UTC\n    \"end_date\": \"06/31/2016 00:00\",  //When to end searching in UTC    \n    \"category_ids\": \"\", //The calendar categories ids to return events for\n    \"user_ids\": \"\", //The user ids of the user calendars to return events for\n    \"team_ids\": \"\", //The team ids of the team calendars to return events for\n    \"calendar_ids\": \"\", //The calendar ids of the calendars to return events for\n    \"case_id\": \"\" //The case id to return events for\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/calendar/events',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(query_args),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        event_data = jQuery.parseJSON(r);\n    }\n});","language":"javascript"}]},"method":"post","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{\n    \"id\": \"1234\",\n    \"subject\": \"My event\",\n    \"summary\": \"This was my event\",\n    \"user_id\": \"5\",\n    \"team_id\": \"\",\n    \"calendar_id\": \"\",\n    \"case_id\": \"\",\n    \"category_id\": \"45\",\n    \"start\": \"01/25/2016 13:30\",\n    \"start_unix\": \"1455410191\",    \n    \"starts_in\": \"in 1.2 hour(s)\",\n    \"end\": \"01/25/2016 14:00\",\n    \"end_unix\": \"1455410899\",\n  \t\"is_past\":true,\n    \"duration\": \"30\",\n    \"all_day\": \"0\",\n    \"color\": \"#ff700e\",\n    \"created\": \"12/30/2015 23:25\",\n    \"created_unix\": \"1458410299\"\n}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":""},"hidden":false,"project":"565416f3ac09cc2100feb2d5","type":"post","category":"56bfc88e8a7e180d0059c51c","createdAt":"2016-02-14T00:22:30.891Z","githubsync":"","order":0,"sync_unique":"","title":"Calendar Events","version":"565416f4ac09cc2100feb2d8","link_url":"","parentDoc":null,"slug":"calendar-events","updates":[],"user":"565416cace43aa21002b2566","body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Options to query for events\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Usage\",\n    \"h-2\": \"Default\",\n    \"0-0\": \"start_date\",\n    \"0-1\": \"\\\"01/31/2016 00:00\\\"\",\n    \"0-2\": \"-1 day from now\",\n    \"1-0\": \"end_date\",\n    \"1-1\": \"\\\"02/15/2016 00:00\\\"\",\n    \"1-2\": \"+6 months from now\",\n    \"h-3\": \"Description\",\n    \"0-3\": \"The start date of events to return.\",\n    \"1-3\": \"The end date of events to return.\",\n    \"2-0\": \"category_ids\",\n    \"3-0\": \"user_ids\",\n    \"4-0\": \"team_ids\",\n    \"5-0\": \"calendar_ids\",\n    \"6-0\": \"case_id\",\n    \"2-1\": \"12,15,19\",\n    \"2-2\": \"-\",\n    \"2-3\": \"The event category id's.\",\n    \"3-1\": \"1,2\",\n    \"3-2\": \"-\",\n    \"3-3\": \"The user id's of the user calendars you want to return.\",\n    \"4-1\": \"45,78\",\n    \"4-2\": \"-\",\n    \"4-3\": \"The team id's of the team calendars you want to return.\",\n    \"5-3\": \"The calendar id's of the calendars you want to return.\",\n    \"5-2\": \"-\",\n    \"5-1\": \"23,14,78,89\",\n    \"6-1\": \"c-123456\",\n    \"6-2\": \"-\",\n    \"6-3\": \"The events of a given case id.\"\n  },\n  \"cols\": 4,\n  \"rows\": 7\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning calendar event object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"1-0\": \"subject\",\n    \"2-0\": \"summary\",\n    \"3-0\": \"user_id\",\n    \"4-0\": \"team_id\",\n    \"5-0\": \"calendar_id\",\n    \"0-1\": \"The unique id of the event.\",\n    \"1-1\": \"The subject / name of the event.\",\n    \"2-1\": \"The summary of the event.\",\n    \"3-1\": \"The user id assigned to the event.\",\n    \"4-1\": \"The team id assigned to the event.\",\n    \"5-1\": \"The calendar id assigned to the event.\",\n    \"6-0\": \"case_id\",\n    \"7-0\": \"category_id\",\n    \"8-0\": \"start\",\n    \"9-0\": \"start_unix\",\n    \"11-0\": \"end\",\n    \"12-0\": \"end_unix\",\n    \"14-0\": \"duration\",\n    \"15-0\": \"all_day\",\n    \"16-0\": \"color\",\n    \"17-0\": \"created\",\n    \"18-0\": \"created_unix\",\n    \"6-1\": \"The case id assigned to the event.\",\n    \"7-1\": \"The category id assigned to the event.\",\n    \"8-1\": \"The UTC start date and time of the event.\",\n    \"9-1\": \"The UTC start date and time of the event as a UNIX time stamp.\",\n    \"12-1\": \"The UTC end date and time of the event as a UNIX time stamp.\",\n    \"11-1\": \"The UTC end date and time of the event.\",\n    \"14-1\": \"The duration of the event in minutes.\",\n    \"15-1\": \"if this is this an all day event.\",\n    \"16-1\": \"The hex color of the event if assigned.\",\n    \"17-1\": \"The date this event was created.\",\n    \"18-1\": \"The date this event was created as a UNIX time stamp.\",\n    \"10-0\": \"starts_in\",\n    \"10-1\": \"The readable time of when the event starts. i.e. \\n- in 1.2 hour(s) (if in the future)\\n- 25.3 day(s) ago (if in the past)\",\n    \"13-0\": \"is_past\",\n    \"13-1\": \"Return a Boolean of whether this event has already past or not.\"\n  },\n  \"cols\": 2,\n  \"rows\": 19\n}\n[/block]","excerpt":"","isReference":true,"link_external":false,"childrenPages":[]}

postCalendar Events


Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Options to query for events" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Usage", "h-2": "Default", "0-0": "start_date", "0-1": "\"01/31/2016 00:00\"", "0-2": "-1 day from now", "1-0": "end_date", "1-1": "\"02/15/2016 00:00\"", "1-2": "+6 months from now", "h-3": "Description", "0-3": "The start date of events to return.", "1-3": "The end date of events to return.", "2-0": "category_ids", "3-0": "user_ids", "4-0": "team_ids", "5-0": "calendar_ids", "6-0": "case_id", "2-1": "12,15,19", "2-2": "-", "2-3": "The event category id's.", "3-1": "1,2", "3-2": "-", "3-3": "The user id's of the user calendars you want to return.", "4-1": "45,78", "4-2": "-", "4-3": "The team id's of the team calendars you want to return.", "5-3": "The calendar id's of the calendars you want to return.", "5-2": "-", "5-1": "23,14,78,89", "6-1": "c-123456", "6-2": "-", "6-3": "The events of a given case id." }, "cols": 4, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "Returning calendar event object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "1-0": "subject", "2-0": "summary", "3-0": "user_id", "4-0": "team_id", "5-0": "calendar_id", "0-1": "The unique id of the event.", "1-1": "The subject / name of the event.", "2-1": "The summary of the event.", "3-1": "The user id assigned to the event.", "4-1": "The team id assigned to the event.", "5-1": "The calendar id assigned to the event.", "6-0": "case_id", "7-0": "category_id", "8-0": "start", "9-0": "start_unix", "11-0": "end", "12-0": "end_unix", "14-0": "duration", "15-0": "all_day", "16-0": "color", "17-0": "created", "18-0": "created_unix", "6-1": "The case id assigned to the event.", "7-1": "The category id assigned to the event.", "8-1": "The UTC start date and time of the event.", "9-1": "The UTC start date and time of the event as a UNIX time stamp.", "12-1": "The UTC end date and time of the event as a UNIX time stamp.", "11-1": "The UTC end date and time of the event.", "14-1": "The duration of the event in minutes.", "15-1": "if this is this an all day event.", "16-1": "The hex color of the event if assigned.", "17-1": "The date this event was created.", "18-1": "The date this event was created as a UNIX time stamp.", "10-0": "starts_in", "10-1": "The readable time of when the event starts. i.e. \n- in 1.2 hour(s) (if in the future)\n- 25.3 day(s) ago (if in the past)", "13-0": "is_past", "13-1": "Return a Boolean of whether this event has already past or not." }, "cols": 2, "rows": 19 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Options to query for events" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Usage", "h-2": "Default", "0-0": "start_date", "0-1": "\"01/31/2016 00:00\"", "0-2": "-1 day from now", "1-0": "end_date", "1-1": "\"02/15/2016 00:00\"", "1-2": "+6 months from now", "h-3": "Description", "0-3": "The start date of events to return.", "1-3": "The end date of events to return.", "2-0": "category_ids", "3-0": "user_ids", "4-0": "team_ids", "5-0": "calendar_ids", "6-0": "case_id", "2-1": "12,15,19", "2-2": "-", "2-3": "The event category id's.", "3-1": "1,2", "3-2": "-", "3-3": "The user id's of the user calendars you want to return.", "4-1": "45,78", "4-2": "-", "4-3": "The team id's of the team calendars you want to return.", "5-3": "The calendar id's of the calendars you want to return.", "5-2": "-", "5-1": "23,14,78,89", "6-1": "c-123456", "6-2": "-", "6-3": "The events of a given case id." }, "cols": 4, "rows": 7 } [/block] [block:api-header] { "type": "basic", "title": "Returning calendar event object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "1-0": "subject", "2-0": "summary", "3-0": "user_id", "4-0": "team_id", "5-0": "calendar_id", "0-1": "The unique id of the event.", "1-1": "The subject / name of the event.", "2-1": "The summary of the event.", "3-1": "The user id assigned to the event.", "4-1": "The team id assigned to the event.", "5-1": "The calendar id assigned to the event.", "6-0": "case_id", "7-0": "category_id", "8-0": "start", "9-0": "start_unix", "11-0": "end", "12-0": "end_unix", "14-0": "duration", "15-0": "all_day", "16-0": "color", "17-0": "created", "18-0": "created_unix", "6-1": "The case id assigned to the event.", "7-1": "The category id assigned to the event.", "8-1": "The UTC start date and time of the event.", "9-1": "The UTC start date and time of the event as a UNIX time stamp.", "12-1": "The UTC end date and time of the event as a UNIX time stamp.", "11-1": "The UTC end date and time of the event.", "14-1": "The duration of the event in minutes.", "15-1": "if this is this an all day event.", "16-1": "The hex color of the event if assigned.", "17-1": "The date this event was created.", "18-1": "The date this event was created as a UNIX time stamp.", "10-0": "starts_in", "10-1": "The readable time of when the event starts. i.e. \n- in 1.2 hour(s) (if in the future)\n- 25.3 day(s) ago (if in the past)", "13-0": "is_past", "13-1": "Return a Boolean of whether this event has already past or not." }, "cols": 2, "rows": 19 } [/block]
{"_id":"56c37e843d30210d00ea84cd","isReference":true,"parentDoc":null,"updates":[],"version":"565416f4ac09cc2100feb2d8","__v":0,"category":"56c37ef3d1f6d91700d3692d","githubsync":"","order":0,"link_external":false,"slug":"queue-list","title":"Queue List","body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"2-0\": \"parent_id\",\n    \"0-1\": \"The unique id of the agent.\",\n    \"2-1\": \"The parent id of the agent.  This typically is the agent's manager.\",\n    \"1-1\": \"The full name of the agent.\",\n    \"1-0\": \"name\",\n    \"3-0\": \"level\",\n    \"3-1\": \"The hierarchy level of the queue.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]","editedParams2":true,"hidden":false,"excerpt":"","link_url":"","project":"565416f3ac09cc2100feb2d5","sync_unique":"","type":"get","api":{"settings":"","url":"/queues/:team_id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var list_data = null;\nvar team_id = '0'; //If left as 0 or null, all queues will be returned\n\n$.ajax({\n    url: 'https://api.supportbench.net/queues/' + team_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript"}]},"method":"get","params":[{"desc":"The team id to filter for","default":"0","type":"string","name":"team_id","in":"path","_id":"56bd6fb9d1fb1323003fda86","required":false}],"results":{"codes":[{"name":"","code":"[{\n    \"id\": \"56\",    \n    \"name\": \"Escalations 1\",\n    \"parent_id\": \"0\",\n  \t\"level\": \"0\"\n},{\n    \"id\": \"57\",    \n    \"name\": \"Escalations 2\",\n    \"parent_id\": \"56\",\n    \"level\":\"1\"\n}]","language":"json","status":200},{"code":"{}","language":"json","status":400,"name":""}]}},"createdAt":"2016-02-16T19:54:44.161Z","editedParams":true,"user":"565416cace43aa21002b2566","childrenPages":[]}

getQueue List


Path Params

team_id:
string0
The team id to filter for
Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "parent_id", "0-1": "The unique id of the agent.", "2-1": "The parent id of the agent. This typically is the agent's manager.", "1-1": "The full name of the agent.", "1-0": "name", "3-0": "level", "3-1": "The hierarchy level of the queue." }, "cols": 2, "rows": 4 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "2-0": "parent_id", "0-1": "The unique id of the agent.", "2-1": "The parent id of the agent. This typically is the agent's manager.", "1-1": "The full name of the agent.", "1-0": "name", "3-0": "level", "3-1": "The hierarchy level of the queue." }, "cols": 2, "rows": 4 } [/block]
{"_id":"56c6a88a197f9f1700c8119c","project":"565416f3ac09cc2100feb2d5","title":"Return States","body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The unique id of the state.\",\n    \"1-1\": \"The name of the state.\",\n    \"1-0\": \"name\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]","category":"56c37ef3d1f6d91700d3692d","editedParams":true,"isReference":true,"order":1,"parentDoc":null,"type":"get","updates":[],"version":"565416f4ac09cc2100feb2d8","__v":0,"api":{"method":"get","params":[{"type":"string","name":"category_id","in":"path","_id":"56bd6fb9d1fb1323003fda86","required":false,"desc":"The category id to filter for","default":"0"}],"results":{"codes":[{"name":"","code":"[{\n    \"id\": \"1\",    \n    \"name\": \"Active\"\n},{\n    \"id\": \"2\",    \n    \"name\": \"Waiting on customer\n}]","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/states/:category_id","auth":"required","examples":{"codes":[{"code":"var list_data = null;\nvar category_id = '0'; //If left as 0 or null, all states will be returned\n\n$.ajax({\n    url: 'https://api.supportbench.net/states/' + category_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript","name":"jQuery"}]}},"hidden":false,"link_url":"","slug":"state-list","user":"565416cace43aa21002b2566","createdAt":"2016-02-19T05:30:50.023Z","editedParams2":true,"excerpt":"","link_external":false,"githubsync":"","sync_unique":"","childrenPages":[]}

getReturn States


Path Params

category_id:
string0
The category id to filter for
Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the state.", "1-1": "The name of the state.", "1-0": "name" }, "cols": 2, "rows": 2 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the state.", "1-1": "The name of the state.", "1-0": "name" }, "cols": 2, "rows": 2 } [/block]
{"_id":"582b70175d913d0f00ce54fd","category":"56d136dd7c2e100b000afa6b","githubsync":"","hidden":false,"link_external":false,"order":0,"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","sync_unique":"","updates":[],"version":"565416f4ac09cc2100feb2d8","excerpt":"","link_url":"","next":{"pages":[],"description":""},"type":"post","user":"565416cace43aa21002b2566","__v":0,"body":"Return a user count for items related to a user.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Options to query the data\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Usage\",\n    \"h-2\": \"Default\",\n    \"0-0\": \"location_id\",\n    \"0-1\": \"1\",\n    \"0-2\": \"**required**\",\n    \"1-0\": \"category_id\",\n    \"1-1\": \"2\",\n    \"1-2\": \"0\",\n    \"h-3\": \"Description\",\n    \"0-3\": \"The location of the fields you are looking for.  The below fields are valid:\\n\\n1 = case fields\\n2 = company fields\\n3 = contact fields\\n4 = article fields\\n5 = asset fields\\n6 = company linked asset fields\\n7 = customer survey fields\",\n    \"1-3\": \"The case category id.  This is used to only return valid fields for a given category id.\"\n  },\n  \"cols\": 4,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning fields object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"1-0\": \"name\",\n    \"2-0\": \"label\",\n    \"3-0\": \"type_id\",\n    \"4-0\": \"type\",\n    \"0-1\": \"The id of the customer field.\",\n    \"1-1\": \"The name of the customer field.\",\n    \"2-1\": \"The label of the custom field.\",\n    \"3-1\": \"The field type id. The current mapping is as follows:\\n\\n1 = Text Box\\n2 = Dropdown list\\n3 = Checkbox\\n4 = Textbox (multi-row)\\n5 = URL\",\n    \"4-1\": \"The field type name.\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]","createdAt":"2016-11-15T20:29:11.276Z","isReference":true,"slug":"fields-1","title":"Fields","api":{"results":{"codes":[{"name":"","code":"[{\n    \"id\": \"10\",\n    \"name\": \"RMA number\",    \n    \"type_id\": \"1\",\n    \"type\": \"Text Box\",\n},\n {\n    \"id\": \"11\",\n    \"name\": \"Serial number\",    \n    \"type_id\": \"4\",\n    \"type\": \"Text Box (multi row)\",\n }]","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/fields","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var field_data = null;\nvar query_args = {\n    \"location_id\": \"5\", //The location of the field\n    \"category_id\": \"0\" //Optional, the case category id\n};\n\n$.ajax({\n    url: 'https://api.supportbench.net/fields',\n    type: 'post',\n    contentType: 'application/json; charset=utf-8',\n    data: JSON.stringify(query_args),\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        field_data = jQuery.parseJSON(r);\n    }\n});","language":"javascript"}]},"method":"post","params":[]},"childrenPages":[]}

postFields


Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Options to query the data" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Usage", "h-2": "Default", "0-0": "location_id", "0-1": "1", "0-2": "**required**", "1-0": "category_id", "1-1": "2", "1-2": "0", "h-3": "Description", "0-3": "The location of the fields you are looking for. The below fields are valid:\n\n1 = case fields\n2 = company fields\n3 = contact fields\n4 = article fields\n5 = asset fields\n6 = company linked asset fields\n7 = customer survey fields", "1-3": "The case category id. This is used to only return valid fields for a given category id." }, "cols": 4, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Returning fields object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "1-0": "name", "2-0": "label", "3-0": "type_id", "4-0": "type", "0-1": "The id of the customer field.", "1-1": "The name of the customer field.", "2-1": "The label of the custom field.", "3-1": "The field type id. The current mapping is as follows:\n\n1 = Text Box\n2 = Dropdown list\n3 = Checkbox\n4 = Textbox (multi-row)\n5 = URL", "4-1": "The field type name." }, "cols": 2, "rows": 5 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user. [block:api-header] { "type": "basic", "title": "Options to query the data" } [/block] [block:parameters] { "data": { "h-0": "Name", "h-1": "Usage", "h-2": "Default", "0-0": "location_id", "0-1": "1", "0-2": "**required**", "1-0": "category_id", "1-1": "2", "1-2": "0", "h-3": "Description", "0-3": "The location of the fields you are looking for. The below fields are valid:\n\n1 = case fields\n2 = company fields\n3 = contact fields\n4 = article fields\n5 = asset fields\n6 = company linked asset fields\n7 = customer survey fields", "1-3": "The case category id. This is used to only return valid fields for a given category id." }, "cols": 4, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Returning fields object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "1-0": "name", "2-0": "label", "3-0": "type_id", "4-0": "type", "0-1": "The id of the customer field.", "1-1": "The name of the customer field.", "2-1": "The label of the custom field.", "3-1": "The field type id. The current mapping is as follows:\n\n1 = Text Box\n2 = Dropdown list\n3 = Checkbox\n4 = Textbox (multi-row)\n5 = URL", "4-1": "The field type name." }, "cols": 2, "rows": 5 } [/block]
{"_id":"56d138d86caee3250087a0fe","__v":0,"hidden":false,"link_external":false,"title":"Return Dropdown Items","type":"get","updates":[],"editedParams":true,"project":"565416f3ac09cc2100feb2d5","slug":"return-dropdown-items","version":"565416f4ac09cc2100feb2d8","api":{"url":"/field/dropdown/items/:field_id","auth":"required","examples":{"codes":[{"code":"var list_data = null;\nvar field_id = 3;\n\n$.ajax({\n    url: 'https://api.supportbench.net/field/dropdown/items/' + field_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript","name":"jQuery"}]},"method":"get","params":[{"desc":"The field id of the list","default":"","type":"string","name":"field_id","in":"path","_id":"56d138d86caee3250087a0ff","required":false}],"results":{"codes":[{"name":"","code":"[{\n    \"id\": \"10\",    \n    \"name\": \"Windows\",    \n    \"parent_id\": \"0\"\n},{\n    \"id\": \"11\",    \n    \"name\": \"Windows 8\",    \n    \"parent_id\": \"10\"\n}]","language":"json","status":200},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":""},"body":"Return a list of active field list items in the system.  \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The unique id of the item.\",\n    \"1-1\": \"The full name of the item.\",\n    \"1-0\": \"name\",\n    \"2-0\": \"parent_id\",\n    \"2-1\": \"The parent id of the item.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]","createdAt":"2016-02-27T05:49:12.673Z","editedParams2":true,"excerpt":"","githubsync":"","isReference":true,"parentDoc":null,"user":"565416cace43aa21002b2566","category":"56d136dd7c2e100b000afa6b","link_url":"","order":1,"sync_unique":"","childrenPages":[]}

getReturn Dropdown Items


Path Params

field_id:
string
The field id of the list
Return a list of active field list items in the system. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the item.", "1-1": "The full name of the item.", "1-0": "name", "2-0": "parent_id", "2-1": "The parent id of the item." }, "cols": 2, "rows": 3 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a list of active field list items in the system. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the item.", "1-1": "The full name of the item.", "1-0": "name", "2-0": "parent_id", "2-1": "The parent id of the item." }, "cols": 2, "rows": 3 } [/block]
{"_id":"56e859c3efde930e004078ed","slug":"system-email-addresses","sync_unique":"","createdAt":"2016-03-15T18:51:47.637Z","excerpt":"","link_external":false,"order":0,"parentDoc":null,"project":"565416f3ac09cc2100feb2d5","title":"From Email Address List","type":"get","api":{"examples":{"codes":[{"language":"javascript","name":"jQuery","code":"var email_data = null;\n\n$.ajax({\n    url: 'https://api.supportbench.net/email/addresses',\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i);\n        })\n    }\n});"}]},"method":"get","params":[],"results":{"codes":[{"name":"","code":"[{\n  \"support@mydomain.com\",\n  \"support2@mydomain.com\"\n}]","language":"json","status":200},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/email/addresses","auth":"required"},"isReference":true,"category":"56e858d32fa4da0e0002c673","githubsync":"","hidden":false,"link_url":"","updates":[],"user":"565416cace43aa21002b2566","__v":2,"body":"Returns all of the active email from addresses in the system as a list.","version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

getFrom Email Address List


Returns all of the active email from addresses in the system as a list.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Returns all of the active email from addresses in the system as a list.
{"_id":"56e85ddf2fa4da0e0002c684","project":"565416f3ac09cc2100feb2d5","sync_unique":"","title":"Default Email Address","type":"get","createdAt":"2016-03-15T19:09:19.709Z","githubsync":"","isReference":true,"order":1,"api":{"examples":{"codes":[{"language":"javascript","name":"jQuery","code":"var email_data = null;\n\n$.ajax({\n    url: 'https://api.supportbench.net/email/default',\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n      alert(r);\n    }\n});"}]},"method":"get","params":[],"results":{"codes":[{"name":"","code":"{\"support@mydomain.com\"}","language":"json","status":200},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":"","url":"/email/default","auth":"required"},"excerpt":"","hidden":false,"updates":[],"__v":0,"body":"Return the default reply address in the system.","category":"56e858d32fa4da0e0002c673","user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","link_external":false,"link_url":"","parentDoc":null,"slug":"default-email-address","childrenPages":[]}

getDefault Email Address


Return the default reply address in the system.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return the default reply address in the system.
{"_id":"589ff5fba4d8d50f003bd9dd","excerpt":"","hidden":false,"isReference":false,"order":0,"user":"565416cace43aa21002b2566","createdAt":"2017-02-12T05:43:23.155Z","link_url":"","parentDoc":null,"project":"565416f3ac09cc2100feb2d5","slug":"delete-attachment-1","title":"Delete Temporary Attachment","updates":[],"__v":0,"api":{"params":[{"ref":"","in":"path","required":false,"desc":"The unique attachment id to delete","default":"0","type":"int","name":"id","_id":"58352e90501f060f001f53ef"}],"results":{"codes":[{"status":200,"name":"","code":"{\n    \"success\": true\n}","language":"json"},{"name":"","code":"{}","language":"json","status":400}]},"settings":"","url":"/attachment/delete/:id","auth":"required","examples":{"codes":[{"name":"jQuery","code":"var attachment_id = 2746; \n\n$.ajax({\n    url: 'https://api.supportbench.net/attachment/delete/' + attachment_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        alert(r.success);\n    }\n});","language":"javascript"}]},"method":"delete"},"body":"Return a user count for items related to a user.","category":"589ff5481233cd0f00b796c3","githubsync":"","link_external":false,"next":{"description":"","pages":[]},"sync_unique":"","type":"delete","version":"565416f4ac09cc2100feb2d8","childrenPages":[]}

deleteDelete Temporary Attachment


Path Params

id:
integer0
The unique attachment id to delete
Return a user count for items related to a user.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user.
{"_id":"589ff7211233cd0f00b796c6","api":{"method":"delete","params":[{"desc":"The unique attachment id to delete","default":"0","type":"int","name":"id","_id":"58352e90501f060f001f53ef","ref":"","in":"path","required":false}],"results":{"codes":[{"name":"","code":"{\n    \"success\": true\n}","language":"json","status":200},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":"","url":"/attachment/delete/activity/:id","auth":"required","examples":{"codes":[{"language":"javascript","name":"jQuery","code":"var attachment_id = 2746; \n\n$.ajax({\n    url: 'https://api.supportbench.net/attachment/delete/activity/' + attachment_id,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        alert(r.success);\n    }\n});"}]}},"body":"Return a user count for items related to a user.","order":999,"title":"Delete Activity Attachment","next":{"pages":[],"description":""},"project":"565416f3ac09cc2100feb2d5","slug":"delete-activity-attachment","sync_unique":"","type":"delete","category":"589ff5481233cd0f00b796c3","createdAt":"2017-02-12T05:48:17.018Z","excerpt":"","updates":[],"user":"565416cace43aa21002b2566","version":"565416f4ac09cc2100feb2d8","isReference":false,"link_external":false,"link_url":"","__v":0,"githubsync":"","hidden":false,"childrenPages":[]}

deleteDelete Activity Attachment


Path Params

id:
integer0
The unique attachment id to delete
Return a user count for items related to a user.

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a user count for items related to a user.
{"_id":"583fc6048188ce0f00c74ad4","version":"565416f4ac09cc2100feb2d8","body":"Return a list of active support levels in the system.  The support levels will return in order of the order within the system.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Returning list object\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"id\",\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The unique id of the support level.\",\n    \"1-1\": \"The full name of the support level.\",\n    \"1-0\": \"name\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]","githubsync":"","link_external":false,"parentDoc":null,"slug":"return-support-levels","api":{"auth":"required","examples":{"codes":[{"name":"jQuery","code":"var list_data = null;\n\n$.ajax({\n    url: 'https://api.supportbench.net/supportlevels,\n    type: 'get',\n    contentType: 'application/json',\n    dataType: 'json',\n    beforeSend: function(request) {\n        request.setRequestHeader('Authorization', 'Bearer ' + token);\n    },\n    success: function(r) {\n        $.each(r, function (index, i) {\n          alert(i.id);\n        })\n    }\n});","language":"javascript"}]},"method":"get","params":[],"results":{"codes":[{"name":"","code":"[{\n    \"id\": \"1\",    \n    \"name\": \"Standard\"\n},{\n    \"id\": \"2\",    \n    \"name\": \"Premium\"\n}]","language":"json","status":200},{"status":400,"name":"","code":"{}","language":"json"}]},"settings":"","url":"/supportlevels"},"category":"583fc5704b4dc90f004cd1f9","isReference":false,"next":{"description":"","pages":[]},"user":"565416cace43aa21002b2566","__v":0,"createdAt":"2016-12-01T06:41:08.545Z","link_url":"","order":0,"type":"get","updates":[],"excerpt":"","hidden":false,"project":"565416f3ac09cc2100feb2d5","sync_unique":"","title":"Return Support Levels","childrenPages":[]}

getReturn Support Levels


Return a list of active support levels in the system. The support levels will return in order of the order within the system. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the support level.", "1-1": "The full name of the support level.", "1-0": "name" }, "cols": 2, "rows": 2 } [/block]

Definition

{{ api_url }}{{ page_api_url }}

Examples


Result Format



Return a list of active support levels in the system. The support levels will return in order of the order within the system. [block:api-header] { "type": "basic", "title": "Returning list object" } [/block] [block:parameters] { "data": { "0-0": "id", "h-0": "Name", "h-1": "Description", "0-1": "The unique id of the support level.", "1-1": "The full name of the support level.", "1-0": "name" }, "cols": 2, "rows": 2 } [/block]