Greetings!
I recently got into this new management API and managed to authenticate just fine and got my authorization token even.
Then when I tried to for example get list of all of our companies I received an error response which had "Invalid_api_key"
Powershell example below:
Invoke-RestMethod -Method GET -Uri "https://eu1.psb.fsapi.com/mp/v1/partners/370/companies" -Headers $headers -ContentType "application/json"
$headers is a dictionary:
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
X-API-Key with correct key obtained from portal
Authorization with bearer + token from authentication response.
$headers.Add("Authorization","Bearer <insert token here>")
$headers.Add("X-API-Key","<insert apikey here>")
and the query returned:
Invoke-RestMethod : {"errors":[{"error":"invalid_api_key"}]}
I tried basically the same code with c# and got 400 bad request.
Something I'm doing wrong here or?
EDIT: I was using a account that had full read permissions but for some reason thats not enough.
I used my personal account in query and it worked fine.
----
Olli Elolähde
Receptum Oy