Skip to main content
Solved

How to get the relations of a catalog item via API?

  • August 21, 2025
  • 1 reply
  • 40 views

Forum|alt.badge.img

 How to get the catalog item related to the main catalog item via API?

 

Please help me to get that API.

Best answer by anna.spakova

Hello ​@Hanish N ,

catalog item relationships are stored in an entity called catalogItemRelationship. You can download the instances using ONE Metadata Reader:

The source is the ID of the source catalog item, target is the ID of the target catalog item and type is ID of the relationship type (e.g. parent-child). If you then want to get details of the items (like names) and name of the relationship, you have to further join with the catalog item entities and the relationshipType entity using those IDs.

Using graphql API, this is the same query:

query q{
catalogItemRelationships(versionSelector: {draftVersion: true}){
edges{
node{
gid
publishedVersion{
source{
gid
publishedVersion{
name
}
}
target{
gid
publishedVersion{
name
}
}
type{
gid
publishedVersion{
name
}
}
}
}
}
}
}

It gives you all CI relationships, including the table names and relationship type name.

 

Let me know if this helps.

Kind regards,

Anna

1 reply

anna.spakova
Ataccamer
Forum|alt.badge.img+3
  • Ataccamer
  • 211 replies
  • Answer
  • August 26, 2025

Hello ​@Hanish N ,

catalog item relationships are stored in an entity called catalogItemRelationship. You can download the instances using ONE Metadata Reader:

The source is the ID of the source catalog item, target is the ID of the target catalog item and type is ID of the relationship type (e.g. parent-child). If you then want to get details of the items (like names) and name of the relationship, you have to further join with the catalog item entities and the relationshipType entity using those IDs.

Using graphql API, this is the same query:

query q{
catalogItemRelationships(versionSelector: {draftVersion: true}){
edges{
node{
gid
publishedVersion{
source{
gid
publishedVersion{
name
}
}
target{
gid
publishedVersion{
name
}
}
type{
gid
publishedVersion{
name
}
}
}
}
}
}
}

It gives you all CI relationships, including the table names and relationship type name.

 

Let me know if this helps.

Kind regards,

Anna