Closed TheGame2500 closed 7 years ago
The method signature is:
shopify.customCollection.get(id[, params])
you should pass only the id if you don't want to specify what fields should be included in the response.
shopify.customCollection.get(358753670)
.then(collection => console.log(collection))
.catch(err => console.error(err));
should work.
@lpinca same not found error
What I'm interested in is documented @ https://help.shopify.com/api/reference/customcollection
GET /admin/custom_collections.json?product_id=632910392
I'm also OK with finding the product's collects and by product id (which works) and then find each collect's custom collections (this sounds weird)
GET /admin/custom_collections/#{id}.json
Neither of those works with this package unfortunately :(
That's weird, unfortunately I don't have a shop to check where the error is atm.
Can you log the url
argument here https://github.com/MONEI/Shopify-api-node/blob/a710aaa5852f3a5f41fa84cba4edb8800b9b9873/index.js#L81 and see if it is correct?
If so, try to make the same request with curl or postman and see if you still get a 404 error.
Stupid question: does the collection you are requesting exist?
@lpinca the collection does exist, just checked manually. The url argument is an object in the format :
{ path: '/admin/custom_collections/12498982.json?limit=1',
auth: false,
hostname: 'blabla.myshopify.com',
protocol: 'https:' }
Should I manually build it?
@TheGame2500 yes.
Try
curl -i -H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Shopify-Access-Token: <your_token_here>" \
https://blabla.myshopify.com/admin/custom_collections/12498982.json?limit=1
@lpinca turns out it still says not found. Hold on, maybe it's a mistunderstanding on my part.
@lpinca so it seems like their API has suffered an undocumented change.It works with
/admin/collections/1298479879.json
instead of
/admin/custom_collections/1298479879.json
And that's why programmers die younger.
LE: I tried editing it in custom-collection.js but it still says not found.
@lpinca when I do a call to /admin/custom_collections.json it returns an empty array. Perhaps the fault's with me after all
Hmm still weird, there isn't a Collection
resource so I'm not sure why /admin/collections/
works.
It looks like that is a private API.
Given that you get an empty array from /admin/custom_collections.json
(this explains why you get a 404 when using a specific id) I guess that your 1298479879
collection is smart collection?
What you get if you query the smart collections? Is the array still empty?
My fault after all. There was no customCollection, it was a smartCollection but I was unfamilliar with their data format.
2016-12-14 18:56 GMT+02:00 Luigi Pinca notifications@github.com:
It looks like that is a private https://ecommerce.shopify.com/c/shopify-apis-and-technology/t/get-both-custom-smart-collections-in-a-single-api-call-201612 API.
Given that you get an empty array from /admin/custom_collections.json (this explains why you get a 404 when using a specific id) I guess that your 1298479879 collection is smart collection?
What you get if query the start collections? Is the array still empty?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MONEI/Shopify-api-node/issues/109#issuecomment-267089285, or mute the thread https://github.com/notifications/unsubscribe-auth/AMVCo1gi2H1NIxhxt1zIPkmlOnmlwQX8ks5rIB-xgaJpZM4LL4H0 .
No problem. Closing this, please comment or reopen if needed.
When I try to do
it throws
I've also tried
as a sort of workaround, but for that it says 404 not found and shows host as undefined , even though the path looks ok.