You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, on my development and staging servers I'm using my publishable API key from production to make US Verification requests (so that they're "real" without actually affecting the real world in any way), while I'm using my secret API key from testing to make Letter requests (so that they don't actually affect the real world).
The only ways I've found to do this are to either subclass the related Resource classes in a way that feels invasive, or to change the value of lob.api_key to its appropriate value before making the request (paying attention to thread safety since it's a global variable). I currently use the latter strategy, but both of these mechanisms feel suboptimal, and I'm curious if there's some other way to do this that I've missed, or if you'd accept PRs to make it easier to do this.
The text was updated successfully, but these errors were encountered:
First off, thanks for using Lob and for highlighting this issue for us. What you are looking to accomplish makes perfect sense as testing with address verification can use a Live key while you’d want to use a Test key for Print & Mail testing.
Apologies this issue went so long unanswered. We are currently working on a PR to add this functionality.
@toolness We got the functionality you requested in the latest version of lob-python (v4.5.2). Each method call has an optional parameter called api_key that you can pass in a different key if you want.
Hello, on my development and staging servers I'm using my publishable API key from production to make US Verification requests (so that they're "real" without actually affecting the real world in any way), while I'm using my secret API key from testing to make Letter requests (so that they don't actually affect the real world).
The only ways I've found to do this are to either subclass the related
Resource
classes in a way that feels invasive, or to change the value oflob.api_key
to its appropriate value before making the request (paying attention to thread safety since it's a global variable). I currently use the latter strategy, but both of these mechanisms feel suboptimal, and I'm curious if there's some other way to do this that I've missed, or if you'd accept PRs to make it easier to do this.The text was updated successfully, but these errors were encountered: