Shop branding information

Shop branding information

george231
Shopify Partner
5 0 1

Hello!

 

I am developing a public app and I am trying to get the shop's brand information (logo, colors), but I am facing an issue.

 

I found in the documentation that the brand can be found in the Storefront API (https://shopify.dev/api/storefront/2022-10/objects/Brand), but when I make a request I get a 200 response but with 'INTERNAL_SERVER_ERROR' in the body.

 

These are the steps I followed:

1. I made a 'delegateAccessTokenCreate' mutation to create a delegate access token. This succeeded.

2. I used that token in the 'Shopify-Storefront-Private-Token' header to send a 'shop' query. This returns the error.

 

Does anyone have any idea why this requests fail?

Or does anyone know another way to get the brand information? I looked into the Admin API doc but the brand is not present in the 'shop' query (https://shopify.dev/api/admin-graphql/2022-10/queries/shop  https://shopify.dev/api/admin-rest/2022-10/resources/shop)

Replies 7 (7)

ShopifyDevSup
Shopify Staff
1453 238 509

Hi @george231 if you have an X-Request-ID that would have been supplied through the headers in the Shopify response to the API call you made, we could also use that to check for any potential additional details in our logs on that Internal Error for you. 

Hope to hear from you soon! 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

george231
Shopify Partner
5 0 1

Hi! The request id is: 6dd361d1-41d8-4bf6-ad63-ae933fcdcf1d

ShopifyDevSup
Shopify Staff
1453 238 509

Hi @george231, unfortunately that request-id is not showing any data on our logs. Can you share the call you were making so we can try to replicate it. Also we are dealing with a backlog of requests over the holidays so its possible that request id is outside of log retention (14 days), do you have a more recent example? We are still working with a heavy backlog so please also share the call and response headers for the example if you have them. Thank you. 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

george231
Shopify Partner
5 0 1

Hi @ShopifyDevSup. Here are the requests I am making:

1. A request to get the delegate access token. This works and I get an access token.

 

mutation {
  delegateAccessTokenCreate(input: { delegateAccessScope: ["unauthenticated_read_product_listings"], expiresIn: 3600 }){
    delegateAccessToken {
      accessToken
    }
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}

 

 2. The query for the branding. I only requested the name to test it, but it does not even fetch the name. 

 

{
  shop {
    name
  }
}

 

 

Here is the response body of the second request:

 

{
  "errors": [
    {
      "message": "Internal error. Looks like something went wrong on our end.\nRequest ID: da8aa5d9-f9b4-4646-8e59-19eb6168f064 (include this in support requests).",
      "extensions": {
        "code": "INTERNAL_SERVER_ERROR",
        "requestId": "da8aa5d9-f9b4-4646-8e59-19eb6168f064"
      }
    }
  ]
}

 

Here is the HTTP request (from Postman):

 

POST /api/2022-10/graphql.json HTTP/1.1
Host: allblacks-multycurrency-2.myshopify.com
Shopify-Storefront-Private-Token: <delegate access token>
Content-Type: application/json
Content-Length: 56

{"query":"{\n  shop {\n    name\n  }\n}","variables":{}}

 

Here are the response headers:

 

date: Tue, 10 Jan 2023 12:01:02 GMT
content-type: application/json; charset=utf-8
x-sorting-hat-podid: 256
x-sorting-hat-shopid: 64412942593
x-storefront-renderer-rendered: 1
vary: Accept-Encoding
vary: Accept
x-frame-options: DENY
content-security-policy: block-all-mixed-content; frame-ancestors 'none'; upgrade-insecure-requests;
access-control-allow-credentials: true
access-control-allow-origin: *
x-shopify-api-version: 2022-10
x-shopid: 64412942593
x-shardid: 256
content-language: en
server-timing: processing;dur=148, db;dur=11, asn;desc="8708", edge;desc="OTP", country;desc="RO"
x-shopify-stage: production
x-dc: gcp-europe-west3,europe-west1,gcp-europe-west1
x-request-id: da8aa5d9-f9b4-4646-8e59-19eb6168f064
x-download-options: noopen
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
x-xss-protection: 1; mode=block
cf-cache-status: DYNAMIC
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=mnKj5bW8Kedu%2BwQCtlBHlHraWArotcalwGtE790ccMXlF1EdBVSbyda21cF7ZKE6gRn4%2FTXB2jfZE7Y1V6JCw2KUozJUYzvRz6XeHCaXVRcBNc%2Fd5i0w0WHX%2BMhMXEpeE52yiLRykCE6%2FZtbP1d3pikApcmmECAUOA%3D%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}
server-timing: cfRequestDuration;dur=234.999895
server: cloudflare
cf-ray: 78754176ef26051b-OTP
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

 

 

ShopifyDevSup
Shopify Staff
1453 238 509

Would you mind trying it in a curl request similar to the below:

 

curl -L -X POST 'https://YOUR_STORE_NAME.myshopify.com/api/2023-01/graphql.json' \
-H 'Shopify-Storefront-Private-Token: YOUR_DELEGATE_TOKEN' \
-H 'Content-Type: application/json' \
--data-raw '{"query":"{ shop { name } }","variables":{}}'

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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

george231
Shopify Partner
5 0 1

I tried and I got the same error

{"errors":[{"message":"Internal error. Looks like something went wrong on our end.\nRequest ID: 708da77f-b114-44f8-b7bb-1eb0d4153944 (include this in support requests).","extensions":{"code":"INTERNAL_SERVER_ERROR","requestId":"708da77f-b114-44f8-b7bb-1eb0d4153944"}}]}
MC-Partyapps
Shopify Partner
14 0 3

I am also looking to pull the shop branding info for my embedded app and I have the same exact issue. I'm successfully creating a delegate token with the scope  unauthenticated_read_product_listings  and then trying to pass that token along via the Shopify-Storefront-Private-Token  header to the shop's Storefront API to request the brand info. However I am unable to complete that second GraphQL request to the Storefront API and am also getting the Internal Server Error message. 

 

@george231 were you able to figure this out? @ShopifyDevSup any additional guidance/context since last the last post here.