Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Changing the return URL slug from GraphQL using Storefront API

Changing the return URL slug from GraphQL using Storefront API

Ivandev15
Visitor
1 0 0

Hello, I've created a website using the Shopify API, and am pulling products and articles using the IDs of each element.

 

However, the return slug ends up being something like:

https://xxxxxx/article/Z2lkOi8vc2hvcGlmeS9BcnRpY2xlLzU1Njk3MzgxODAzOA==

is there any way to replace everything after /article/ with the handle of the item in question?

 

Thank you.

Reply 1 (1)

Luke_K
Shopify Staff
402 66 103

Hey @Ivandev15 

Had you tried base 64 decoding the end of that URL? The end of it is the base 64 encoded value of the Article ID -  if I window.atob it, it'll give you something like - gid://shopify/Article/12345678. 

Hope that helps - let me know if I'm missing anything!

 

 

 

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!