Skip to content

Error with OAuth1.0 Authentication #492

Description

@DLHeinze

I'm trying to use OAuth1.0 to authenticate to an API. I am getting an error when it's preparing the http request.

The code is very simple. It builds just fine until I add the authentication part.

Any ideas?

ERROR - WebClient.Execute: -2147210493 (11011 / 80042b03), An error occurred during execute
-2147210492 (80042b04): An error occurred while preparing http request
-2146232576 (80131700): Automation error

Function Get_SingleRecord() As String
    Dim Client As New WebClient
    Client.BaseUrl = kBaseURL & "/"

    ' Setup authenticator
    Dim Auth As New OAuth1Authenticator
    Auth.Setup _
        ConsumerKey:=kconsumer_key, _
        ConsumerSecret:=kconsumer_secret, _
        Token:=koauth_token, _
        TokenSecret:=koauth_token_secret
    Set Client.Authenticator = Auth

    ' Use GetJSON helper to execute simple request and work with response
    Dim Resource As String
    Dim Response As WebResponse
    Resource = "restapi/1.0/object/contact/3"
    Set Response = Client.GetJson(Resource)
End Function

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions