This example describes how to use the API to apply governance scores to your assets.
The example requests in this topic use Curl syntax to show all of the information that is required in a request, including request headers, methods, endpoints, and data, as well as mandatory and optional parameters. Additionally, for each request, the same header information is displayed in a separate block for use when connecting to the Data360 Govern API via an API client.
1. Identify asset types
Use a GET /api/v2/assets/types
request to retrieve a list of all asset types in your system.
Example request
curl -X GET --header 'Accept: application/json' --header 'Authorization: key;secret' 'https://example.data3sixty.com/api/v2/assets/types'
The following example shows the header information for the same request for use when connecting to the Data360 Govern API via an API client:
GET https://example.data3sixty.com/api/v2/assets/types HTTP/1.1Authorization: <API Key>;<API Secret>
Accept: application/json
Example response
[
{ "uid": "188f094b-fb02-4de3-8790-8c0d32d98e1a", "Name": "Application", "Class": { "ID": 1, "Name": "Business Asset", "Description": "Business assets." }, "Path": "Application" },
{ "uid": "85315000-c77f-4898-84db-f4872cbd2dc0", "Name": "Bloomberg", "Description": "Metadata via the Bloomberg Fields CSV file and other Bloomberg sources.", "Class": { "ID": 2, "Name": "Technical Asset", "Description": "Technical assets." }, "Path": "Bloomberg" }
]
This response indicates that the UID for the 'Application' asset type is: 188f094b-fb02-4de3-8790-8c0d32d98e1a
You can also obtain the UID of an item from the UI by hovering over the information icon.
2. Identify existing measures for the asset type
Using the asset type uid
that you identified in step one, use a GET request to obtain a hierarchical structure of the associated measures.
Example request
This example request uses the UID of the 'Application' asset type that was obtained in step 1:
curl -X GET --header 'Accept: application/json' --header 'Authorization: key;secret' 'https://example.data3sixty.com/api/v2/metrics/188f094b-fb02-4de3-8790-8c0d32d98e1a/definition'
The following example shows the header information for the same request for use when connecting to the Data360 Govern API via an API client:
GET https://example.data3sixty.com/api/v2/metrics/188f094b-fb02-4de3-8790-8c0d32d98e1a/definition HTTP/1.1Authorization: <API Key>;<API Secret>
Accept: application/json
Example response
The response shows that the 'Application' asset type has one measure group with one child measure:
[ { "Uid": "d06f201c-4241-4102-8d68-07d4fb37dfc1", "IsGroup": true, "Name": "my metrics", "Weight": 0.5
"Metrics":[
{
"Uid": "c2604685-6fdc-4eae-beba-039e6a5d9335", "IsGroup": false, "Name": "child measure", "Weight": 1
} ]
}
]
3. Get metric information
Using the metric uid
value returned in step two, use a GET request to obtain a list of metric details.
Example request
curl -X GET --header 'Accept: application/json' --header 'Authorization: key;secret' 'https://example.data3sixty.com/api/v2/metrics/d06f201c-4241-4102-8d68-07d4fb37dfc1'
The following example shows the header information for the same request for use when connecting to the Data360 Govern API via an API client:
GET https://example.data3sixty.com/api/v2/metrics/d06f201c-4241-4102-8d68-07d4fb37dfc1 HTTP/1.1Authorization: <API Key>;<API Secret>
Accept: application/json
Example response
{ "Children": [ { "Children": [], "Versions": [ { "Conditions": [], "Uid": "c2604685-6fdc-4eae-beba-039e6a5d9335", "EffectiveDate": "2018-10-25T00:00:00.000Z", "Weight": 1, "ConditionAndOr": "a" } ], "Uid": "c2604685-6fdc-4eae-beba-039e6a5d9335", "ParentUid": "d06f201c-4241-4102-8d68-07d4fb37dfc1", "AssetTypeUid": "188f094b-fb02-4de3-8790-8c0d32d98e1a", "IsGroup": false, "State": 1, "Name": "Child measure ", "Description": "Child measure description" } ], "Versions": [ { "Conditions": [], "Uid": "d06f201c-4241-4102-8d68-07d4fb37dfc1", "EffectiveDate": "2018-10-25T00:00:00.000Z", "Weight": 0.5, "ConditionAndOr": "a" } ], "Uid": "d06f201c-4241-4102-8d68-07d4fb37dfc1", "AssetTypeUid": "188f094b-fb02-4de3-8790-8c0d32d98e1a", "IsGroup": true, "State": 1, "Name": "Measure group", "Description": "Measure group description"}
4. Load results into Data360 Govern
Use the POST /api/v2/metrics/results
request to upload metric scores on an 'Application' type asset.
In this example, we are updating the governance score for an asset which has the following UID value: b1c4f830-c71c-4f95-909d-a1d67ca5361c
Example request
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: key;secret' -d '[ \ { \ "AssetUid": "b1c4f830-c71c-4f95-909d-a1d67ca5361c", \ "MetricAssetUid": "d06f201c-4241-4102-8d68-07d4fb37dfc1", \ "EffectiveDate": "2019-05-08T08:51:56.737Z", \ "Result": true \ } \]' 'https://example.data3sixty.com/api/v2/metrics/results'
The following example shows the header information for the same request for use when connecting to the Data360 Govern API via an API client:
POST https://example.data3sixty.com/api/v2/metrics/results HTTP/1.1Authorization: <API Key>;<API Secret>
Content-Type: application/json
Accept: application/json
Request body:
[ { "AssetUid": "b1c4f830-c71c-4f95-909d-a1d67ca5361c", "MetricAssetUid": "d06f201c-4241-4102-8d68-07d4fb37dfc1", "EffectiveDate": "2019-05-02T00:00:00.000Z", "Result": true,
}]
Example response
[ { "AssetUid": "b1c4f830-c71c-4f95-909d-a1d67ca5361c", "MetricAssetUid": "d06f201c-4241-4102-8d68-07d4fb37dfc1", "EffectiveDate": "2019-05-02T00:00:00.000Z", "Result": true,
"IsSuccess": true
}]
If your request is successful, you will see the updated governance score for the specified asset in the UI, for example: