Get Access Token
The access token is used in the request header Authorization: Bearer <COPY ACCESS CODE HERE>
Code Block |
---|
# REPLACE: <CLIENT_ID>, <USER>, <PASSWORD>
curl -X POST -u "<CLIENT_ID>:" \
-d "grant_type=password&username=<USER>&password=<PASSWORD>&scope=openid profile email" \
https://<domain>/keycloak/auth/realms/kada/protocol/openid-connect/token
# Response. The access_token will be used to authenticate API calls to KADA.
{
"access_token": "..",
"expires_in": 7200,
"refresh_expires_in": 86400,
"refresh_token": "...",
"token_type": "bearer",
"id_token": "...",
"not-before-policy": 0,
"session_state": "...",
"scope": "openid profile email"
}
export ACCESS_TOKEN=<ACCESS TOKEN FROM }RESPONSE> |
Get an object
Get the table with name ‘customer’
Code Block |
---|
curl --location \
--request GET 'https://<domain>/api/tables?name=customer' \
--header '"Authorization: Bearer <ACCESS TOKEN>'${ACCESS_TOKEN}" |
Get fully qualified table name: table123, in schema3 in db2 in host1.
Code Block |
---|
curl --location \
--request GET 'https://<domain>/api/tables?signature=host1.db2.schema3.table123' \
--header '"Authorization: Bearer <ACCESS TOKEN>'${ACCESS_TOKEN}" |
Updating a description
<TABLE ID>
can be found from the Get object call.
Code Block |
---|
curl --location --request PUT 'https://<domain>/api/tables/<TABLE ID>' \
--header '"Authorization: Bearer <ACCESS TOKEN>'${ACCESS_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "Add your description here",
"replace_date": null
}' |
...
Code Block |
---|
curl --location --request POST 'https://<domain>/api/tags' \
--header '"Authorization: Bearer <ACCESS TOKEN>' ${ACCESS_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"description": "Add your tag description here",
"name": "tag_name"
}' |
...
Code Block |
---|
curl --location \
--request PUT 'https://<domain>/api/tables/<TABLE_ID>/related?object_id=<TAG_ID>&relationship=TAGGED_BY' \
--header '"Authorization: Bearer <ACCESS_TOKEN>'${ACCESS_TOKEN}" |
Delete a tag from an object
Code Block |
---|
curl --location \
--request DELETE 'https://<domain>/api/tables/<TABLE_ID>/related?object_id=<TAG_ID>&relationship=TAGGED_BY' \
--header '"Authorization: Bearer <ACCESS_TOKEN>'${ACCESS_TOKEN}" |
Get a collection template
...
Code Block |
---|
curl --location \
--request GET 'https://domain/api/collections?name=Classification' \
--header '"Authorization: Bearer <Access Token>'
# Response
${ACCESS_TOKEN}" |
Response - note the properties which will be used to create collection instances.
Code Block |
---|
{
"id": "e1fd2337-1b0e-3841-8d60-7c85daa1707e",
"id_seq": 2,
...
"properties": [
{
"allowed_values": [],
"data_type": "TEXT_FIELD",
"description": "Add a name for the instance",
"id": "1",
"name": "name",
"required": true
},
{
"allowed_values": [],
"data_type": "TEXT_BOX",
"description": "Add a description for the instance",
"id": "2",
"name": "description",
"required": false
},
{
"allowed_values": [],
"data_type": "USER_LOOKUP_FILTERED",
"description": "Add an owner for the instance",
"filter": "16e05af2-13fa-301d-b7fa-69d48bc71d7d",
"id": "-1",
"name": "data owner",
"required": false
},
{
"allowed_values": [],
"data_type": "USER_LOOKUP_FILTERED_MULTI",
"description": "Add steward(s) for the instance",
"filter": "d13d6b10-a535-3718-854d-459f086ad057",
"id": "-2",
"name": "data steward",
"required": false
}
]
...
"score": 5.0,
"short_name": "classification",
"signature": "platform/classification",
"source_id": 1000,
"updated_at": "2021-10-14T16:02:13.139799+00:00"
} |
...
Code Block |
---|
curl --location --request POST 'https://<domain>/api/collectioninstances' \
--header '"Authorization: Bearer <ACCESS TOKEN>' ${ACCESS_TOKEN}" \
--header 'Content-Type: application/json' \
--data-raw '{
"collection_id": "<COLLECTION ID>",
"description": "Open information",
"name": "Public",
"properties": {
"1": "Public",
"2": "Open information",
"-1": "",
"-2": []
}
}' |
...
Code Block |
---|
curl --location \
--request PUT 'https://<domain>/api/tables/<TABLE ID>/related?object_id=<COLLECTION INSTANCE ID>&relationship=MEMBER_OF' \
--header '"Authorization: Bearer <ACCESS_TOKEN>'${ACCESS_TOKEN}" |
Creating manual lineage to an upstream table
...
Code Block |
---|
curl --location \
--request PUT 'https://<domain>/api/tables/<TABLE ID>/related?object_id=<UPSTREAM TABLE ID>&relationship=SOURCE_FROM' \
--header '"Authorization: Bearer <ACCESS_TOKEN>'${ACCESS_TOKEN}" |