NAV 2009 R2 Classic Client and Shopify API + JSON

Larsen
Member Posts: 3
Hello
I need to integrated with our new Shopify shop, so NAV 2009, can get orders, update orders, products etc by some sort of automation.
Ive created a shop i Shopify, greated a private App, got the API key and the password, and when i enter the url: https://apikey:password@theshop.myshopify.com/admin/api/2020-10/orders.json
Then i get alle the orders back. So it's accesable.
I have previously worked with SOAP integrated shops, but never with REST and Json.
I've tried https://dynamics.is/?p=2303 but our NAV 2009 R2 can't use the NewtonSoft.Json assembly.
Then i tried:
I cheked the APIkey and password several times and they are correct, but i keep getting this as the only response in the Txt variable.
{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}
So i'm stuck..
Any help will be highly appreciated.
I need to integrated with our new Shopify shop, so NAV 2009, can get orders, update orders, products etc by some sort of automation.
Ive created a shop i Shopify, greated a private App, got the API key and the password, and when i enter the url: https://apikey:password@theshop.myshopify.com/admin/api/2020-10/orders.json
Then i get alle the orders back. So it's accesable.
I have previously worked with SOAP integrated shops, but never with REST and Json.
I've tried https://dynamics.is/?p=2303 but our NAV 2009 R2 can't use the NewtonSoft.Json assembly.
Then i tried:
OBJECT Codeunit 50053 Json Functions { OBJECT-PROPERTIES { Date=16-12-20; Time=12:21:11; Modified=Yes; Version List=; } PROPERTIES { OnRun=VAR theurl@1161021000 : Text[1024]; BEGIN theurl := 'https://'+ apikey + ':' + pwd + '@beeria.myshopify.com/admin/api/2020-10/orders.json'; CallRESTWebServic(theurl); END; } CODE { VAR apikey@1161021000 : TextConst 'ENU='; // Not empty in the code, pwd@1161021001 : TextConst 'ENU='; // deleted here on purpose PROCEDURE CallRESTWebServic@1161021004(url@1161021001 : Text[1024]); VAR WinHttp@1161021000 : Automation "{662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1:{2087C2F4-2CEF-4953-A8AB-66779B670495}:'Microsoft WinHTTP Services, version 5.1'.WinHttpRequest"; JsonTxt@1161021002 : Text[1024]; ResponseStream@1161021003 : InStream; ResponseBuffer@1161021004 : BigText; Comment@1161021005 : Record 97; BEGIN CREATE(WinHttp); WinHttp.Open('GET',url,FALSE); WinHttp.SetRequestHeader('Content-Type', 'application/json'); WinHttp.Send(''); ResponseStream := WinHttp.ResponseStream; ResponseBuffer.READ(ResponseStream); IF ResponseBuffer.GETSUBTEXT(JsonTxt, 1, 1024) >0 THEN; MESSAGE(JsonTxt); END; BEGIN END. } }
I cheked the APIkey and password several times and they are correct, but i keep getting this as the only response in the Txt variable.
{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}
So i'm stuck..
Any help will be highly appreciated.
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions