convert simple curl data request to powershell invoke-webrequest

Viewed 4368

Converting a very simple Plaid API curl data request to a powershell invoke-webrequest

what works:

    curl -X POST https://tartan.plaid.com/balance \
  -d client_id=client-id-value \
  -d secret=secret-value \
  -d access_token=access-token-value

What I'm trying unsuccessfully in Powershell

#test powershell api call

$hash = @{  client_id    = "client-id-value";
            secret = "secret-value"
            access_token = "access-token-value"
            }

$JSON = $hash | convertto-json

#Invoke-WebRequest -uri "https://tartan.plaid.com/balance" -Method POST -Body $JSON

This returns a plaid error 1100 (client id missing), so I know some API functionality is working, but it's not parsing input data correctly.

My biggest misunderstanding is how to translate a "curl -data" value into the proper Powershell parameter.

Is this a header value, body value? etc.

1 Answers
Related