Access Shopify API from an External App - shopify

I am trying to access the Shopify API from an external app that I am building (mobile). For example, I would like to access this API:
https://mystore.myshopify.com/admin/products.json
Of course I would need to authenticate my request first. So far everybody I asked (including Shopify support), suggested that the only way to access the data is through a Shopify App.
Can you suggest a way to do this?

I have found the answer. Follow these steps if you want to access the Shopify API from an external app:
Login to your store as an admin
Go to Apps
Create a Private App
Use the following pattern with every URL you create (I am using this to get all the orders)
https://:#.myshopify.com/admin/orders.json
The API Key and the password appear in your private app info page.

Related

Shopify Public App - How To Get Key, Token & Url

I am totally new to Shopify Public App development and I will need your help to understand it a bit better.
For a client, I need to build a Shopify Public App that will be used by several Merchants.
This application will have to access the Merchants' store via the Admin API.
If my understanding is correct, in order to access one specific Merchant's store via the Admin API, I need to have 3 pieces of information from that Merchant's store: the Public API Key, Token and URL.
Now, my question:
When the Shopify Public App is installed by a Merchant, how does my app get these 3 pieces of information (specific to that particular merchant) ?
Is there any "magic" trick? Does the Merchant need to input this info? ...
In advance, many thanks for your help
Each merchant will need to install your app. In the installation phase shopify will pass, as an argument, the access token, that is a token that you will need, to use the Admin API.
If we're talking about an embedded app is expected that every request made is authenticated.
Depending on which kind of app you want to create (embedded or not) and language you may want to use, using the Shopify Cli to create the first draft of the app is really reccommended. It will create the base to have an installable app. Here is the documentation https://shopify.dev/apps/getting-started/create
You need to install the Shopify Cli and then run
shopify app create (node | ruby | php)
depending on your language of choice.
For those who might be interested, I finally found the link to the information.
Shopify - Getting started with OAuth

External Login in react native with JWT authentication token asp.net core

As I am new to mobile development and I am using react native. I am trying to implement external login(Facebook/Google) login, I got libraries using which I am able to get the details of user profile such as firstName, lastName, email from both Facebook and Google. Here my question is, is it right and safe to get details of the user profile, and calling register api to register/login and get the JWT token to land the application to home screen? Or is there any way that we can just click on Facebook/Google button by passing just provider name we can get all details from web api itself.
I feel, fetching the user profile details from web api is safer than getting user profile using react native library/sdk and then calling register api to register/login the same.
If there any link or Github reference please share the same for better and in details understanding.
Thanks In Advance.
You seems to have it figured out yourself. Call Google or other third party to retrieve user details such as email and name. Then call your own backend to register that user to your platform.
The next time user login using social login do a similar call to your backend to check if user with the details exist in your database and send a corresponding response back.
Check this link Google Login React Native. This reference is a little old one but might give you a heads up.
Note: You will need to have corresponding permissions enabled in providers developer console. Some cases you will get an access token after login/signup using social media. You will then need to fetch user data from corresponding provider using their api or SDK.

How to get Shopify API programmatically

I'm building a React Native app with Shopify integration issues.
After creating a private app in the Shopify admin panel, I need help getting the Shopify API programmatically.
You will need the Shopify API URL (enter image description hereExample URL in the screenshot) to receive your shopify product.
To create an API URL, shopify users need to add an API key and API password and hostname manually on the React Native app.
I have done this feature, but it is very inconvenient for users.
That's why I need to get the API URL programmatically after the user logs into Shopify with email and password in WebView.
I thought I could get the API URL by web scraping after the user login Shopify.
Is it possible? Please help if possible.
Regards.
It is as simple as using your shop name in the URL, such as shopname.myshopify.com. But the best thing you can do is click the copy button on the Example URL field and use the full example URL so you know there are no errors.
Unfortunately, Shopify obscures this field because the apikey and password are so long. When you look at the field, it isn't clear they provided you with a complete and working URL.
Good luck

Bigcommerce Authentication with Email Passwod

We just launched a new Bigcommerce website API and I have a requirement to create an app for the same website. I wanted to begin with the authentication but I can't seem to find an API for logging in with username and password.
Is there a way I can call an API and pass username/email and a password and receive something like a token? If no, what is the best practice to make an app for Bigcommerce websites.
There are a few ways to get authentication.
Building a script that will not be used in the Control Panel or running a quick query in Postman.
You will need to get an API Key and Token from the Control Panel. This can only be created by the store owner: https://support.bigcommerce.com/articles/Public/Store-API-Accounts/
Creating an app for a single store or several stores: You will need a client id and a client secret. https://developer.bigcommerce.com/api/#app-registration
There is also the Customer Login API https://developer.bigcommerce.com/api/v3/storefront.html#storefront-api-apps. This is allows for single sign on so customers can programmatically be logged into their account on the BigCommerce Storefront.

Can't find password for Shopify App

I'm trying to access Shopify Admin APIs through postman.
Tutorial says that
For Username and Password provide your store private API key and password respectively.
I do have the API key, however there is no password filed on my admin page? I tried finding some solutions online, however the screenshots mentioned in those solutions did contain a password filed on the admin page. My page does not have it. I only have API key & API secret key
There are two types of App in shopify, one is embeddedSDK and second one is private App. For the embeddedSDK you can you Postman, but for the private Its will not access through postman.
Thanks
There could be one of following reasons of not having password.
- You are logged in with diff. user or Not having admin access to app.
Your Store Password & Username may work in place.
- Make sure your app is in published state.
share more details in case still hanged with these buggy things.
From Using Postman - Shopify tutorial:
Once you have a Shopify store, you can quickly generate your API credentials using a private app.
You need to create a private app from your development or managed store - not in your partner account.
Click the link at the bottom of the apps page:
Working with a developer on your shop? Manage private apps
From there you can create a new private app to get your API key and password.