link0 / bunq

API client in PHP for bunq
MIT License
8 stars 13 forks source link

Incorrect API key or IP address. Error after reregistering new device/installation #12

Closed dstollie closed 7 years ago

dstollie commented 7 years ago

I wanted to proceed with my little app but im stuck with the following error

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `POST https://sandbox.public.api.bunq.com/v1/device-server` resulted in a `400 Bad Request` response: {"Error":[{"error_description":"User credentials are incorrect. Incorrect API key or IP address.","error_description_tra (truncated...) in /vagrant/bunq-insights/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 111

Before rerunning the code, including the registerInstallationAndDeviceServer() method. I regenerated a public and private key pair. The bunq documentation says that the device and installation are ip-address bound but I'm getting the idea that once you've registered an installation/device to an api key you can no longer use this api key on a different ip-address.

Could you help me getting some more understanding of this issue

dennisdegreef commented 7 years ago

Hmm, I haven't seen this behaviour myself as far as I can remember. Have you tried asking this on the bunq Together platform? I think people from bunq may be better help on explaining these issues. Would love to add it to the documentation when these constraints are clear. Which environment are you using?

dennisdegreef commented 7 years ago

Hi @dstollie

Do you still encounter this issue? :)

holtkamp commented 7 years ago

@dstollie a mistake I made when moving from sandbox to production, is not changing the Environment from Sandbox to Production. This way the client keeps communicating with the sandbox at https://sandbox.public.api.bunq.com, which does not 'know' the production API-key, resulting in the same error message.

😩