Project Version Endpoint

Get

This method returns a Version.

Get/api/projects/{projectid}/versions/{versionid}

The URL must have the Project Id and Version Id. It returns a VersionDto.

Microsoft.NET example:

VersionDto version = serviceManager.Projects.GetVersion(17, 34);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/projects/17/versions/34";
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 Versions for a specific Project.

Get/api/projects/{projectid}/versions

It returns a list of VersionDto's.

Microsoft.NET example:

List<VersionDto> versions = serviceManager.Projects.GetVersions(17);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/projects/17/versions";
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 Version.

POST/api/projects/{projectid}/versions

The request body must contain the Version entity. The return value is the new VersionDto where the Version Id field is populated.

Microsoft.NET example:

var version = new Version();

version.Name = "5.5";
version.label = "Newest Version";
version.ProjectId = 17;

serviceManager.Projects.CreateVersion(version);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/projects/17/versions";
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey
var geminiData = {
    Name: "5.5",
    label: "Newest Version",
    ProjectId: "17"
};

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

Update

This method updates an existing version.

PUT/api/projects/{projectid}/versions

The request body must contain the Version entity including the Id. The return value is the updated VersionDto.

Microsoft.NET example:

VersionDto version = new VersionDto();

version.Entity.Id = 39;
version.Entity.Name = "5.5";
version.Entity.label = "Closed Version";
version.Entity.ProjectId = 17;

serviceManager.Projects.UpdateVersion(version.Entity);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/projects/17/versions";
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey
var geminiData = {
    Id: "39",
    Name: "5.5",
    label: "Closed Version",
    ProjectId: "17",
};

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

Delete

This method deletes a Version

DELETE/api/projects/{projectid}/versions/{versionid}

The URL must contain the Project Id and the Version Id.

Microsoft.NET example:

serviceManager.Projects.DeleteVersion(17, 39);

JavaScript example:

var geminiUrl = "http://localhost/gemini/api/projects/17/versions/39";
var geminiUsername = Base64.encode("manager:xvitjc5bmm"); // user : apikey

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