PSTwitterAPI icon indicating copy to clipboard operation
PSTwitterAPI copied to clipboard

Send-TwitterBlocks_Create code 215 Bad Authentication data

Open jonnydevx opened this issue 5 years ago • 6 comments

Send-TwitterBlocks_Create -screen_name $screenname

Some other commands works fine so I know the oauth is working.

I get this error BadRequest {"errors":[{"code":215,"message":"Bad Authentication data."}]}

at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest request) at Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()

jonnydevx avatar Nov 14 '20 18:11 jonnydevx

Unfortunately, not all the functions have been fully tested. I used a script to scrape the API information/parameters for each endpoint on the Twitter API documentation. 😆 'most' work. Will need some community help to tweak and get them all working.

mkellerman avatar Nov 14 '20 18:11 mkellerman

Sure no problem, you are right the examples you have they do work.

Great work by the way. The powershell scripting is pretty impressive. I am trying to see if I could figure it out then I will share it if I got a solution. After a initial look, it looks fine so it is weird even looking at the the twitter documentation.
The only think i could think of it could be the header, maybe it is missing some is a guess. $RestMethod_Params['Headers'] pointing to the Authorization in the Invoke-TwitterAPI is this all that is needed for all the working apis ?

jonnydevx avatar Nov 14 '20 19:11 jonnydevx

Where you able to find the issue?

mkellerman avatar Nov 24 '20 20:11 mkellerman

unfortunately not, so far after looking around, a few other people said the block service uses a different authentication method. 3 leg authentication or something like that compared to the 2 leg auth where the other services work fine.

jonnydevx avatar Nov 25 '20 01:11 jonnydevx

I don't use this endpoint. Should we remove it from the available functions? Or move it to its own branch to be fixed, but remove it from master?

mkellerman avatar Nov 25 '20 02:11 mkellerman

Maybe move it to a branch for now. I think it is something to do with the authentication header that needs fixing for these types of services such as the block.

jonnydevx avatar Nov 25 '20 02:11 jonnydevx