Using API Version 4 to determine metadata type when knowing only uuid

When using the API call /metadata_info/latest_action/ I can retrieve a list of uuid’s of interest that have changed in some way over a given date range. But I don’t know what metadata entity type it is.

To get additional detail I can follow up with a call to /metadata/{item_uuid} which is metadata entity type agnostic. While it tells me everything about the metadata entity in question, I still don’t know for sure what the entity type is.

I realise I can find this out using graphQL, but is there any way to do this via the v4 API suite of calls?

Hello Michael,

Unfortunately, there is no way to retrieve the metadata type in the current v4 API. Allowing user to retrieve the metadata type in the v4 API is a great idea, we will add it this month and and let you know when it is ready.

Just for your information, the /metadata/{item_uuid} api is redirecting to an existing /metadata/{metadata_type}/{item_id} api using the item_uuid provided.

  • For example, /metadata/317d2e86-0ad6-11ec-96d2-0a58a9feac02 is redirected to /metadata/conceptualdomain/317d2e86-0ad6-11ec-96d2-0a58a9feac02

The redirected api endpoint contains the metadata type, maybe you could try if it is possible to retrieve the redirected api endpoint in the Headers of the response when you call the /metadata/{item_uuid} api?

Kind regards,
Chengwu

Hi Chengwu,

Yes the header of the response would work I think, just was wondering if there was a more explicit means to retrieve this.

I’ve switched to a graphQL call in the meantime.

Thanks,

Michael

Hello Michael,

One potential way is using curl

curl -Ls -w %{url_effective} -o /dev/null --header "Authorization: Token enter_your_aristotle_api_token" /api/v4/metadata/item_uuid 

For example:

curl -Ls -w %{url_effective} -o /dev/null --header "Authorization: Token 3f992f378a767101884c1ae6100b00574dffce19" https://staging.sydney.aristotlecloud.io/api/v4/metadata/317d2e86-0ad6-11ec-96d2-0a58a9feac02 

For your information:
-L Follow redirects
-s Silent mode. Don’t output anything
-o FILE Write output to instead of stdout
-w FORMAT What to output after completion

Kind regards,
Chengwu