Solved

Article ID in Storefront graphql API

Hewrin
Tourist
10 0 3

Hi friends,

I'm building an app that will get the Shops Articles via the Storefront API. The user will then be able to update articles (via the Admin REST API)

It seems the ID field for Articles in the Storefront API and the Admin REST API are different.

For a particular article I have the ID coming from the Admin REST API has a value of 198840589 whereas if I use the Storefront API the value is "Z2lkOi8vc2hvcGlmeS9BcnRpY2xlLzE5ODg0MDU4OQ==".

How do I reconcile these two values? Using the Storefront API ID, how do I get the Article from the Admin REST API?

Many thanks in advance

Faris

 

Accepted Solution (1)

vix
Shopify Staff
540 103 121

This is an accepted solution.

Hey @Hewrin 

 

The Storefront API is a base64 encoded version of the gid - you can encode / decode these values to share IDs between the two. 

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Reply 1 (1)

vix
Shopify Staff
540 103 121

This is an accepted solution.

Hey @Hewrin 

 

The Storefront API is a base64 encoded version of the gid - you can encode / decode these values to share IDs between the two. 

To learn more visit the Shopify Help Center or the Community Blog.