Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

API - Keyblocker

Hello,

 

I am trying to run a powershell script to call the API for our ticket system, and then post hit to PowerBI with a foreach loop for every ticket, total is about 17k tickets. 

 

This is the message I am recieving when trying to my script. 

Invoke-RestMethod : {"error":{"message":"The request was blocked by KeyBlocker "}}
At line:9 char:1
+ Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Has anyone seen this, and is there a workaround?

6 Replies

  • Hi Anonymous ,

     

    Are you invoking this behind any corporate firewall ?

     

    Also make sure that you have run this using TLS 1.2 in your script

     

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    • Anonymous's avatar
      Anonymous
      Not applicable

      Sorry for the late reply, I solved this by putting every ticket into one foreach loop. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Can you please share with us a little bit more details on the workaround you've used?