Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you create an article #873

Closed
7ynk3r opened this issue May 12, 2024 · 3 comments
Closed

How do you create an article #873

7ynk3r opened this issue May 12, 2024 · 3 comments

Comments

@7ynk3r
Copy link

7ynk3r commented May 12, 2024

I'm trying to create an article using APIs (any will do) in NodeJS. Can you indicate how to achieve this? The docs don't help much and chatgpt, perplexity nor gemini can help. I'd really appreciate an E2E example. I already have API keys for storefront & admin with all the scopes.

For context,

I tried using cURL

curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-01/articles/authors.json" \
-H "X-Shopify-Access-Token: {access_token}"

without success with all token

{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}%                                                                                                  

I tried gql

curl -X POST \
  https://{shop}.myshopify.com/admin/api/2024-04/graphql.json \
  -H 'Content-Type: application/json' \
  -H 'X-Shopify-Access-Token: {access_token}' \
  -d '{
    "query": "query {
      products(first: 5) {
        edges {
          node {
            id
            handle
          }
        }
        pageInfo {
          hasNextPage
        }
      }
    }"
  }'

and got

Bad request
@7ynk3r
Copy link
Author

7ynk3r commented May 13, 2024

If someone else ends up here and there's no answer to my original post, the following works

https://github.com/MONEI/Shopify-api-node

@lizkenyon
Copy link
Contributor

Hi there 👋

In the future questions about how to make API calls in general are best suited for the Shopify Community forums.

For this specific example can you confirm that you are replacing https://your-development-store.myshopify.com with the URL of your store and {access_token} with the access token of your app?

If you want to explore the Shopify Admin and Storefront APIs you may also want to checkout the Graphiql explorer.

Copy link
Contributor

We are closing this issue because we did not hear back regarding additional details we needed to resolve this issue. If the issue persists and you are able to provide the missing clarification we need, feel free to respond and reopen this issue.

We appreciate your understanding as we try to manage our number of open issues.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants