Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This API request gets all policies at the global organization level.

QUERY PARAMETERS

Parameter

Description

Type

Required

requestType

API request type that returns a global organization’s policies.

string

Yes

globalOrgToken

API key which is a unique identifier of the global organization.

string

Yes

userKey

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

string

Yes

Request Example

Code Block
{
    "requestType":"getGlobalOrganizationPolicies",
    "globalOrgToken":"global_organization_token",
    "userKey": "user_key"
}

Response Example

The response is a JSON collection of all policies with their details at the global organization level. For example:

Code Block
{
    "policies": [
        {
            "id": 7,
            "name": "my policy",
            "owner": {
                "id": user_id,
                "email": "user_email",
                "name": "user_name"
            },
            "creationTime": "2016-11-23",
            "priority": 2,
            "filter": {
                "type": "VULNERABILITY_SEVERITY",
                "vulnerabilitySeverity": "HIGH",
                "effectiveVulnerabilitiesOnly" : true
            },
            "inclusive": false,
            "action": {
                "type": "REJECT"
            },
            "productLevel": false,
            "enabled": false
        }
    ] 
}

Back to top.

Organization

This API request gets all policies at the organization level.

QUERY PARAMETERS

Parameter

Description

Type

Required

requestType

API request type that returns an organization’s policies.

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

Code Block
{
    "requestType":"getOrganizationPolicies",
    "orgToken":"organization_api_key",
    "userKey": "user_key"   
}

Response Format

The response is a JSON collection of all policies with their details at the organization level. For example:

...

This API request gets all policies at the product level.

QUERY PARAMETERS

Parameter

Description

Type

Required

requestType

API request type that returns a product’s policies.

string

Yes

productToken

API key which is a unique

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

Code Block
{
    "requestType":"getProductPolicies",
    "productToken":"product_token",
    "userKey": "user_key"
}

...

This API request gets all policies at the project level.

QUERY PARAMETERS

Parameter

Description

Type

Required

requestType

API request type that returns a project’s policies.

string

Yes

projectToken

API key which is a unique

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

Code Block
{
    "requestType":"getProjectPolicies",
    "projectToken":"project_token",
    "userKey": "user_key"
}

...

NOTE: To add policies at the global organization level, you must be a member of the Global Admin group.

QUERY PARAMETERS

Parameter

Description

Type

Required

Default/Values

requestType

API request type that adds a policy to a global organization.

string

Yes

globalOrgToken

API key which is a unique identifier of the global organization.

string

Yes

userKey

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

string

Yes

policy

Policy data object containing:

string

Yes

name

Name of the policy you want to add.

string

Yes

owner

Identification of the user that created the policy.

integer

Yes

Valid values: user ID, name, or email.

filter

The policy filter defines how to match libraries (for example: By License). Comprises the following:

  • Match - The match type that defines which criteria of the library will be checked for licenses or security vulnerabilities in the code.

  • Values - The values against which the match type is evaluated. For example, for match type License Group, the values are the specific licenses against which the library license is matched.

For a description of all the available match types and their values, please refer to Matching a Policy to a Library.

string

Yes

For the LICENSE match type, if the inclusive value is set to true, the policy will perform the action when ALL the licenses in the library are matched. Boolean data type values are true or false.

action

Type of operation that defines what to do when a library matches the policy’s filter.

Object

Yes

The “Action” object must contain the field “type”.

Valid values for “type” are:

  • Approve - Automatically approve the library.

  • Reject - Automatically reject the library.

  • Reassign - Reassign the request to a designated user or group in the system which is not the default approver.

  • Conditions - Automatically assign conditions and open tasks on libraries.

  • Issue - Automatically create a ticket in the issue tracker with all relevant information.  When creating an Issue Policy, the “Action” object should contain more fields. For a description of the query parameters required to create a policy of action type Issue, see Create Issue Action for a Policy.

Request Example

Code Block
{
    "requestType":"addGlobalOrganizationPolicy",
    "globalOrgToken":"global_organization_token",
    "userKey": "user_key",
    "policy":{
        "name":"my policy",
        "owner":{
            "id":user_id
        },
        "filter":{
            "type":"LICENSE",
            "licenses":[
                {
                    "name":"Apache 2.0"
                }
            ]
        },
        "inclusive": true,
        "action":{
            "type":"APPROVE"
        }
    }
}

