Project Endpoints
  • 08 Dec 2022
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Project Endpoints

  • Dark
    Light
  • PDF

Article Summary

These endpoints allow you to create new projects, update existing projects, and retrieve information on existing projects.

Create Project - Creates a new project.
Get Project - Retrieve the data of a single project.
Get Projects - Retrieve the data for all of a team's projects.
Update Project - Update an existing project.
Update Projects - Change the monitoring or archived status for one or more projects.


Create Project

The v1/project/createProject endpoint allows you to create a new project.

Endpoint
v1/project/createProject
Request Method
POST
ParameterDescription
team_idYour team ID.
ruleset_id(optional) The ID of the ruleset to be applied to the project. The default ruleset will be used if no ruleset ID is provided.
nameThe name of the project.
alias(optional) An array that includes the product's name, organization, and version.
typeThe project type. These include git, artifact, svn, s3, and source_unavailable
sourceThe source location for the repository. Not used for source_unavailable type projects.
branchThe Git branch of a project. Only used for git type projects.
deploy_keyA Git private SSH key for use in private Git repositories.
descriptionA description of the project.
username(optional) An artifact project's username.
password(optional) An artifact project's password.
active(optional) Indicates whether the project should be active or archived. The default value is true.
should_monitor(optional) Indicates whether the project should be monitored daily. The default value is true.
poc_name(optional) The name of the point of contact for the project. 
poc_email(optional) The email address of the point of contact for the project.

Request Example:

curl -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
-d '{
  "team_id": "abcd1234-ab12-ab12-ab12-abcde123456",
  "ruleset_id": "bcde1234-ab12-ab12-ab12-abcde234567",
  "name": "Project Name",
  "aliases": [
    {
      "name": "ionize",
      "org": "ion-channel",
      "version": "1.0"
    }
  ],
  "type": "git",
  "source": "https:\/\/github.com/ion-channel\/ionize.git",
  "branch": "master",
  "description": "Project description here",
  "username": "",
  "password": "",
  "active": true,
  "should_monitor": true,
  "poc_name": "Jane Doe",
  "poc_email": "user@email.com"
}' \
"https://api.ionchannel.io/v1/project/createProject"

Response Example:

{
  "data": {
    "id": "cdef1234-ab12-ab12-ab12-abcde345678",
    "team_id": "abcd1234-ab12-ab12-ab12-abcde123456",
    "ruleset_id": "bcde1234-ab12-ab12-ab12-abcde234567",
    "name": "Project Name 2",
    "type": "git",
    "source": "https://github.com/ion-channel/ionizee.git",
    "branch": "master",
    "description": "Project description here",
    "active": true,
    "chat_channel": "",
    "created_at": "2021-10-22T20:38:47.113477Z",
    "updated_at": "2021-10-22T20:38:47.113477Z",
    "deploy_key": "",
    "should_monitor": false,
    "monitor_frequency": "",
    "poc_name": "Jane Doe",
    "poc_email": "user@email.com",
    "username": "",
    "password": "",
    "key_fingerprint": "",
    "private": false,
    "aliases": [
      {
        "id": "defg1234-ab12-ab12-ab12-abcde456789",
        "name": "ionize",
        "org": "ion-channel",
        "created_at": "2021-10-22T20:38:47.113477Z",
        "updated_at": "2021-10-22T20:38:47.113477Z",
        "version": "1.0"
      }
    ],
    "tags": [],
    "ruleset_history": null
  },
  "meta": {
    "total_count": 0,
    "offset": 0
  }
}

Get Project

The v1/project/getProject endpoint allows you to retrieve the details of a single project.

Endpoint
v1/project/getProject
Request Method
GET
ParameterDescription
idThe project ID
team_idYour team ID.

Request Example

curl -H "Authorization: Bearer TOKEN" \
https://api.ionchannel.io/v1/project/getProject?team_id=TEAM_ID&id=PROJECT_ID

