Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(DataFlex) MYOB: Get List of Company FilesGets a list of company files. For more information, see https://developer.myob.com/api/accountright/v2/company-files/
Use ChilkatAx-win32.pkg Procedure Test Handle hoHttp String sStrResp Handle hoJsonResponse Boolean iSuccess String sId String sName String sLibraryPath String sProductVersion Integer iProductLevelCode String sProductLevelName String sCheckedOutDate String sCheckedOutBy String sUri String sCountry String sTemp1 Integer iTemp1 Boolean bTemp1 // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. Get Create (RefClass(cComChilkatHttp)) To hoHttp If (Not(IsComObjectCreated(hoHttp))) Begin Send CreateComObject of hoHttp End Set ComAuthToken Of hoHttp To "ACCESS_TOKEN" Set ComAccept Of hoHttp To "application/json" Send ComSetRequestHeader To hoHttp "x-myobapi-key" "MYOB_API_KEY" Send ComSetRequestHeader To hoHttp "x-myobapi-version" "v2" Get ComQuickGetStr Of hoHttp "https://ar1.api.myob.com/accountright" To sStrResp Get ComLastMethodSuccess Of hoHttp To bTemp1 If (bTemp1 <> True) Begin Get ComLastErrorText Of hoHttp To sTemp1 Showln sTemp1 Procedure_Return End Get ComLastStatus Of hoHttp To iTemp1 Showln "Response Status Code: " iTemp1 Get Create (RefClass(cComChilkatJsonObject)) To hoJsonResponse If (Not(IsComObjectCreated(hoJsonResponse))) Begin Send CreateComObject of hoJsonResponse End Get ComLoad Of hoJsonResponse sStrResp To iSuccess Set ComEmitCompact Of hoJsonResponse To False Get ComEmit Of hoJsonResponse To sTemp1 Showln sTemp1 Get ComLastStatus Of hoHttp To iTemp1 If (iTemp1 <> 200) Begin Showln "Failed." Procedure_Return End // Sample output... // (See the parsing code below..) // // Use the this online tool to generate parsing code from sample JSON: // Generate Parsing Code from JSON // { // "Id": "d2014f64-ffdf-487b-8d12-67a20976aca6", // "Name": "Internal Sandbox API", // "LibraryPath": "Internal Sandbox API", // "ProductVersion": "2013.0", // "ProductLevel": { // "Code": 20, // "Name": "Standard" // }, // "CheckedOutDate": "2013-06-11T01:47:47.0065514", // "CheckedOutBy": "developers@myob.com", // "Uri": "{cf_uri}", // "Country": "AU" // } // Get ComStringOf Of hoJsonResponse "Id" To sId Get ComStringOf Of hoJsonResponse "Name" To sName Get ComStringOf Of hoJsonResponse "LibraryPath" To sLibraryPath Get ComStringOf Of hoJsonResponse "ProductVersion" To sProductVersion Get ComIntOf Of hoJsonResponse "ProductLevel.Code" To iProductLevelCode Get ComStringOf Of hoJsonResponse "ProductLevel.Name" To sProductLevelName Get ComStringOf Of hoJsonResponse "CheckedOutDate" To sCheckedOutDate Get ComStringOf Of hoJsonResponse "CheckedOutBy" To sCheckedOutBy Get ComStringOf Of hoJsonResponse "Uri" To sUri Get ComStringOf Of hoJsonResponse "Country" To sCountry End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.