...

The JSON response is the added policy. A unique ID is created for the policy after addition.

Code Block
{
   "addedPolicy":{
      "id": 9,
      "name": "my policy",
      "owner":{
         "id": user_id,
         "email": "user_email",
         "name": "user_name"
      },
      "creationTime": "2016-12-21",
      "priority": 2,
      "filter":{
         "type": "LICENSE",
         "licenses": [{
            "id": 9,
            "name": "Apache 2.0"
         }]
      },
      "inclusive": true,
      "action": {
            "type": "APPROVE"
        },
      "productLevel": false,
      "enabled": true
   },
   "message": "Successfully added policy 'my policy'"
NOTE: A unique ID will be created for the policy after addition. }

Back to top.

Organization

This API request adds a policy to your organization.

NOTE: To add policies at the organization level, you must be a member of the ORG Admin group.

QUERY PARAMETERS

Parameter

Description

Type

Required

Default/Values

requestType

API request type that adds a policy to 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

policy

Policy data object containing:

string

Yes

name

Name of the policy you want to add.

string

Yes

owner

Identification of the user that created the policy.

integer

Yes

Valid values: user ID, name, or email.

filter

The policy filter defines how to match libraries (for example: By License). Comprises the following:

  • Match - The match type that defines which criteria of the library will be checked for licenses or security vulnerabilities in the code.

  • Values - The values against which the match type is evaluated. For example, for match type License Group, the values are the specific licenses against which the library license is matched.

For a description of all the available match types and their values, please refer to Matching a Policy to a Library.

string

Yes

For the LICENSE match type, if the inclusive value is set to true, the policy will perform the action when ALL the licenses in the library are matched. Boolean data type values are true or false.

action

Type of operation that defines what to do when a library matches the policy’s filter.

string

Yes

The “Action” object must contain the field “type”.

Valid values for “type” are:

  • Approve - Automatically approve the library.

  • Reject - Automatically reject the library.

  • Reassign - Reassign the request to a designated user or group in the system which is not the default approver.

  • Conditions - Automatically assign conditions and open tasks on libraries.

  • Issue - Automatically create a ticket in the issue tracker with all relevant information.  When creating an Issue Policy, the “Action” object should contain more fields. For a description of the query parameters required to create a policy of action type Issue, see Create Issue Action for a Policy.

Request Example

Code Block
{
    "requestType":"addOrganizationPolicy",  
    "orgToken":"organization_api_key",
    "userKey": "user_key"
    "policy":{
        "name":"my policy",
        "owner":{
            "id":user_id
        },
        "filter":{
            "type":"LICENSE",
            "licenses":[
                {
                    "name":"Apache 2.0"
                }
            ]
        },
        "inclusive": true,
        "action":{
            "type":"APPROVE"
        }
    }
}

...

The JSON response is the added policy with a unique ID.

Code Block
{
   "addedPolicy":{
      "id": 8,
      "name": "my policy",
      "owner":{
         "id": user_id,
         "email": "user_email",
         "name": "user_name"
      },
      "creationTime": "2016-12-21",
      "priority": 1,
      "filter":{
         "type": "LICENSE",
         "licenses": [{
            "id": 9,
            "name": "Apache 2.0"
         }]
      },
      "inclusive": true,
      "action": {"type": "APPROVE"},
      "productLevel": false,
      "enabled": true
   },
   "message": "Successfully added policy 'my policy'"
}

Back to top.

Product

This API request adds a policy to your product.

NOTE: To add policies at the product level, you must be a member of the Product Admin or Admin group.

QUERY PARAMETERS

Parameter

Description

Type

Required

Default/Values

requestType

API request type that adds a policy to a product.

string

Yes

productToken

API key which is a unique

Unique identifier of the product.

string

Yes

userKey

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

string

Yes

policy

Policy data object containing:

string

Yes

name

Name of the policy you want to add.

integer

Yes

owner

Identification of the user that created the policy.

string

Yes

Valid values: user ID, name, or email.

filter

The policy filter defines how to match libraries (for example: By License). Comprises the following:

  • Match - The match type that defines which criteria of the library will be checked for licenses or security vulnerabilities in the code.

  • Values - The values against which the match type is evaluated. For example, for match type License Group, the values are the specific licenses against which the library license is matched.

