Item Follower Endpoint
Get
This method returns all follower of an Item.
Get/api/items/{itemid}/watchers
The URL must contain the item Id. It returns a list of IssueWatcherDto's.
Microsoft.NET example:
List<IssueWatcherDto> follower = serviceManager.Item.IssueWatchersGet(36);
JavaScript example:
var geminiUrl = "http://localhost/gemini/api/items/36/watchers"; var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey $.ajax({ url: geminiUrl, type: "GET", headers: { "Authorization": "Basic " + geminiUsername }, success: function (data) { alert('Success!'); } });
Create
This method adds an User as a follower to an Item.
POST/api/items/{itemid}/watchers/{userid}
The URL must contain the Item Id and User Id. The return value is an IssueWatcherDto where the Item Id is populated.
Microsoft.NET example:
serviceManager.Item.IssueWatchersCreate(36, 1);
JavaScript example:
var geminiUrl = "http://localhost/gemini/api/items/36/watchers/1"; var geminiLogin = Base64.encode("manager:xvitjc5bmm"); // user:apikey $.ajax({ url: geminiUrl, type: "POST", data: null, headers: { "Authorization": "Basic " + geminiLogin }, success: function (data) { alert('Success!'); } });
Delete
This method deletes an Item.
DELETE/api/items/{itemid}/watchers/{userid}
The URL must contain the Item Id and User Id.
Microsoft.NET example:
serviceManager.Item.IssueWatchersDelete(36, 1);
JavaScript example:
var geminiUrl = "http://localhost/gemini/api/items/36/watchers/1"; var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey $.ajax({ url: geminiUrl, type: "DELETE", headers: { "Authorization": "Basic " + geminiUsername }, success: function () { alert('Success!'); } });