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) BrickLink OAuth1 using Chilkat RESTSee more BrickLink ExamplesDemonstrates sending an api.bricklink.com request with OAuth1 authentication using Chilkat REST. Note: This example requires Chilkat v9.5.0.91 or greater (due to adjustments made within Chilkat to support bricklink OAuth1 needs). For more information, see https://www.bricklink.com/v3/api.page?page=auth
Use ChilkatAx-win32.pkg Procedure Test Variant vOauth1 Handle hoOauth1 Boolean iSuccess Handle hoRest Variant vSbResponse Handle hoSbResponse Handle hoJson String sTemp1 Integer iTemp1 // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. Get Create (RefClass(cComChilkatOAuth1)) To hoOauth1 If (Not(IsComObjectCreated(hoOauth1))) Begin Send CreateComObject of hoOauth1 End Set ComConsumerKey Of hoOauth1 To "Your Consumer Key" Set ComConsumerSecret Of hoOauth1 To "Your Consumer Secret" Set ComToken Of hoOauth1 To "Your OAuth1 Token" Set ComTokenSecret Of hoOauth1 To "Your Token Secret" Set ComSignatureMethod Of hoOauth1 To "HMAC-SHA1" Get Create (RefClass(cComChilkatRest)) To hoRest If (Not(IsComObjectCreated(hoRest))) Begin Send CreateComObject of hoRest End Get pvComObject of hoOauth1 to vOauth1 Get ComSetAuthOAuth1 Of hoRest vOauth1 False To iSuccess Get ComConnect Of hoRest "api.bricklink.com" 443 True True To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoRest To sTemp1 Showln sTemp1 Procedure_Return End Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponse If (Not(IsComObjectCreated(hoSbResponse))) Begin Send CreateComObject of hoSbResponse End Get pvComObject of hoSbResponse to vSbResponse Get ComFullRequestNoBodySb Of hoRest "GET" "/api/store/v1/orders?direction=in" vSbResponse To iSuccess If (iSuccess = False) Begin Get ComLastErrorText Of hoRest To sTemp1 Showln sTemp1 Procedure_Return End Get ComResponseStatusCode Of hoRest To iTemp1 Showln "Response status code = " iTemp1 Get Create (RefClass(cComChilkatJsonObject)) To hoJson If (Not(IsComObjectCreated(hoJson))) Begin Send CreateComObject of hoJson End Get pvComObject of hoSbResponse to vSbResponse Get ComLoadSb Of hoJson vSbResponse To iSuccess Set ComEmitCompact Of hoJson To False Get ComEmit Of hoJson To sTemp1 Showln sTemp1 End_Procedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.