Problems connecting to testnet

I have coded to the production api, and my code is working as intended. I’ve repointed it at testnet, changing the endpoints as appropriate, but I run into problems.

Specifically, my request for a listenKey elicits the response “{“code”:-2015,“msg”:“Invalid API-key, IP, or permissions for action”}”. From there, my attempt to listen elicits the response “generic:13 Error message: Permission denied”. The latter is not surprising, given that the listen key I end up using is the null string (because of the failure mentioned previously).

Is the protocol for listening to a user_data webstream different on testnet than it is in production? Do I need a security key pair different from what I’m using in production?

As Production is using a different network than testnet, you need to create a new key pair for testnet. Have a look at this website if you want to generate a new testnet key pair:

Understood. Thank you.