Solved

Question about shopify interface

Object
Shopify Partner
4 0 1

为什么(检索自定义集合列表/检索单个自定义集合)这两个接口现在不返回标题字段?标题字段会返回,但是现在不知道为什么没有返回。

Accepted Solution (1)
awwdam
Shopify Staff
249 42 36

This is an accepted solution.

Hey @Object,

The Collect - REST Admin API resource only returns the properties listed in that doc, and does not include the collection "title" property.

I would suggest an alternative approach by using the 'collection_id' returned in a collect object to send either a Collection request or a CustomCollection request , both will return the "title" property.

Hope this helps resolve your search! - Cheers

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 4 (4)

Jason
Shopify Expert
11190 225 2283

I'm using a translate tool here so hopefully I've understood your question.

 

I did a test on my own test shop. A GET request on a smart collection returned the title field as expected. Can you please show what call you made and the API version used?

 

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★
Object
Shopify Partner
4 0 1

I am calling (https://{api_key}:{client_secret}@{api_url}/admin/api/2021-10/collects.json) to request collection information from this address. I request the interface through get, and the response is as follows:

{
    "collects": [
        {
            "id"31733336146157,
            "collection_id"393898983661,
            "product_id"7519657689325,
            "created_at""2021-12-30T21:50:02-05:00",
            "updated_at""2021-12-30T21:50:04-05:00",
            "position"1,
            "sort_value""0000000001"
        }
    ]
}
 
Then I make a request through (https://{api_key}:{client_secret}@{api_url}/admin/api/2021-10/collects/31733336146157.json), and the response is as follows:
 
{
    "collect": {
        "id"31733336146157,
        "collection_id"393898983661,
        "product_id"7519657689325,
        "created_at""2021-12-30T21:50:02-05:00",
        "updated_at""2021-12-30T21:50:04-05:00",
        "position"1,
        "sort_value""0000000001"
    }
}
 
The above two interfaces do not return the title field. I don't know why? I look forward to your reply
awwdam
Shopify Staff
249 42 36

This is an accepted solution.

Hey @Object,

The Collect - REST Admin API resource only returns the properties listed in that doc, and does not include the collection "title" property.

I would suggest an alternative approach by using the 'collection_id' returned in a collect object to send either a Collection request or a CustomCollection request , both will return the "title" property.

Hope this helps resolve your search! - Cheers

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Object
Shopify Partner
4 0 1

I'm very sorry, I misread the interface, thank you very much for your professional answer