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
(PowerBuilder) 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
integer li_rc oleobject loo_Oauth1 integer li_Success oleobject loo_Rest oleobject loo_SbResponse oleobject loo_Json // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Oauth1 = create oleobject // Use "Chilkat_9_5_0.OAuth1" for versions of Chilkat < 10.0.0 li_rc = loo_Oauth1.ConnectToNewObject("Chilkat.OAuth1") if li_rc < 0 then destroy loo_Oauth1 MessageBox("Error","Connecting to COM object failed") return end if loo_Oauth1.ConsumerKey = "Your Consumer Key" loo_Oauth1.ConsumerSecret = "Your Consumer Secret" loo_Oauth1.Token = "Your OAuth1 Token" loo_Oauth1.TokenSecret = "Your Token Secret" loo_Oauth1.SignatureMethod = "HMAC-SHA1" loo_Rest = create oleobject // Use "Chilkat_9_5_0.Rest" for versions of Chilkat < 10.0.0 li_rc = loo_Rest.ConnectToNewObject("Chilkat.Rest") loo_Rest.SetAuthOAuth1(loo_Oauth1,0) li_Success = loo_Rest.Connect("api.bricklink.com",443,1,1) if li_Success = 0 then Write-Debug loo_Rest.LastErrorText destroy loo_Oauth1 destroy loo_Rest return end if loo_SbResponse = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_SbResponse.ConnectToNewObject("Chilkat.StringBuilder") li_Success = loo_Rest.FullRequestNoBodySb("GET","/api/store/v1/orders?direction=in",loo_SbResponse) if li_Success = 0 then Write-Debug loo_Rest.LastErrorText destroy loo_Oauth1 destroy loo_Rest destroy loo_SbResponse return end if Write-Debug "Response status code = " + string(loo_Rest.ResponseStatusCode) loo_Json = create oleobject // Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject") loo_Json.LoadSb(loo_SbResponse) loo_Json.EmitCompact = 0 Write-Debug loo_Json.Emit() destroy loo_Oauth1 destroy loo_Rest destroy loo_SbResponse destroy loo_Json |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.