Genesys Cloud - Main

 View Only

Sign Up

  Thread closed by the administrator, not accepting new replies.
  • 1.  Open API - script failed - power shell integration

    Posted 12-08-2023 09:07
    No replies, thread closed.

    Hi, My developer tried to connect to API and got an error from the power shell script. He could connect from Postman, browser Chrome, and Firefox, but IE failed the same as Power Shell. Do you have any idea what is wrong?

    [1:16 PM] Alex Seymour

    $response = Invoke-RestMethod 'https://api.mypurecloud.de/api/v2/billing/reports/billableusage?startDate=2023-12-01T00:00:00Z&endDate=2023-12-02T00:00:00Z' -Method 'GET' -Headers $headers
    $response | ConvertTo-Json
    Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.
    At line:6 char:13
    + $response = Invoke-RestMethod 'https://api.mypurecloud.de/api/v2/bill ...
    +             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
        + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand


    #Integrations

    ------------------------------
    Robert Klusek
    ISS World Services A_S
    ------------------------------


  • 2.  RE: Open API - script failed - power shell integration

    Posted 12-21-2023 22:59
    No replies, thread closed.

    I think you will need to translate your date/time values to use ASCI characters for the colons and I think it needs a space and not a T so your date 2023-12-01T00:00:00Z should be 2023-12-0%2000%3A00%3A00



    ------------------------------
    Robert Wakefield-Carl
    ttec Digital
    Sr. Director - Innovation Architects
    Robert.WC@ttecdigital.com
    https://www.ttecDigital.com
    https://RobertWC.Blogspot.com
    ------------------------------