Expand my Community achievements bar.

Join us in celebrating the outstanding achievement of our RTCDP Community Member of the Year!
SOLVED

Can we apply DULE labels to attributes in Schema via API ?

Avatar

Level 5

Hi Everyone,

 

I’m exploring whether it’s possible to apply DULE labels to attributes in a schema via API.

 

I know we can Create/Update/Delete labels using the Policy Service APIs, but is there an option to apply these labels when creating/updating a schema via API?

 

Any guidance would be appreciated!

 

Thanks!

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor
3 Replies

Avatar

Correct answer by
Employee Advisor

@Indra wait for others to chime in but from these 2 documents below, it looks like the APIs only allow you to add data usage labels to datasets:

https://experienceleague.adobe.com/en/docs/experience-platform/data-governance/api/labels

https://experienceleague.adobe.com/en/docs/experience-platform/data-governance/labels/dataset-api#ap... 

Avatar

Level 5

Hi @Indra .
All I tried is simply to lookup a fieldgroup that has a field to which label is applied via fieldgroup lookup api and no where it reflects/denotes in property that field has any label associated. Schema lookup also didn't help as it just specifies fieldgroup ids your schema is created with. I think label framework doesn't tie labels to schema as their metadata.

So, to my knowledge I don't see any way while creating or performing any patch request you can assign/alter labels via API to schema. 

E.g:
"properties": {
    "OS": {
    "required": [],
    "type": "string",
    "title": "OS",
    "meta:xdmType": "string"

    "label" : "C11"  // I dont see any such property exists else this would have been a way for you.
    }
}

Avatar

Level 2

@Indra, you can use schema registry API.

 

Example: 

POST https://platform.adobe.io/data/foundation/schemaregistry/tenant/descriptors

Body: 

{
"@type": "xdm:descriptorLabel",
"xdm:sourceSchema": "{{schemaID}}",
"xdm:sourceVersion": 1,
"xdm:sourceProperty": "/pathOfField/FromSchema/WhereYouWantToApplyLabel",
"xdm:labels": [
"core/I2",
"core/S2"
]
}