Global Org/Organization/Product/Project API

Overview

Generally, each level of the administrator (Global Org, Organization, Product, Project) can get or set the API attributes in the API calls that refer to their scope or are under their scope. For example, Product administrators can execute API calls related to their Projects/Products that are defined in WhiteSource, but they cannot execute Organization-related API calls which are outside their scope. However, these two API calls are exceptions to this rule:

  • getProductVitals – Product administrators can use the Organization level API call to get the product vitals that relate to their products.

  • getProjectVitals – Product administrators can use the Organization or Product-level API calls to get the project vitals that relate to their projects.

This document showcases the API requests and responses for:

  • creating global organizations, assigning them to organizations, or removing them from organizations

  • getting all organizations and their details

  • getting all products and their vitals at the organization-level

  • getting all projects and their vitals at the organization and product-level

  • getting In-House libraries at the organization, product and project-level

  • unmarking libraries that were manually assigned as In-House, at the organization level

Global Organization Level APIs

According to permissions, users can create global organizations, assign them to organizations, or remove them from organizations. 

Create Global Organization

This API request enables you to create a global organization with an API key token which is its unique identifier.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that creates a global organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

name

Name to be assigned to the global organization.

string

Yes

accountAdminEmail

Email account of the Administrator that is creating the global organization.

string

Yes

Request Example

1 2 3 4 5 6 { "requestType": "createGlobalOrg", "userKey": "user_key", "name": "global_org_name", "accountAdminEmail": "enter_account_admin_email@here.com" }

Response Example

The Response returns the token key that uniquely identifies the global organization.

1 2 3 { "globalOrgToken": "global_org_token" }

Back to top.

Assign Global Organization to an Organization

This API request enables you to assign a global organization to an organization.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that assigns a global organization to an organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

orgToken

API key which is the unique identifier of the organization.

string

Yes

globalOrgToken

API token key which identifies the global organization to be assigned.

string

Yes

Request Example 

1 2 3 4 5 6 {    "requestType": "assignGlobalOrgToOrg",    "userKey": "user_key",    "orgToken": "org_token",    "globalOrgToken": "global_org_token" }

Response Example

1 "message":"Successfully assigned "global_org_token" to "org_token"

Back to top.

Remove Global Organization from an Organization

This API enables you to remove a global organization from an organization.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that removes a global organization from an organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

orgToken

API key which is the unique identifier of the organization.

string

Yes

globalOrgToken

API token key which identifies the global organization to be removed.

string

Yes

Request Example

1 2 3 4 5 6 {    "requestType": "removeGlobalOrgFromOrg",    "userKey": "user_key",    "orgToken": "org_token",    "globalOrgToken": "global_org_token" }

Response Example

1 "message":"Successfully removed "global_org_token" from "org_token"

Back to top.

Organization Level APIs

Get Organizations

This API request returns data on all organizations within the Global Organization.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns the name and token ID of all the organizations in a global organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

globalOrgToken

API token key which uniquely identifies the global organization.

string

Yes

Request Example

1 2 3 4 5 { "requestType":"getAllOrganizations", "userKey": "user_key", "globalOrgToken":"global_organization_token" }

Response Example

1 2 3 4 5 6 7 8 9 10 11 12 13 { "organizations": [ { "orgName": "Org A", "orgToken": "Org_a_token" }, { "orgName": "Org B", "orgToken": "Org_b_token" } ], "message": "Success" }

Back to top.

Get Organization Details

This API request returns details about an organization, such as, name, token key, creation date, number of products, projects, groups, and users in the organization.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns the details of an organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

orgToken

API token key which uniquely identifies the organization.

string

Yes

Request Example

1 2 3 4 5 { "requestType":"getOrganizationDetails", "orgToken":"org_token", “userKey”:”user_key” }

Response Example

1 2 3 4 5 6 7 8 9 { "orgName": "Org A", "orgToken": "Org_a_token" "creationDate": "2016-01-01 12:00:00" "numberOfProducts": "15" "numberOfProjects": "105" "numberOfGroups": "2" "numberOfUsers": "3" }

Back to top.

Product Level APIs

Get Products

This API request gets all products in the organization; name and token of each.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns all the products in an organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

orgToken

API token key which uniquely identifies the organization.

string

Yes

Request Example

1 2 3 4 5 { "requestType":"getAllProducts", "userKey": "user_key", "orgToken":"org_token" }

Response Example

1 2 3 4 5 6 7 8 9 10 11 12 13 { "products": [ { "productName": "Product A", "productToken": "product_a_token" }, { "productName": "Product B", "productToken": "product_b_token" } ], "message": "Success" }

Back to top.

Get Organization Product Vitals

NOTE: Product administrators can use the Organization-level API call to get the product vitals that relate to their products.

