How do I construct a URL from any resource handle?

Solved

How do I construct a URL from any resource handle?

govind_nitk
Shopify Partner
7 1 2

 

Hello,

 

How to construct the URL for any resource handle ? 

I couldn't see any option to get absolute URL of the resource using rest API.

 

say the blog article has url "hello-world",  whether to append "/blogs/" or "/blogs/news/" is not clear.

If any other API is available to see what are all prefixes to append with respect to resource ( say product, page etc), please mention.

 

Accepted Solution (1)
govind_nitk
Shopify Partner
7 1 2

This is an accepted solution.

Replies 3 (3)

govind_nitk
Shopify Partner
7 1 2

Hello Developers, 
Any inputs will be highly appreciated

govind_nitk
Shopify Partner
7 1 2

We got response from Support them:

Typically Shopify doesn't provide a means to capture URL for resources within the API, because a resource may have more than one URL. For example a product could be accessed from multiple different collections. As a result, you are generally required to build a URL via context. To my knowledge only the Article and Blog API would retrieve blog information, and both in this case only allow for retrieval of the handles, but not the URLs.

But this is still unanswered. From Rest API, we have article dict with handle and we are stuck in formulating URL. If reading url can be done via graphql, please share a link. Thanks

govind_nitk
Shopify Partner
7 1 2

This is an accepted solution.