Create/Update Project
  • 21 Feb 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Create/Update Project

  • Dark
    Light
  • PDF

Article Summary

The Create/Update Project is an endpoint in ProGet's SCA Directory API that will create a new project or update properties on an existing project, and return a ProjectInfo Object object describing the new or updated project.

Note: this API endpoint functions by creating a new project when the one specified in the API request does not exist, else it updates an existing project.

🚀 Quick Example: Creating a New Project with Curl

This example creates a project named myProject, authenticating with the API key abc12345:

curl -X POST -H "X-ApiKey: abc12345" -H "Content-Type: application/json" -d "{\"name\": \"myProject\"}" "https://proget.corp.local/api/sca/projects"

Request Specification

To create or update a project, simply POST to the URL with an appropriate API Key and a ProjectInfo Object object as the request body.

POST /api/sca/projects

Creating a project with a ProjectInfo body requires the project name (e.g. myProject):

POST /api/sca/projects

{
  "name":"myProject",
}

Updating a project with a ProjectInfo body requires the project name (e.g. myProject), and the property to update (e.g. description):

POST /api/sca/projects

{
  "name":"myProject",
  "description":"This is an example"
}

Response Specification

A successful (200) response body will contain a ProjectInfo Object object. For example, to creating a new project myProject, the request would return this:

POST /api/sca/projects
{ 
  "id":1,
  "name":"myProject"
}
ResponseDetails
200 (Success)body will contain a ProjectInfo object
400 (Invalid Input)indicates invalid or missing properties on the ProjectInfo object; the body will provide some details as text
403 (Unauthorized API Key)indicates a missing, unknown, or unauthorized API Key; the body will be empty
500 (Server Error)indicates an unexpected error; the body will contain the message and stack trace, and this will also be logged

Was this article helpful?

What's Next