Hi Binod, yes, I see what you're trying ot do here. The short answer is that I don't think that the out-of-the-box REST API is going to behave the way that you want. For content, the API is focussed on the CMS_Tree structure, and your linked document effectively is a new item in here. Your calling service may need to do some work here by calling the API again when NodeLinkedNodeID
is not null
.
For example, on my test site, when I call http://localhost/cx10/rest/content/site/blank/en-GB/all?classnames=cms.news&columns=nodealiaspath,DocumentName,DocumentNamePath,NodeAliasPath,NodeLinkedNodeID
I see the following results:
<cms_documents>
<cms_news>
<nodealiaspath>/News/News-article-1</nodealiaspath>
<DocumentName>News article 1</DocumentName>
<DocumentNamePath>/News/News article 1</DocumentNamePath>
</cms_news>
<cms_news>
<nodealiaspath>/News/News-article-2</nodealiaspath>
<DocumentName>News article 2</DocumentName>
<DocumentNamePath>/News/News article 2</DocumentNamePath>
</cms_news>
<cms_news>
<nodealiaspath>/News/News-article-3</nodealiaspath>
<DocumentName>News article 3</DocumentName>
<DocumentNamePath>/News/News article 3</DocumentNamePath>
</cms_news>
<cms_news>
<nodealiaspath>/News/News-article-4</nodealiaspath>
<DocumentName>News article 4</DocumentName>
<DocumentNamePath>/News/News article 4</DocumentNamePath>
</cms_news>
<cms_news>
<nodealiaspath>/News/News-article-5</nodealiaspath>
<DocumentName>News article 5</DocumentName>
<DocumentNamePath>/News/News article 5</DocumentNamePath>
</cms_news>
<cms_news>
<nodealiaspath>/Home/News-article-1</nodealiaspath>
<DocumentName>News article 1</DocumentName>
<DocumentNamePath>/News/News article 1</DocumentNamePath>
<NodeLinkedNodeID>1384</NodeLinkedNodeID>
</cms_news>
</cms_documents>
The last item in the list here is a linked document, so I know I need to retrieve it using http://localhost/cx10/rest/content/site/blank/en-GB/all?classnames=cms.news&columns=nodealiaspath,DocumentName,DocumentNamePath,NodeAliasPath,NodeLinkedNodeID&where=NodeID=1384
If you need something more tailored than that, it's my understanding that you're going to create something custom.