(AutoIt) BrickLink OAuth1 using Chilkat HTTP
Demonstrates sending an api.bricklink.com request with OAuth1 authentication using Chilkat HTTP.
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
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
$oHttp.OAuth1 = True
$oHttp.OAuthConsumerKey = "Your Consumer Key"
$oHttp.OAuthConsumerSecret = "Your Consumer Secret"
$oHttp.OAuthToken = "Your OAuth1 Token"
$oHttp.OAuthTokenSecret = "Your Token Secret"
$oHttp.OAuthSigMethod = "HMAC-SHA1"
Local $oResp = $oHttp.QuickGetObj("https://api.bricklink.com/api/store/v1/orders?direction=in")
If ($oHttp.LastMethodSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite("Response status code = " & $oResp.StatusCode & @CRLF)
$oJson = ObjCreate("Chilkat.JsonObject")
$oResp.GetBodyJson($oJson)
$oJson.EmitCompact = False
ConsoleWrite($oJson.Emit() & @CRLF)
|