Project Endpoint
Get
This method returns a Project.
Get/api/projects/{projectid}
The URL must have the Project Id. It returns the ProjectDto.
Microsoft.NET example:
ProjectDto project = serviceManager.Projects.GetProject(10);
JavaScript example:
var geminiUrl = "http://localhost/gemini/api/projects/10"; var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey $.ajax({ url: geminiUrl, type: "GET", headers: { "Authorization": "Basic " + geminiUsername }, success: function (data) { alert('Success!'); } });
Get All
This method returns all Projects.
Get/api/projects
It returns a list of Project Dto's.
Microsoft.NET example:
List<ProjectDto> projects = serviceManager.Projects.GetProjects();
JavaScript example:
var geminiUrl = "http://localhost/gemini/api/projects"; 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 project.
POST/api/projects
The request body must contain the Project entity. The return value is a new ProjectDto where the Project Id field is populated.
Microsoft.NET example:
var project = new Project(); project.Code = "HELP; project.Name = "Help Desk"; project.Description = "Supporting function for Client Projects"; project.TemplateId = 10; project.LeadId = 1; project.WorkflowId = 0; serviceManager.Projects.CreateProject(project);
JavaScript example:
var geminiUrl = "http://localhost/gemini/api/projects"; var geminiLogin = Base64.encode("manager:xvitjc5bmm"); // user:apikey var geminiData = { Code: "HELP", Name: "Help Desk", Description: "Supporting function for Client Projects", Color: "#ffffff", ReadOnly: "false", DescriptionRequired: "true", TemplateId: "10", PermissionId: "2", WorkflowId: "0", LabelId: "8", LeadId: "1" }; $.ajax({ url: geminiUrl, type: "POST", data: geminiData, headers: { "Authorization": "Basic " + geminiLogin }, success: function (data) { alert('Success!'); } });
Update
This method updates an existing project.
PUT/api/projects
The request body must contain the Project entity including the id. The return value is the new ProjectDto.
Microsoft.NET example:
ProjectDto project = new ProjectDto(); project.Entity.Code = "HELP; project.Entity.Name = "Help Desk"; project.Entity.Description = "Supporting function for Client Projects"; project.Entity.TemplateId = 10; project.Entity.LeadId = 1; project.Entity.WorkflowId = 0; project.Entity.Id = 10; serviceManager.Projects.UpdateProject(project.Entity);
JavaScript example:
var geminiUrl = "http://localhost/gemini/api/projects"; var geminiLogin = Base64.encode("manager:xvitjc5bmm"); // user:apikey var geminiData = { Code: "HELP", Name: "Help Desk and Support", Description: "Supporting function for Client Projects", Color: "#ffffff", ReadOnly: "false", DescriptionRequired: "true", TemplateId: "10", PermissionId: "2", WorkflowId: "0", LabelId: "8", LeadId: "1", Id: "10" }; $.ajax({ url: geminiUrl, type: "PUT", data: geminiData, headers: { "Authorization": "Basic " + geminiLogin }, success: function (data) { alert('Success!'); } });
Delete
This method deletes a Project
DELETE/api/projects/{projectid}
The URL must contain the Project Id.
Microsoft.NET example:
serviceManager.Projects.DeleteProject(10);
JavaScript example:
var geminiUrl = "http://localhost/gemini/api/projects/10"; var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey $.ajax({ url: geminiUrl, type: "DELETE", headers: { "Authorization": "Basic " + geminiUsername }, success: function () { alert('Success!'); } });