I am new at Shopify App Development.I was trying to do post request to add product on my store.My post request is:
the params are:
"title": "Burton Custom Freestyle 151",
"body_html": "<strong>Good snowboard!</strong>",
"Barnes & Noble",
Second Method :
Also I have tried a second method where I was passing my <access_token> in header using X-Shopify-Access-Token.
In both the cases I am getting the response as:
window.location = "https:\/\/app.shopify.com\/services\/login\/identity?destination_uuid=b37e8a73-1443-468e-9515-ff1e82cfab99\u0026enforce_merge=false\u0026merge_ignore_postponed=false\u0026prompt=merge\u0026return_to=https%3A%2F%2Fa%2Fservices%2Flogin%2Fidentity_callback%3Ffrom_signup%3Dfalse%26locale%3Den%26shop_name%3Ddecryptstore%26state%3D61msD8WfwIq7frFE92EuQoV_BbX-w-y8djyrDFC6DypjvlLXjqE4h2RdxujGxlFDiprATJYMito4HD6Rrc_kXnTLq2T4-CIZzcTe2FZcnzK8qvSZyLtwh8fv6etYASpiH1u903Lq095TKyn_PuuRIGry1vf8gKYAVoeSB7Rs6x1k1DZdp-gWwVg0400bG--lZlLtg0OzxowPSWGEFFzstcRBNct_XAq8bQh207meuBU%253D\u0026ui_locales=en\u0026ux=shop";
I have also tried the post request for adding script tag.My post request was:
I have tried putting "Content-Type: application/json" But I got same response.
Can someone please help me with this.
Solved! Go to the solution
This is an accepted solution.
Is your access token a Storefront API or Admin API token? If it's an Admin API token you can pass it in X-Shopify-Access-Token header, but the URL you are posting should be of the following format:
@Ruben00001 what is the exact URL you are calling and what specifically you are trying to achieve?
Hi @Visely-Team. I'm trying to POST a product from a website.
My URL is in the format:
with credentials from the Admin API with permissions to read and write products.
My request has the same body as above.
@Ruben00001 can you try to execute the same request from CURL or Postman?