Table of Contents | ||
---|---|---|
|
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:
...
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 |
---|---|---|---|
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
Code Block |
---|
{ "requestType": "createGlobalOrg", "userKey": "user_key", "name": "global_org_name", "accountAdminEmail": "enter_account_admin_email@here.com" } |
...
Code Block |
---|
{ "globalOrgToken": "global_org_token" } |
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 |
---|---|---|---|
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
Code Block |
---|
{ "requestType": "assignGlobalOrgToOrg", "userKey": "user_key", "orgToken": "org_token", "globalOrgToken": "global_org_token" } |
...
Code Block |
---|
"message":"Successfully assigned "global_org_token" to "org_token" |
Remove Global Organization from an Organization
This API enables you to remove a global organization from an organization.
QUERY PARAMETERS
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
Code Block |
---|
{ "requestType": "removeGlobalOrgFromOrg", "userKey": "user_key", "orgToken": "org_token", "globalOrgToken": "global_org_token" } |
...
Code Block |
---|
"message":"Successfully removed "global_org_token" from "org_token" |
Organization Level APIs
Get Organizations
This API request returns data on all organizations within the Global Organization.
QUERY PARAMETERS
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 |
...
Code Block |
---|
{ "organizations": [ { "orgName": "Org A", "orgToken": "Org_a_token" }, { "orgName": "Org B", "orgToken": "Org_b_token" } ], "message": "Success" } |
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 |
---|---|---|---|
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 |
...
Code Block |
---|
{ "orgName": "Org A", "orgToken": "Org_a_token" "creationDate": "2016-01-01 12:00:00" "numberOfProducts": "15" "numberOfProjects": "105" "numberOfGroups": "2" "numberOfUsers": "3" } |
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 |
---|---|---|---|
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 |
...
Code Block |
---|
{ "products": [ { "productName": "Product A", "productToken": "product_a_token" }, { "productName": "Product B", "productToken": "product_b_token" } ], "message": "Success" } |
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 |
---|---|---|---|
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 |
...
Code Block |
---|
{ "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" }, |
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 |
---|---|---|---|
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 |
...
Code Block |
---|
{ "projects": [ { "projectName": "project_a", "projectToken": "project_a_token" }, { "projectName": "project_b", "projectToken": "project_b_token" } ], "message": "Success" } |
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 |
---|---|---|---|
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 |
...
Code Block |
---|
{ "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" }, .......... |
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 |
---|---|---|---|
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 |
...
Code Block |
---|
{ "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" } ] } |
Get In-House Libraries
This API request gets information about In-House libraries for an organization, product, or project.
...
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 |
---|---|---|---|
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 |
...
Code Block |
---|
{ "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" } ] } |
Product Level
Get all In-House libraries at the product level.
QUERY PARAMETERS
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 |
...
Code Block |
---|
{ "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" }, ......... ] } |
Project Level
Get all In-House libraries at the project level.
QUERY PARAMETERS
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 |
...
Code Block |
---|
"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 } ] |
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 |
---|---|---|---|
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 |
...