Item Endpoint

Get

This method returns an Item.

Get/api/items/{itemid}

The URL must have the item Id. It returns an IssueDto.

Microsoft.NET example:

IssueDto item = serviceManager.Item.Get(22);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/22";
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 creates a new Item.

POST/api/items

The request body must contain the Issue Entity. The return value is the new IssueDto where the item Id is populated.

Microsoft.NET example:

var item = new Issue();

item.ProjectId = 17;
item.Description = "Html comments with style cause some issues";
item.Title = "Fix comments overlay issue";
item.ReportedBy = 1;

serviceManager.Item.Create(item);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items";
var geminiLogin = Base64.encode("manager:xvitjc5bmm"); // user:apikey

var geminiData = {
                ProjectId: "17",        
                ReportedBy: "1",
                Title: "Fix comments overlay issue",
                Description: "Html comments with style cause some issues"
                };

$.ajax({
    url: geminiUrl,
    type: "POST",
    data: geminiProject,
    headers: { "Authorization": "Basic " + geminiLogin },
    success: function (data) {
      alert('Success!');
    }
});

Update

This method updates an existing Item.

PUT/api/items

The request body must contain the full Issue entity with all properties populated (issue a GET request first). The return value is the updated IssueDto.

Microsoft.NET example:

IssueDto data = new IssueDto();

data.Entity.Id = 230;
data.Entity.ProjectId = 17;
data.Entity.Title = "Fix comments overlay issue";
data.Entity.Description = "Html comments with style cause some issues";
data.Entity.ReportedBy = 1;

serviceManager.Item.Update(data.Entity);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items";
var geminiLogin = Base64.encode("manager:xvitjc5bmm"); // user:apikey

var geminiData = {
    Id: "230",
    ProjectId: "17",
    Title: "Fix comments overlay issue with html content",
    Description: "Html comments with style cause some issues",
    ReportedBy: "1",
    .
    .
};

$.ajax({
    url: geminiUrl,
    type: "PUT",
    data: geminiData,
    headers: { "Authorization": "Basic " + geminiLogin },
    success: function (data) {
      alert('Success!');
    }
});

Delete

This method deletes an Item.

DELETE/api/items/{itemid}

The URL must contain the Item Id.

Microsoft.NET example:

serviceManager.Item.Delete(230);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/items/230";
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey

$.ajax({
    url: geminiUrl,
    type: "DELETE",
    headers: { "Authorization": "Basic " + geminiUsername },
    success: function () {
      alert('Success!');
    }
});