Skip to main content
Skip table of contents

Global 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 Mend Application, but they cannot execute Organization-related API calls which are outside their scope.

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

  • change the assignment of projects between products

  • changing the owner for all policies in an organization

  • 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

NOTE: Global Organization Level APIs can be accessed only by users with Site Admin privileges in On-Premise environments.

The following APIs describe how to create global organizations, assign them to organizations, or remove them from organizations. 

Create Global Organization

This API request creates a global organization with an API key token which is its unique identifier.

QUERY PARAMETERS

Parameter

Description

Type

Required i

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 mend.

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
{
   "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.

CODE
{
   "globalOrgToken": "global_org_token"
}

Assign Global Organization to an Organization

This API request assigns 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 mend.

string

Yes

orgToken

API key which is the unique identifier of the organization. Admins can find this token in the "Integrate" tab of the application, in the "API Key" field.

string

Yes

globalOrgToken

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

string

Yes

Request Example 
CODE
{
   "requestType": "assignGlobalOrgToOrg",
   "userKey": "user_key",
   "orgToken": "organization_api_key",
   "globalOrgToken": "global_org_token"
}

Response Example

CODE
"message":"Successfully assigned global organization to given organization"

Remove Global Organization from an Organization

This API request removes 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 mend.

string

Yes

orgToken

API key which is the unique identifier of the organization. Admins can find this token in the "Integrate" tab of the application, in the "API Key" field.

string

Yes

globalOrgToken

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

string

Yes

Request Example
CODE
{
   "requestType": "removeGlobalOrgFromOrg",
   "userKey": "user_key",
   "orgToken": "organization_api_key",
   "globalOrgToken": "global_org_token"
}

Response Example

CODE
"message":"Successfully removed global organization from given organization"

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 mend.

string

Yes

globalOrgToken

API token key which uniquely identifies the global organization.

string

Yes

Request Example

CODE
{
  "requestType":"getAllOrganizations",
  "userKey": "user_key", 
  "globalOrgToken":"global_organization_token"
}

Response Example

CODE
{
    "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 mend.

string

Yes

orgToken

API token key which uniquely identifies the organization.

string

Yes

Request Example

CODE
{
"requestType":"getOrganizationDetails",
"orgToken":"organization_api_key",
“userKey”:”user_key”
}

Response Example

CODE
{
"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 mend.

string

Yes

orgToken

API token key which uniquely identifies the organization.

string

Yes

Request Example

CODE
{
  "requestType":"getAllProducts",
  "userKey": "user_key", 
  "orgToken":"org_token"
}

Response Example

CODE
{
    "products": [
        {
            "productName": "Product A",
            "productToken": "product_a_token"
        },
        {
            "productName": "Product B",
            "productToken": "product_b_token"
        }
    ],
    "message": "Success"
}

Get Organization Product Vitals

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 vitals of all products in an organization.

string

Yes

userKey

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

string

Yes

orgToken

API token key which uniquely identifies the organization.

string

Yes

Request Example

CODE
{
	"requestType" : "getOrganizationProductVitals",
    "userKey": "user_key", 
	"orgToken" : "organization_api_key"
}

Response Example

CODE
{
    "productVitals": [
        {
            "id": 626506,
            "name": "Demo Product",
            "token": "product_token",
            "creationDate": "2020-03-09 15:28:38 +0000",
            "lastUpdatedDate": "2020-03-10 08:46:29 +0000"
        },
        {
            "id": 626507,
            "name": "Cfy",
            "token": "product_token",
            "creationDate": "2020-03-09 15:29:11 +0000",
            "lastUpdatedDate": "2020-03-10 08:18:37 +0000"
        },
        {
            "id": 626930,
            "name": "Rx",
            "token": "product_token",
            "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 the projects in the specified 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 mend.

string

Yes

productToken

API token key which uniquely identifies the product.

string

Yes

Request Example

CODE
{
  "requestType":"getAllProjects",
  "userKey": "user_key", 
  "productToken":"product_token"
}

Response Example

CODE
{
    "projects": [
        {
            "projectName": "project_a",
            "projectToken": "project_a_token"
        },
        {
            "projectName": "project_b",
            "projectToken": "project_b_token"
        }
    ],
    "message": "Success"
}

Get Organization Project Vitals

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 vitals of all projects in an organization.

string

Yes

userKey

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

string

Yes

orgToken

API token key which uniquely identifies the organization.

string

Yes

Request Example

CODE
{
	"requestType" : "getOrganizationProjectVitals",
     "userKey": "user_key", 
	"orgToken" : "organization_api_key"
}

Response Example

CODE
{
    "projectVitals": [
        {
            "id": 2036041,
            "name": "Demo Data",
            "token": "org_token",
            "creationDate": "2020-03-09 15:28:38 +0000",
            "lastUpdatedDate": "2020-03-09 15:28:38 +0000"
        },
       {
            "id": 2036049,
            "name": "cfy-1",
            "token": "org_token",
            "creationDate": "2020-03-09 15:29:49 +0000",
            "lastUpdatedDate": "2020-03-09 15:29:49 +0000"
        },
          ..........

Get Product Project Vitals

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 vitals of all projects in a product.

string

Yes

userKey

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

string

Yes

productToken

API token key which uniquely identifies the product.

string

Yes

Request Example

CODE
{
	"requestType" : "getProductProjectVitals",
    "userKey": "user_key", 
	"productToken" : "product_token"
}

Response Example

CODE
{
    "projectVitals": [
        {
            "pluginName": "unified agent",
            "pluginVersion": "20.2.1",
            "id": 2038527,
            "name": "my-proj",
            "token": "product_token",
            "creationDate": "2020-03-10 08:33:25 +0000",
            "lastUpdatedDate": "2020-03-10 08:34:38 +0000"
        }
    ]
}

Get Project Vitals

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 vitals of a project.

string

Yes

userKey

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

string

Yes

projectToken

API token key which uniquely identifies the project.

string

Yes

Request Example

CODE
{
	"requestType" : "getProjectVitals",
    "userKey": "user_key", 
	"projectToken" : "project_token"
}

Response Example

CODE
{
    "projectVitals":[
        {
            "pluginName":"fs-agent",
            "pluginVersion": "18.2.2",
            "name": "My Project",
            "token": "project_token",
            "uploadedBy": "name_of_user_who_ran_scan",
            "creationDate": "2016-01-01 12:00:00",
            "lastUpdatedDate": "2016-02-02 16:50:59"
        }
    ]
}

Change Project Assignment

This API request allows you to move projects that are assigned to a particular product and assign them to another product.

QUERY PARAMETERS

Parameter

Description

Type

Required

requestType

API request type that changes the project assignment.

string

Yes

orgtoken

API token key which uniquely identifies the organization.

string

Yes

userKey

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

string

Yes

projectToken

API token key which uniquely identifies the project to be reassigned.

string

Yes

newProductToken

API token key which uniquely identifies the product to which the project will be reassigned.

string

Yes

Request Example

CODE
{
    "requestType": "changeProjectAssignment",
    "orgToken": "{{orgToken}}",
    "userKey": "{{userKey}}",
    "projectToken": "{{projectToken}}",
    "newProductToken": "{{productToken}}"
}

Response

CODE
{
    "message": "Project assigned successfully to the new product"
}

Change Policy Owner

This API finds all the policies that were created by the user with the email specified in "currentPolicyOwnerEmail", and reassigns them to the user with the email specified in "newPolicyOwnerEmail".

QUERY PARAMETERS

Parameter

Description

Type

Required

requestType

API request type that changes the policy owner for all policies in an organization.

string

Yes

userKey

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

string

Yes

orgToken

API token key which uniquely identifies the organization.

string

Yes

currentPolicyOwnerEmail

Email address of current policy owner.

string

Yes

newPolicyOwnerEmail

Email address of new policy owner for the organization.

string

Yes

Request Example

CODE
{
  "requestType":"changeOrganizationPolicyOwner",
  "userKey": "user_key", 
  "orgToken":"organization_api_key",
  "currentPolicyOwnerEmail":"Owner.email@mendsoftware.com",
  "newPolicyOwnerEmail" : "newOwner.email@mendsoftware.com"
}

Response

CODE
{
    "message": "Successfully changed policy owners in the organization"
}

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

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 mend.

string

Yes

Request Example

CODE
{
    "requestType" : "getOrganizationInHouseLibraries",
    "orgToken" : "organization_api_key",
    "userKey": "user_key"
}

Response Example

CODE
{
    "libraries": [
        {
            "matchType": "manual",
            "comment": "",
            "keyUuid": "library_unique_id",
            "filename": "neo4j-lucene-index-1.8.1.jar",
            "groupId": "org.neo4j",
            "artifactId": "neo4j-lucene-index",
            "sha1": "library_sha1",
            "type": "MAVEN_ARTIFACT",
            "description": "Integration layer between Neo4j and Lucene, providing one possible implementation of the Index API.",
            "productName": "Demo Product",
            "productToken": "product_token",
            "projectName": "Demo Data",
            "projectToken": "project_token"
        },
        {
            "matchType": "manual",
            "comment": "",
            "keyUuid": "library_unique_id",
            "filename": "nekohtml-1.9.6.2.jar",
            "groupId": "nekohtml",
            "artifactId": "nekohtml",
            "sha1": "library_sha1",
            "type": "MAVEN_ARTIFACT",
            "productName": "Demo Product",
            "productToken": "product_token",
            "projectName": "Demo Data",
            "projectToken": "project_token"
        }
    ]
}

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

Unique identifier of the product.

string

Yes

userKey

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

string

Yes

Request Example

CODE
{
    "requestType" : "getProductInHouseLibraries",
    "productToken" : "product_token",
    "userKey": "user_key"
}

Response Example

CODE
{
    "libraries": [
        {
            "matchType": "manual",
            "comment": "",
            "keyUuid": "library_unique_id",
            "filename": "neo4j-lucene-index-1.8.1.jar",
            "groupId": "org.neo4j",
            "artifactId": "neo4j-lucene-index",
            "sha1": "library_sha1",
            "type": "MAVEN_ARTIFACT",
            "description": "Integration layer between Neo4j and Lucene, providing one possible implementation of the Index API.",
            "productName": "Demo Product",
            "productToken": "product_token",
            "projectName": "Demo Data",
            "projectToken": "project_token"
        },
        .........
    ]
}

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

Unique identifier of the project.

string

Yes

userKey

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

string

Yes

Request Example

CODE
{
    "requestType" : "getProjectInHouseLibraries",
    "projectToken" : "project_token",
    "userKey": "user_key"
}

Response Example

CODE
"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 mend.

string

Yes

keyUuid

The ID of the library which uniquely identifies it.

string

Yes

Request Example

CODE
{
    "requestType": "unmarkManualInHouseLibrary",
    "userKey": "user_key",
    "orgToken": "organization_api_key",
    "keyUuid" : "library_UUID"
}

Response Example

CODE
{
    "message": "Successfully unmarked in-house library"
}

Manage Pending Tasks

Theses APIs retrieve a list of all Pending Tasks in a domain and allow them to be deleted one by one.

Get Pending Tasks in a Domain

This API requests a list of all Pending Tasks in a domain.

QUERY PARAMETERS

Parameter

Description

Type

Required

requestType

API request type that returns all Pending Tasks in the domain.

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 Mend.

string

Yes

page

The page number from which to start listing the pending tasks. The default is 0.

integer

No

pageSize

The number of pending tasks to be included in the page; permitted values are in the range 1-10,000

integer

No

Request Example

CODE
{
    "requestType":"getDomainPendingTasks",
	"orgToken": "organization_api_key",
	"userKey": "user_key",
	"page": 0,
	"pageSize": 1000
}

Response Example

CODE
{
    "pendingTaskInfos": [
        {
            "uuid": "dd63bdb4-2a46-40db-a4a8-c894988a99fc",
            "productName": "red",
            "projectName": "redeb - 13",
            "artifact": "libudev1_245.4-4ubuntu3.13_amd64.deb",
            "sha1": "83dc945b8b471c42ee9037cace6801dbb904f0fe",
            "creationTime": "2022-04-18 10:28:18",
            "approverEmail": "hasan.mosa@mendsoftware.com"
        },
        {
            "uuid": "e5ee86b7-5c5a-4aa1-a90d-ed59746a719e",
            "productName": "Test_Product",
            "projectName": "G_Project",
            "artifact": "ecrcustomerisv2-cloud-config-03.00.00.71-SNAPSHOT.jar",
            "sha1": "f82138e1d2823fd0be5cbfafcceefaae70eaf4fe",
            "creationTime": "2022-04-06 10:59:06",
            "approverEmail": "hasan.mosa@mendsoftware.com"
        }
    ]
}

Delete Pending Tasks in a Domain

This API request deletes a single Pending Task in a domain with a given uuid.

QUERY PARAMETERS

Parameter

Description

Type

Required

requestType

API request type for deleting a Pending Task.

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 mend.

string

Yes

taskUUID

A uuid for one of the Pending Tasks that was returned by the getDomainPendingTasks API.

string

Yes

Request Example

CODE
{
    "requestType":"closePendingTask",
	"orgToken": "organization_api_key",
	"userKey": "user_key",
	"taskUUID": "e5ee86b7-5c5a-4aa1-a90d-ed59746a719e"
}

Response Example

CODE
{
    "message": "Pending task closed successfully" / "Pending task not closed"
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.