Response Example

{
  "data": {
    "id": "abcd1234-ab12-ab12-ab12-abcde123456",
    "team_id": "abcd1234-ab12-ab12-ab12-abcde123456",
    "ruleset_id": "abcd1234-ab12-ab12-ab12-abcde123456",
    "name": "project name",
    "type": "git",
    "source": "git@github.com:ion-channel/anion.git",
    "branch": "master",
    "description": "",
    "active": true,
    "chat_channel": "",
    "created_at": "2020-12-18T23:53:27.130452Z",
    "updated_at": "2020-12-18T23:53:27.130452Z",
    "deploy_key": "",
    "should_monitor": true,
    "monitor_frequency": "daily",
    "poc_name": "",
    "poc_email": "",
    "username": "",
    "password": "",
    "key_fingerprint": "",
    "private": false,
    "aliases": [
      {
        "id": "abcd1234-ab12-ab12-ab12-abcde123456",
        "name": "product_name",
        "org": "product_organization",
        "created_at": "2020-12-18T23:53:27.130452Z",
        "updated_at": "2020-12-18T23:53:27.130452Z",
        "version": "1.0.0"
      }
    ],
    "tags": [],
    "ruleset_history": []
  },
  "meta": {
    "total_count": 1,
    "offset": 0
  }
}

Get Projects

The v1/project/getProjects endpoint allows you to retrieve the details for all of a team's projects.

Endpoint
v1/project/getProjects
Request Method
v1/project/getProjects
ParameterDescription
team_idYour team ID.

Request Example

curl -H "Authorization: Bearer TOKEN" \
https://api.ionchannel.io/v1/project/getProjects?team_id=TEAM_ID

Response Example

See Get Project.


Update Project

The v1/project/updateProject endpoint allows you to update an existing project.

Endpoint
v1/project/updateProject
Request Method
PUT
ParameterDescription
idThe project ID
Everything elseSee Create Project

Request Example

curl -X PUT \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
-d '{
  "id": "cdef1234-ab12-ab12-ab12-abcde345678",
  "team_id": "abcd1234-ab12-ab12-ab12-abcde123456",
  "ruleset_id": "bcde1234-ab12-ab12-ab12-abcde234567",
  "name": "Project Name",
  "aliases": [
    {
      "name": "ionize",
      "org": "ion-channel",
      "version": "1.0"
    }
  ],
  "type": "git",
  "source": "https:\/\/github.com/ion-channel\/ionize.git",
  "branch": "master",
  "description": "Project description here",
  "username": "",
  "password": "",
  "active": true,
  "should_monitor": false,
  "poc_name": "Jane Doe",
  "poc_email": "user@email.com"
}' \
"https://api.ionchannel.io/v1/project/updateProject"

Response Example

See Create Project.


Update Projects

The v1/project/updateProjects endpoint allows you to enable/disable monitoring or archive/activate one or more projects.

Endpoint
v1/project/updateProjects
Request Method
PUT
ParameterDescription
monitorUpdates the monitor status of the project(s). Setting it to true will cause all projects to be analyzed daily. Setting it to false will halt all regular monitoring.
archiveUpdates the status of the project(s). Setting it to true will archive all of the active projects. Setting it to false will activate any of the archived projects.

Request Example

curl -X PUT \                                                                
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
-d '{ "project_ids":["abcd1234-ab12-ab12-ab12-abcde123456","bcde1234-ab12-ab12-ab12-abcde234567"]
}' \
"https://api.ionchannel.io/v1/project/updateProjects?monitor=true"

Response Example

{
  "data": {
    "succeeded": [
      "abcd1234-ab12-ab12-ab12-abcde123456",
      "bcde1234-ab12-ab12-ab12-abcde234567"
    ],
    "failed": []
  },
  "meta": {
    "total_count": 0,
    "offset": 0
  }
}

Was this article helpful?