For a description of all the available match types and their values, please refer to Matching a Policy to a Library.

string

Yes

For the LICENSE match type, if the inclusive value is set to true, the policy will perform the action when ALL the licenses in the library are matched. Boolean data type values are true or false.

action

Type of operation that defines what to do when a library matches the policy’s filter.

string

Yes

The “Action” object must contain the field “type”.

Valid values for “type” are:

  • Approve - Automatically approve the library.

  • Reject - Automatically reject the library.

  • Reassign - Reassign the request to a designated user or group in the system which is not the default approver.

  • Conditions - Automatically assign conditions and open tasks on libraries.

  • Issue - Automatically create a ticket in the issue tracker with all relevant information.  When creating an Issue Policy, the “Action” object should contain more fields. For a description of the query parameters required to create a policy of action type Issue, see Create Issue Action for a Policy.

Request Example

Code Block
{
   "requestType": "addProductPolicy",  
   "productToken": "product_token",
   "userKey": "user_key"
   "policy":{
        "name":"my policy",
        "owner":{
            "id":user_id
        },
        "filter":{
            "type":"LICENSE",
            "licenses":[
             {
              "name":"GPL 3"
             }
            ]
        },
        "inclusive": true,        
  "action":{
            "type":"APPROVE"
        }
}

...

NOTE: To add policies at the project level, you must be a member of the Admin group.

QUERY PARAMETERS

Parameter

Description

Type

Required

Default/Values

requestType

API request type that adds a policy to a project.

string

Yes

projectToken

API key which is a unique

Unique identifier of the project.

string

Yes

userKey

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

string

Yes

policy

Policy data object containing:

string

Yes

name

Name of the policy you want to add.

string

Yes

owner

Identification of the user that created the policy.

integer

Yes

Valid values: user ID, name, or email.

filter

The policy filter defines how to match libraries (for example: By License). Comprises the following:

  • Match - The match type that defines which criteria of the library will be checked for licenses or security vulnerabilities in the code.

  • Values - The values against which the match type is evaluated. For example, for match type License Group, the values are the specific licenses against which the library license is matched.

For a description of all the available match types and their values, please refer to Matching a Policy to a Library.

string

Yes

For the LICENSE match type, if the inclusive value is set to true, the policy will perform the action when ALL the licenses in the library are matched. Boolean data type values are true or false.

action

Type of operation that defines what to do when a library matches the policy’s filter.

string

Yes

The “Action” object must contain the field “type”.

Valid values for “type” are:

  • Approve - Automatically approve the library.

  • Reject - Automatically reject the library.

  • Reassign - Reassign the request to a designated user or group in the system which is not the default approver.

  • Conditions - Automatically assign conditions and open tasks on libraries.

  • Issue - Automatically create a ticket in the issue tracker with all relevant information.  When creating an Issue Policy, the “Action” object should contain more fields. For a description of the query parameters required to create a policy of action type Issue, see Create Issue Action for a Policy.

Request Example

Code Block
{
    "requestType":"addProjectPolicy",
    "projectToken":"project_token",
    "userKey": "user_key"
    "policy":{
        "name":"my policy",
        "owner":{
            "id":user_id
        },
        "filter":{
            "type":"LICENSE",
            "licenses":[
                {
                    "name":"GPL 3"
                }
            ]
        },
        "inclusive": true,
        "action":{
            "type":"APPROVE"
        }
    }
}

...

Following are the query parameters that define the API request to update a policy in a global organization. Note that apart from the unique ID of the policy which is mandatory, you only need to specify the fields and values that you want to update.

Parameter

Description

Type

Required

Default/Values

requestType

API request type that updates a policy in a global organization.

string

Yes

globalOrgToken

API key which is a unique identifier of the global organization. Used to identify the global organization in plugins.

string

Yes

userKey

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

string

Yes

policy

Policy data object containing:

string

Yes

id

Unique ID of the policy.

integer

Yes

name

Name of the policy you want to update.

string

Yes

owner

Identification of the user that created the policy.

integer

Yes

Valid values: user ID, name, or email.

filter

The policy filter defines how to match libraries (for example: By License). Comprises the following:

  • Match - The match type that defines which criteria of the library will be checked for licenses or security vulnerabilities in the code.

  • Values - The values against which the match type is evaluated. For example, for match type License Group, the values are the specific licenses against which the library license is matched.

For a description of all the available match types and their values, please refer to Matching a Policy to a Library.

string

No

For the LICENSE match type, if the inclusive value is set to true, the policy will perform the action when ALL the licenses in the library are matched. Boolean data type values are true or false.

action

Type of operation that defines what to do when a library matches the policy’s filter.

string

No

The “Action” object must contain the field “type”.

Valid values for “type” are:

  • Approve - Automatically approve the library.

  • Reject - Automatically reject the library.

  • Reassign - Reassign the request to a designated user or group in the system which is not the default approver.

  • Conditions - Automatically assign conditions and open tasks on libraries.

  • Issue - Automatically create a ticket in the issue tracker with all relevant information.  When creating an Issue Policy, the “Action” object should contain more fields. For a description of the query parameters required to create a policy of action type Issue, see Create Issue Action for a Policy.

Request Example

Code Block
{
    "requestType":"updateGlobalOrganizationPolicy",
    "globalOrgToken":"global_organization_token",
    "userKey": "user_key",
    "policy":{
        "id":1
        "name":"my policy",
        "owner":{
            "id":user_id
        },
        "filter":{
            "type":"LICENSE",
            "licenses":[
                {
                    "name":"GPL 3.0"
                }]
        },
        "inclusive": true,
        "action":{
            "type":"REJECT"
        }
    }
}

...

The JSON response is the updated policy. Note that a new policy ID is assigned.

Code Block
{
   "updatedPolicy": {
      "id": 8,
      "name": "my policy",
      "owner": {
         "id": user_id,
         "email": "user_email",
         "name": "user_name"
      },
      "creationTime": "2016-12-21",
      "priority": 1,
      "filter":       {
         "type": "LICENSE",
         "licenses": [         {
            "id": 1,
            "name": "GPL 3.0"
         }]
      },
      "inclusive": true,
      "action": {
            "type": "REJECT"
        },
      "productLevel": false,
      "enabled": true
   },
   "message": "Successfully updated policy 'my policy'"
}

Back to top.

Organization

This API request updates a policy in your organization.

...

Following are the query parameters that define the API request to update a policy in an organization. Note that apart from the unique ID of the policy which is mandatory, you only need to specify the parameters and values that you want to update.

Parameter

Description

Type

Required

Default/Values

requestType

API request type that updates a policy in an organization.

string

Yes

orgToken

API key which is a unique identifier of the organization. Used to identify the organization in plugins.

string

Yes

userKey

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

string

Yes

policy

Policy data object containing:

string

id

Unique ID of the policy.

integer

Yes

name

Name of the policy you want to update.

string

Yes

owner

Identification of the user that created the policy.

integer

Yes

Valid values: user ID, name, or email.

filter

The policy filter defines how to match libraries (for example: By License). Comprises the following:

  • Match - The match type that defines which criteria of the library will be checked for licenses or security vulnerabilities in the code.

  • Values - The values against which the match type is evaluated. For example, for match type License Group, the values are the specific licenses against which the library license is matched.

For a description of all the available match types and their values, please refer to Matching a Policy to a Library.

string

No

For the LICENSE match type, if the inclusive value is set to true, the policy will perform the action when ALL the licenses in the library are matched. Boolean data type values are true or false.

action

Type of operation that defines what to do when a library matches the policy’s filter.

string

No

The “Action” object must contain the field “type”.

Valid values for “type” are:

  • Approve - Automatically approve the library.

  • Reject - Automatically reject the library.

  • Reassign - Reassign the request to a designated user or group in the system which is not the default approver.

  • Conditions - Automatically assign conditions and open tasks on libraries.

  • Issue - Automatically create a ticket in the issue tracker with all relevant information.  When creating an Issue Policy, the “Action” object should contain more fields. For a description of the query parameters required to create a policy of action type Issue, see Create Issue Action for a Policy.

Request Example

Code Block
{
    "requestType":"updateOrganizationPolicy",
    "orgToken":"organization_api_key",
    "userKey": "user_key"
    "policy":{
        "id":1
        "name":"my policy",
        "owner":{
            "id":user_id
        },
        "filter":{
            "type":"LICENSE",
            "licenses":[
                {
                    "name":"GPL 3.0"
                }]
        },
        "inclusive": true,
        "action":{
            "type":"REJECT"
        }
    }
}

...

The JSON response is the updated policy. Note that a new policy ID is assigned.

Code Block
{
   "updatedPolicy":    {
      "id": 8,
      "name": "my policy",
      "owner":       {
         "id": user_id,
         "email": "user_email",
         "name": "user_name"
      },
      "creationTime": "2016-12-21",
      "priority": 1,
      "filter":       {
         "type": "LICENSE",
         "licenses": [         {
            "id": 1,
            "name": "GPL 3.0"
         }]
      },
      "inclusive": true,
      "action": {"type": "REJECT"},
      "productLevel": false,
      "enabled": true
   },
   "message": "Successfully updated policy 'my policy'"
}

Back to top.

Product

This API request updates a policy in your product.

...

Following are the query parameters that define the API request to update a policy in a product. Note that apart from the unique ID of the policy which is mandatory, you only need to specify the parameters and values that you want to update.

Parameter

Description

Type

Required

Default/Values

requestType

API request type that updates a policy in a product.

string

Yes

productToken

API key which is a unique

Unique identifier of the product.

string

Yes

userKey

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

string

Yes

policy

Policy data object containing:

string

Yes

id

Unique ID of the policy.

integer

Yes

name

Name of the policy you want to update.

string

Yes

owner

Identification of the user that created the policy.

integer

Yes

Valid values: user ID, name, or email.

filter

The policy filter defines how to match libraries (for example: By License). Comprises the following:

  • Match - The match type that defines which criteria of the library will be checked for licenses or security vulnerabilities in the code.

  • Values - The values against which the match type is evaluated. For example, for match type License Group, the values are the specific licenses against which the library license is matched.

For a description of all the available match types and their values, please refer to Matching a Policy to a Library.

string

No

For the LICENSE match type, if the inclusive value is set to true, the policy will perform the action when ALL the licenses in the library are matched. Boolean data type values are true or false.

action

Type of operation that defines what to do when a library matches the policy’s filter.

string

No

The “Action” object must contain the field “type”.

Valid values for “type” are:

  • Approve - Automatically approve the library.

  • Reject - Automatically reject the library.

  • Reassign - Reassign the request to a designated user or group in the system which is not the default approver.

  • Conditions - Automatically assign conditions and open tasks on libraries.

  • Issue - Automatically create a ticket in the issue tracker with all relevant information.  When creating an Issue Policy, the “Action” object should contain more fields. For a description of the query parameters required to create a policy of action type Issue, see Create Issue Action for a Policy.

Request Example

Code Block
{
    "requestType":"updateProductPolicy",
    "productToken": "product_token",
    "userKey": "user_key"
    "policy":{
        "name":"my policy",
        "owner":{
            "id":user_id
        },
        "filter":{
            "type":"LICENSE",
            "licenses":[
                {
                    "name":"GPL 3.0"
                }]
        },
        "inclusive": true,
        "action":{
            "type":"REJECT"
        }
    }
}

...

Following are the query parameters that define the API request to update a policy in a project. Note that apart from the unique ID of the policy which is mandatory, you only need to specify the parameters and values that you want to update.

Parameter

Description

Type

Required

Default/Values

requestType

API request type that updates a policy in a project.

string

Yes

projectToken

API key which is a unique

Unique identifier of the project.

string

Yes

userKey

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

string

Yes

policy

Policy data object containing:

string

Yes

id

Unique ID of the policy.

integer

Yes

name

Name of the policy you want to update.

string

Yes

owner

Identification of the user that created the policy.

integer

Yes

Valid values: user ID, name, or email.

filter

The policy filter defines how to match libraries (for example: By License). Comprises the following:

  • Match - The match type that defines which criteria of the library will be checked for licenses or security vulnerabilities in the code.

  • Values - The values against which the match type is evaluated. For example, for match type License Group, the values are the specific licenses against which the library license is matched.

For a description of all the available match types and their values, please refer to Matching a Policy to a Library.

string

No

For the LICENSE match type, if the inclusive value is set to true, the policy will perform the action when ALL the licenses in the library are matched. Boolean data type values are true or false.

action

Type of operation that defines what to do when a library matches the policy’s filter.

string

No

The “Action” object must contain the field “type”.

Valid values for “type” are:

  • Approve - Automatically approve the library.

  • Reject - Automatically reject the library.

  • Reassign - Reassign the request to a designated user or group in the system which is not the default approver.

  • Conditions - Automatically assign conditions and open tasks on libraries.

  • Issue - Automatically create a ticket in the issue tracker with all relevant information.  When creating an Issue Policy, the “Action” object should contain more fields. For a description of the query parameters required to create a policy of action type Issue, see Create Issue Action for a Policy.

Request Example

Code Block
{
    "requestType":"updateProjectPolicy",
    "projectToken":"project_token",
    "userKey": "user_key"
    "policy":{
        "name":"my policy",
        "owner":{
            "id":user_id
        },
        "filter":{
            "type":"LICENSE",
            "licenses":[
                {
                    "name":"GPL 3.0"
                }]
        },
        "inclusive": true,
        "action":{
            "type":"REJECT"
        }
    }
}

Response Format

The JSON response is the updated policy with a new policy ID.

...

Following are the mandatory query parameters that define the API request to remove policies from a global organization according to their specific IDs.

Parameter

Description

Type

Required

requestType

API request type that removes policies from a global organization.

string

Yes

globalOrgToken

API key which is a unique identifier of the global organization.

string

Yes

userKey

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

string

Yes

policyIds

IDs of the policies that you want to remove.

array of integers

Yes

Request Example

Code Block
{
    "requestType":"removeGlobalOrganizationPolicies",
    "globalOrgToken":"global_organization_token",
    "userKey": "user_key",
    "policyIds":[2,3,4,5]
}

Response Example

Code Block
{
    "removedPolicies": 4
}

Back to top.

Organization

This API request removes specific policies from your organization.

...

Following are the mandatory query parameters that define the API request to remove policies from an organization according to their specific IDs.

Parameter

Description

Type

Required

requestType

API request type that removes policies from 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

policyIds

IDs of the policies that you want to remove.

array of integers

Yes

Request Example

Code Block
{
    "requestType":"removeOrganizationPolicies",
    "orgToken":"organization_api_key",
    "userKey": "user_key"
    "policyIds":[2,3,4,5]
}

Response Example

Code Block
{
    "removedPolicies": 4
}

Back to top.

Product

This API request removes specific policies from your product.

...

Following are the mandatory query parameters that define the API request to remove policies from a product according to their specific IDs.

Parameter

Description

Type

Required

requestType

API request type that removes policies from a product.

string

Yes

productToken

API key which is a unique

Unique identifier of the product.

string

Yes

userKey

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

string

Yes

policyIds

IDs of the policies that you want to remove.

array of integers

Yes

Request Example

Code Block
{
    "requestType":"removeProductPolicies",
    "productToken": "product_token",
    "userKey": "user_key"
    "policyIds":[6,7]
}

Response Example

Code Block
{
    "removedPolicies": 2
}

Back to top.

Project

This API request removes specific policies from your project.

...

Following are the mandatory query parameters that define the API request to remove policies from a project according to their specific IDs.

Parameter

Description

Type

Required

requestType

API request type that removes policies from a project.

string

Yes

projectToken

API key which is a unique

Unique identifier of the project.

string

Yes

userKey

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

string

Yes

policyIds

IDs of the policies that you want to remove.

array of integers

Yes

Request Example

Code Block
{
    "requestType":"removeProjectPolicies",
    "projectToken":"project_token",
    "userKey": "user_key",
    "policyIds":[6,7]
}

Response Example

Code Block
{
    "removedPolicies": 2
}

Back to top.

Update Policy Priorities

...

Following are the mandatory query parameters that define the API request to change the priority of policies in a global organization.

Parameter

Description

Type

Required

requestType

API request type to reorder the priorities of policies in a global organization.

string

Yes

globalOrgToken

API key which is a unique identifier of the global organization.

string

Yes

userKey

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

string

Yes

policyPriorities

Policy prioritization data object containing:

array

Yes

policyId

ID of the policy that you want to reprioritize.

integer

Yes

priority

An integer that defines the priority that you want to assign the policy.

integer

Yes

Request Example

Code Block
{
    "requestType":"reorderGlobalOrganizationPolicyPriorities",
    "globalOrgToken":"global_organization_token",
    "userKey": "user_key",
    "policyPriorities":[
        {
            "policyId":3053,
            "priority":1
        },
        {
            "policyId":3052,
            "priority":2
        }]
}

...

The response is a JSON collection of all global organization-level policies with the updated priorities. For example:

Code Block
{
   "policies":[
      {
         "id":3052,
         "name":"my policy",
         "owner":{
            "id":user_id,
            "email":"user_email",
            "name":"user_name"
         },
         "creationTime":"2018-01-16",
         "priority":2,
         "filter":{
            "type":"LICENSE",
            "licenses":[
               {
                  "id":9,
                  "name":"Apache 2.0"
               }],
            "scoreFrom":0,
            "scoreTo":0
         },
         "inclusive":true,
         "action":{
            "type":"APPROVE"
         },
         "productLevel":false,
         "enabled":true,
         "policyContext":"GLOBAL_ACCOUNT"
      },
      {
         "id":3053,
         "name":"policy2",
         "owner":{
            "id":2458,
            "email":"user_email",
            "name":"user_name"
         },
         "creationTime":"2018-01-16",
         "priority":1,
         "filter":{
            "type":"LICENSE",
            "licenses":[
               {
                  "id":9,
                  "name":"Apache 2.0"
               }],
            "scoreFrom":0,
            "scoreTo":0
         },
         "inclusive":true,
         "action":{
            "type":"REJECT"
         },
         "productLevel":false,
         "enabled":true,
         "policyContext":"GLOBAL_ACCOUNT"
      }
   ]
}

Back to top.

Organization

This API request updates the priorities of policies in your organization. Policies are checked by order of priority; note that 1 is the lowest priority.

...

Following are the mandatory query parameters that define the API request to change the priority of policies in an organization.

Parameter

Description

Type

Required

requestType

API request type to reorder the priorities of policies in 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

policyPriorities

Policy prioritization data object containing:

array

Yes

policyId

ID of the policy that you want to reprioritize.

integer

Yes

priority

An integer that defines the priority that you want to assign the policy.

integer

Yes

Request Example

Code Block
{
    "requestType":"reorderOrganizationPolicyPriorities",
    "orgToken":"organization_api_key",
    "userKey": "user_key",
    "policyPriorities":[
        {
            "policyId":7,
            "priority":1
        },
        {
            "policyId":8,
            "priority":2
        }
    ]
}

...

Following are the mandatory query parameters that define the API request to change the priority of policies in a product.

Parameter

Description

Type

Required

requestType

API request type to reorder the priorities of policies in a product.

string

Yes

productToken

API key which is a unique

Unique identifier of the product.

string

Yes

userKey

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

string

Yes

policyPriorities

Policy prioritization data object containing:

array

Yes

policyId

ID of the policy that you want to reprioritize.

integer

Yes

priority

An integer that defines the priority that you want to assign the policy.

integer

Yes

Request Example

Code Block
{
    "requestType":"reorderProductPolicyPriorities",
    "productToken": "product_token",
    "userKey": "user_key",
    "policyPriorities":[
        {
            "policyId":10,
            "priority":1
        },
        {
            "policyId":11,
            "priority":2
        }
    ]
}

Response

The response is a JSON collection of all product-level policies with the updated priorities.

...

Following are the mandatory query parameters that define the API request to change the priority of policies in a project.

Parameter

Description

Type

Required

requestType

API request type to reorder the priorities of policies in a project.

string

Yes

projectToken

API key which is a unique

Unique identifier of the project.

string

Yes

userKey

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

string

Yes

policyPriorities

Policy prioritization data object containing:

array

Yes

policyId

ID of the policy that you want to reprioritize.

integer

Yes

priority

An integer that defines the priority that you want to assign the policy.

integer

Yes

Request Example

Code Block
{
    "requestType":"reorderProjectPolicyPriorities",
    "projectToken":"project_token",
    "userKey": "user_key",
    "policyPriorities":[
        {
            "policyId":10,
            "priority":1
        },
        {
            "policyId":11,
            "priority":2
        }
    ]
}

Response

The response is a JSON collection of all project-level policies with the updated priorities.

...

Following are the query parameters that are required for defining an action of type “CREATE_ISSUE” when adding or updating a policy:

Parameter

Description

Type

Required

Default/Values

action

Data object for the Action API request.

string

Yes

type

The type of policy action that defines what to do when a library matches the policy's filter: i.e., CREATE_ISSUE

string

Yes

issueSettings

Data object containing all information regarding the created Issue action type:

string

Yes

summary

Summary that will be written when the issue is created.

string

Yes

description

Description that will be written when the issue is created.

string

Yes

issueTrackerType

Type of Issue Tracker used for the issue.

string

Yes

JIRA or WORK_ITEMS

issueAssignee

Display name of the user to which you want to assign the issue, as displayed in the Issue Tracker Settings.

string

Yes

For a JIRA project, the value of this field is case sensitive.

issueProject

The project key or name assigned to the issue.

string

Yes

JIRA project: The project key for the JIRA Issue (case sensitive).

WORK_ITEMS project: The project name

issueType

The type of issue as it appears in the Name field.

string

Yes

For a JIRA project, the value of this field is case sensitive. Can be one of the following:

  • Bug

  • Improvement

  • Task

  • New feature

  • Epic

  • Story

For a WORK_ITEMS project, the value of this field can be one of the following:

  • Bug

  • Code Review Request

  • Test Case

  • Shared Steps

  • Epic

  • Task

  • Feature

  • Code Review Response

  • Feedback Request

  • Feedback Response

  • Test Plan

  • User Story

  • Shared Parameter

  • Test Suite

  • Issue

issuePriorityInfo

The priority that is assigned to the issue.

string

Yes

Can have one of the following values:

  • Highest

  • High

  • Medium

  • Low

  • Lowest

NOTE: For a JIRA project, the value of this field is case sensitive.

requiredFieldsInfo

Mandatory fields that are required in the Issue type of the project.

string

Yes

Supported fields are:

  • Reporter

  • Labels

  • Components

  • Parent

Request Example

Following is an example of the “action” object which is part of the “add policy” requests, for creating a CREATE ISSUE policy in the Legacy Issue Tracker integration:

Code Block
"action":{
    "type": "CREATE_ISSUE",
    "issueSettings": {
        "summary": "test summary",
        "description": "test description",
        "issueTrackerType": "JIRA",
        "issueAssignee": {
            "displayName": "Lewis Grove"
        },
        "issueProject": {
            "key": "Proj"
        },
        "issueType": {
            "name": "Bug"
        },
        "issuePriorityInfo": {
            "name": "High"
        },
        "requiredFieldsInfo": {
            "Parent": {
                "value": "TEST-123"
            },
            "Reporter": {
                "value": "Name Here"
            },
            "Components": {
                "value": "My Component"
            },
            "Labels": {
                "value": "My Label"
            },
            "My Custom Field": {
                "value": "Component values"
            }
        }
    }
}

Back to top.

Create Issue Action for a Policy (Issue Tracker Plugins)

...

Following are the query parameters that are required for defining an action of type “CREATE_ISSUE” when adding or updating a policy:

Parameter

Description

Type

Required

Default/Values

action

Data object for the Action API request.

string

Yes

type

The type of policy action that defines what to do when a library matches the policy's filter: i.e., CREATE_ISSUE

string

Yes

issueSettings

Data object containing all information regarding the created Issue action type:

string

Yes

summary

Summary that will be written when the issue is created.

string

Yes

description

Description that will be written when the issue is created.

string

Yes

issueTrackerType

Type of Issue Tracker used for the issue - i.e., Jira Plugin

string

Yes

JIRA, WORK_ITEMS, or Jira Plugin.

Request Example

Following is an example of the “action” object which is part of the “add policy” requests, for creating a CREATE ISSUE policy in the Jira Plugin Issue Tracker integration.

Code Block
action":{
    "type": "CREATE_ISSUE",
    "issueSettings": {
        "summary": "This field is meaningless and is only supported for backward compatibility",
        "description": "This field is meaningless and is only supported for backward compatibility",
        "issueTrackerType": "COMMON_ISSUE_TRACKER"
    }
}

Back to top.