This API request gets basic information about each product in an organization: ID, name, token, creation date and last updated date.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns the details of all products in an organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

orgToken

API token key which uniquely identifies the organization.

string

Yes

Request Example

1 2 3 4 5 { "requestType" : "getOrganizationProductVitals", "userKey": "user_key", "orgToken" : "organization_api_key" }

Response Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 {     "productVitals": [         {             "id": 626506,             "name": "Demo Product",             "token": "6aa3bf9946fd433bbaff2dac47096ee965f96e9fd04f47fd868d995572de5d31",             "creationDate": "2020-03-09 15:28:38 +0000",             "lastUpdatedDate": "2020-03-10 08:46:29 +0000"         },         {             "id": 626507,             "name": "Cfy",             "token": "14c871e2d3334dd9af2a5f2a1f171166166c8bfe131d4e8f85ea39123d7ec8ad",             "creationDate": "2020-03-09 15:29:11 +0000",             "lastUpdatedDate": "2020-03-10 08:18:37 +0000"         },         {             "id": 626930,             "name": "Rx",             "token": "f02b063bc3a243e8930e515709c455f27f03a5ef14db4c4ba636eb85867677eb",             "creationDate": "2020-03-10 07:29:45 +0000",             "lastUpdatedDate": "2020-03-10 14:59:55 +0000"         },

Back to top.

Project Level APIs

Get Projects

This API request receives a product token and returns all projects in the product; name and token of each.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns data of all the projects in a product.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

productToken

API token key which uniquely identifies the product.

string

Yes

Request Example

1 2 3 4 5 { "requestType":"getAllProjects", "userKey": "user_key", "productToken":"product_token" }

Response Example

1 2 3 4 5 6 7 8 9 10 11 12 13 { "projects": [ { "projectName": "project_a", "projectToken": "project_a_token" }, { "projectName": "project_b", "projectToken": "project_b_token" } ], "message": "Success" }

Back to top.

Get Organization Project Vitals

NOTE: Product administrators can use the Organization-level API call to get the project vitals that relate to their projects.

This API request gets basic information about each project in an organization: ID, name, token, creation date and last updated date.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns the details of all projects in an organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

orgToken

API token key which uniquely identifies the organization.

string

Yes

Request Example

1 2 3 4 5 { "requestType" : "getOrganizationProjectVitals", "userKey": "user_key", "orgToken" : "organization_api_key" }

Response Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 {     "projectVitals": [         {             "id": 2036041,             "name": "Demo Data",             "token": "b12a4bbd3a884a8db42d55f4374c652eb76b55bb50664c20ab55ca1b621f5e30",             "creationDate": "2020-03-09 15:28:38 +0000",             "lastUpdatedDate": "2020-03-09 15:28:38 +0000"         },        {             "id": 2036049,             "name": "cfy-1",             "token": "56acb93d4d43419dadaad09f310ef2d6be4046029977496297bbf7f1ff7f53dc",             "creationDate": "2020-03-09 15:29:49 +0000",             "lastUpdatedDate": "2020-03-09 15:29:49 +0000"         }, ..........

Back to top.

Get Product Project Vitals

NOTE: Product administrators can use the Product-level API call to get the project vitals that relate to their projects.

This API request gets basic information about each project in a product: ID, name, token, creation date and last updated date.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns the details of all projects in a product.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

productToken

API token key which uniquely identifies the product.

string

Yes

Request Example

1 2 3 4 5 { "requestType" : "getProductProjectVitals", "userKey": "user_key", "productToken" : "product_token" }

Response Example

1 2 3 4 5 6 7 8 9 10 11 12 {     "projectVitals": [         {             "pluginName": "unified agent:20.2.1",             "id": 2038527,             "name": "my-proj",             "token": "64faff622ccb47a1916239fbf75c9431d929242060c7474ca5e49425bb998b2f",             "creationDate": "2020-03-10 08:33:25 +0000",             "lastUpdatedDate": "2020-03-10 08:34:38 +0000"         }     ] }

Back to top.

Get In-House Libraries

This API request gets information about In-House libraries for an organization, product, or project.

NOTES about the Response Parameters

  • matchType parameter value shows “manual” if it is manually marked by user, or “automatic” if it is automatically marked by an In-House rule.

  • pattern parameter is not returned for a library if the matchType value is “manual”.

  • comment parameter is not returned for a library if the matchType value is “automatic”.

Organization Level

Get all In-House libraries at the organization level.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns all In-House libraries for an organization.

string

Yes

orgToken

API key which is a unique identifier of the organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

Request Example

1 2 3 4 5 { "requestType" : "getOrganizationInHouseLibraries", "orgToken" : "organization_api_key", "userKey": "user_key" }

Response Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 {     "libraries": [         {             "matchType": "manual",             "comment": "",             "keyUuid": "0ddecd2b-1395-40f3-b779-ec4b6e7926f0",             "filename": "neo4j-lucene-index-1.8.1.jar",             "groupId": "org.neo4j",             "artifactId": "neo4j-lucene-index",             "sha1": "b73127b3115b55ce5bc7ca6d67bd2205d77b7428",             "type": "MAVEN_ARTIFACT",             "description": "Integration layer between Neo4j and Lucene, providing one possible implementation of the Index API.",             "productName": "Demo Product",             "productToken": "6aa3bf9946fd433bbaff2dac47096ee965f96e9fd04f47fd868d995572de5d31",             "projectName": "Demo Data",             "projectToken": "b12a4bbd3a884a8db42d55f4374c652eb76b55bb50664c20ab55ca1b621f5e30"         },         {             "matchType": "manual",             "comment": "",             "keyUuid": "daff09c9-5986-4daf-9e29-579e09eb3569",             "filename": "nekohtml-1.9.6.2.jar",             "groupId": "nekohtml",             "artifactId": "nekohtml",             "sha1": "2d960be7b62ae6622dbbbe49ab4ffdc609f85c80",             "type": "MAVEN_ARTIFACT",             "productName": "Demo Product",             "productToken": "6aa3bf9946fd433bbaff2dac47096ee965f96e9fd04f47fd868d995572de5d31",             "projectName": "Demo Data",             "projectToken": "b12a4bbd3a884a8db42d55f4374c652eb76b55bb50664c20ab55ca1b621f5e30"         }     ] }

Back to top.

Product Level

Get all In-House libraries at the product level.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns all In-House libraries for a product.

string

Yes

productToken

API key which is a unique identifier of the product.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

Request Example

1 2 3 4 5 { "requestType" : "getProductInHouseLibraries", "productToken" : "product_token", "userKey": "user_key" }

Response Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 {     "libraries": [         {             "matchType": "manual",             "comment": "",             "keyUuid": "0ddecd2b-1395-40f3-b779-ec4b6e7926f0",             "filename": "neo4j-lucene-index-1.8.1.jar",             "groupId": "org.neo4j",             "artifactId": "neo4j-lucene-index",             "sha1": "b73127b3115b55ce5bc7ca6d67bd2205d77b7428",             "type": "MAVEN_ARTIFACT",             "description": "Integration layer between Neo4j and Lucene, providing one possible implementation of the Index API.",             "productName": "Demo Product",             "productToken": "6aa3bf9946fd433bbaff2dac47096ee965f96e9fd04f47fd868d995572de5d31",             "projectName": "Demo Data",             "projectToken": "b12a4bbd3a884a8db42d55f4374c652eb76b55bb50664c20ab55ca1b621f5e30"         },         .........     ] }

Back to top.

Project Level

Get all In-House libraries at the project level.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that returns all In-House libraries for a project.

string

Yes

projectToken

API key which is a unique identifier of the project.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

Request Example

1 2 3 4 5 { "requestType" : "getProjectInHouseLibraries", "projectToken" : "project_token", "userKey": "user_key" }

Response Example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 "libraries" : [ { "matchType" : "manual", "comment": "manually set to In-House", "keyUuid": "library_unique_id", "filename": "library_file_name", "groupId": "library_group_id", "artifactId": "library_artifact_id", "version": "library_version", "sha1": "library_sha1", "type": "library_type", "description": "library_description", "productName" : "product_name", "productToken" : "product_token", "projectName" : "project_name", "projectToken" : "project_token" }, { "matchType" : "automatic", "pattern" : "common-*", "keyUuid": "library_unique_id", "filename": "library_file_name", "groupId": "library_group_id", "artifactId": "library_artifact_id", "version": "library_version", "sha1": "library_sha1", "type": "library_type", "description": "library_description", "productName" : "product_name", "productToken" : "product_token", "projectName" : "project_name", "projectToken" : "project_token } ]

 Back to top.

Unmark In-House Libraries

This API request enables you to unmark libraries that were manually assigned as In-House. This request is only at the organization level.

QUERY PARAMETERS

Parameter

Description

Type

Required

Parameter

Description

Type

Required

requestType

API request type that unmarks a library that was manually assigned as In-House, at the organization level.

string

Yes

orgToken

API key which is a unique identifier of the organization.

string

Yes

userKey

The ID of the user’s profile, which uniquely identifies the user in WhiteSource.

string

Yes

keyUuid

The ID of the library which uniquely identifies it.

string

Yes

Request Example

1 2 3 4 5 6 { "requestType": "unmarkManualInHouseLibrary", "userKey": "user_key", "orgToken": "organization_api_key", "keyUuid" : "library_UUID" }

Response Example

1 2 3 { "message": "Successfully unmarked in-house library" }

Back to top.