Focuses on API authentication, access scopes, and permission management.
Hi,
I have been creating mobile applications using Flutter, what I want to do right now is fetch the data from my Shopify store.
I have never worked with API's before but I know the purpose of using them. I am looking at different guides online but the information is very overwhelming.
I have managed to fetch my data using this function:
getUserData() async {
var response = await http.get(Uri.https(
'{apikey}:{password}@{hostname}.myshopify.com',
'/admin/api/{version}/{resource}.json'));
var jsonData = jsonDecode(response.body);
print(jsonData);
}
{resource} in this case is Customer, adding getUserData() to a button I now print out my customers, this took me like 8h to set up.
I wont be asking any specific questions, but since this thing with API's is new to me and I wouldnt call myself a Flutter expert aswell. Are there any good guides out there? I would like to fetch my data with storefront API, I've got the token but I have no clue how to use it in my code so I can access the data. I am reading the storefront documentation on shopify but being new to all this it just feels it's over my head to grasp.
Edit: I will be setting up querys using GraphQL (graphql_flutter 5.0.0 is imported)
Hey @SPJVR
Thanks for getting in touch. I can confirm there's actually no (official) docs that we've released regarding Flutter. Sound like you've been checking it out already but the Storefront API reference docs would be the best place to start.
There's an official Storefront API Learning kit here too which would run you through querying the endpoint (including querying customers too). Hope that helps!