Jump to content

Search the Community

Showing results for tags 'ohttp'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi all, I'm not smart enough to clearly understand how to "translate this code into AutoIt call, so I used what I did in the past but it doesn't work properly. Basically I need to receive the Auth Token in order to place further calls. API docs on Paypal site says: curl -v -X POST "https://api-m.sandbox.paypal.com/v1/oauth2/token" \ -u "<CLIENT_ID>:<CLIENT_SECRET>" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "grant_type=client_credentials" or api-m.paypal.com if using live server. And this is my code (i just canceled the keys received from PP) #include <Array.au3> #include <string.au3> #include <MsgBoxConstants.au3> #Region Paypal Const Global $sURL = "https://api-m.paypal.com" ; /v1/oauth2/token - https://api-m.sandbox.paypal.com #EndRegion Paypal Const #Region keys Global $ClientID = "****" Global $SecretID = "****" #EndRegion keys _Test() Func _Test() Local $sResult = PayPalGet("/v1/oauth2/token") ConsoleWrite("$sResult: " & $sResult & @CRLF) EndFunc ;==>_Test Func PayPalGet($sMethod) Local $sJsonReq = '-u "' & $ClientID & ':' & $SecretID & '"' & _ '\ -H "Content-Type: application/x-www-form-urlencoded" \' & _ '-d "grant_type=client_credentials"' Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", $sURL & $sMethod, False) $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") $oHTTP.Send(Binary($sJsonReq)) Local $sReceived = $oHTTP.ResponseText Return $sReceived Return $sReceived EndFunc ;==>PayPalGet When I run it I get: $sResult: {"error":"invalid_client","error_description":"Client Authentication failed"} Can you please help me to sort it out? Thanks in advance Marco
×
×
  • Create New...