Invalid API Key response (Solved)

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

 

Comments

  • Ben
    Ben Posts: 2,641 F-Secure Product Expert

    Hello Olli, 

     

    Thank you for the update and glad that it is now sorted out.

  • Alright! Seems fair. We actually changed the user to full rights as it feels more proper than using my own account.
    Good that it's being fixed!
This discussion has been closed.