This method returns all departments under your account based on the provided parameters.
URL
https://api.plupper.com/resources/department
https://api.plupper.com/resources/department/<departmentId>
Formats
json
HTTP Method
GET
Requires Authentication
HTTP BASIC
API rate limited
No
Parameters
none
Response
get all
["{\"id\":2,\"name\":\"TechSupport\",\"offlineMessage\":\"holidays here\",\"displayName\":\"Technical Support Department\",\"uri\":\"https:\/\/www.plupper.com\/resources\/department\/2\",\"welcomeMessage\":\"IT crowd here\"}",
"{\"id\":67801,\"name\":\"CusotmerCare\",\"offlineMessage\":\"Customer Care is off-line right now.\",\"displayName\":\"Customer Care Department\",\"uri\":\"https:\/\/www.plupper.com\/resources\/department\/67801\",\"welcomeMessage\":\"Hi from Customer Care\"}",
"{\"id\":67901,\"name\":\"Sales\",\"offlineMessage\":\"Sales is off-line right now.\",\"displayName\":\"Sales Department\",\"uri\":\"https:\/\/www.plupper.com\/resources\/department\/67901\",\"welcomeMessage\":\"Welcome from Sales\"}"]
get single
{"displayName":"Technical Support Department","id":"2","name":"TechSupport","offlineMessage":"holidays here","uri":"https://localhost:8181/resources/department/2","welcomeMessage":"IT crowd here"}
Example queries
- Find all departments https://www.plupper.com/resources/department
- Get department with id=3456 https://www.plupper.com/resources/department/3456
-
jQuery example
//get all $.ajax({ type: "GET", url: "https://api.plupper.com/resources/department, username: "john.lennon@example.com", password: "mysecret", dataType: "json", success: function(data) { for(var i in data) { var json = eval('(' + data[i] + ')'); alert("Department name: " + json.name); } } }); //get single $.ajax({ type: "GET", url: "https://api.plupper.com/resources/department/" + departmentId, username: "john.lennon@example.com", password: "mysecret", dataType: "json", success: function(json) { alert("Department name: " + json.name); } });