API Endpoints for widgets

Base URL: https://console.cloudnosys.com/api/v1

Each user is provided with a ‘clientId’ and ‘clientSecret’ to access an endpoint (API).

Authorization URL: https://console.cloudnosys.com/api/v1/auth/token

An access token is required to get data from an API. It can be generated from this endpoint.

Request type:  POST

Request headers
Fields Value
Content-Type ‘application/json’
Request body
Fields Type
clientId String
clientSecret String

 

Response body

Status: 200

JSON representation

   “token”:  ACCESS_TOKEN

   “status”:  200

}

 

Status: 400

JSON representation

   “Status”: 400

   “message”: ERROR_MESSAGE

}

 

ERROR_MESSAGE
clientId and clientSecret is required! ‘clientId’ or ‘clientSecret’ is missing in the request body.
Invalid credentials! ‘clientId’ or ‘clientSecret’ is not correct.

 

 

Users can get data from any widget for any cloud account of an organization
HTTP URL: https://console.cloudnosys.com/api/v1/widgets 

Request type:  POST

Request headers
Fields Value
Content-Type ‘application/json’
Authorization ACCESS_TOKEN
Request body
Fields Type Description
orgId String It is the organization id i.e myorg_3x4
cloudAccounts Array It is the list of cloud account id’s (provided by cloudnosys), for which you require widgets data,

i.e [ “dmFaJkoj8JLtQzGfccr” , ”AmFaDaAU88JLtQzasdf” ]

widget String It can be one of these possible values:

  • SecurityPosture
  • Inventory
  • Network
  • Compute
  • Storage
  • IAM
  • RisksByRegion
  • PublicallyExposedResources
  • MostCriticalResources
  • RisksByGroup
  • ComplianceOverview
  • SecurityGroups
  • Regulations
  • ComplianceStandards
  • RisksBySeverity
  • RisksByCloudAccount
  • RisksByCategory
relativeDate String It can be one of these possible values:

  • Current
  • Yesterday
  • Last Week
  • Last Month

 

Response body
JSON representation

   “widgetId”:  String ,

   “widgetName”: String,

   “widgetDescription”: String,

   “relativeDate”: String,

   “data”:  Object

}

 

Sample Response body
JSON representation
{

    “widgetId”: “SecurityPosture”,

    “widgetName”: “Security Posture”,

    “widgetDescription”: “Security Posture”,

    “relativeDate”: “Yesterday”,

    “data”: {

        “total”: 1780,

        “passed”: 1078,

        “low”: 110,

        “medium”: 118,

        “high”: 474,

        “percentage”: “61”

    }

}

 

Status: 401

JSON representation

   “Status”: 401

   “message”: ERROR_MESSAGE

}

 

ERROR_MESSAGE
Unauthorized request!
  • Missing authentication token in headers or invalid token. 
  • Trying to access the restricted organization.

 

Status: 400

JSON representation

   “Status”: 400

   “message”: ERROR_MESSAGE

}

 

ERROR_MESSAGE
Invalid request! Any of the required params in the request body is missing. i.e  orgId, cloudAccounts, relativeDate, widget.