Skip to content

Error calling Send-TwitterDirectMessages_EventsNew: Bad Authentication Data #48

Description

@chinhdo

Any idea why I am getting this error calling Send-TwitterDirectMessages_EventsNew?

Code:

$TwitterUser = Get-TwitterUsers_Lookup -screen_name 'chinhdo'
$Event = Send-TwitterDirectMessages_EventsNew -recipient_id $TwitterUser.Id -text "Hello !!"

The Get-TwitterUsers_Lookup method works fine. But the Send-TwitterDirectMessages_EventsNew errored out with the below. I did configure the app permissions to allow Read + Write + Direct Messages.

Invoke-RestMethod : {"errors":[{"code":215,"message":"Bad Authentication data."}]}
At C:\Program Files\WindowsPowerShell\Modules\PSTwitterAPI\0.0.8\public\Invoke-TwitterAPI.ps1:34 char:5
+     Invoke-RestMethod @RestMethod_Params
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExceptio  
   n
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
WARNING: Throttling for -1626964553.70296 seconds.
Start-Sleep : Cannot validate argument on parameter 'Seconds'. The -1626964554 argument is less than the minimum allowed 
range of 0. Supply an argument that is greater than or equal to 0 and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\PSTwitterAPI\0.0.8\public\Get-TwitterOAuthSettings.ps1:33 char:38
+                 Start-Sleep -Seconds $SleepSeconds
+                                      ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Start-Sleep], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.StartSleepCommand

Thanks

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions