How to use a different URI parameter in API Connector for Dev and Prod

I am using the API connector and I have two different REST endpoints for dev and production. The URI is something like service/dev/licensing and service/v1/licensing. I know that there is a setting called Development key value which I use to specify a different key for dev and prod but I can’t find a way to have the path switch automatically between dev and prod (v1). As you can see in the screenshot below, I have different keys for dev and prod. I actually have two issues.

  1. First one is that I have created a “Share Parameter for all calls” and called it apiVersion and set the value to dev. However, when I add the parameter to the path in the “Get all licenses” API call, its creates a new “URL Parameters” for the call.

  2. When I want to “deploy to live” I have to run through all the API Calls and change the apiVersion value to v1 and swap the keys. Test it on production and then deploy and revert it back to dev to continue working.

I am sure there must be an easier way

Be super careful sharing screenshots of your API setup. You are exposing many characters of your API keys (luckily they are cutoff in the input) in this screenshot.

As for your question, you don’t need the shared parameter. You just need a URL param similar to what you’ve done in Get all licenses. That parameter can be dynamically changed to the URL path needed based on the version. When you implement the API in your app, you can dynamically change the value. You can use “isn’t live version” and then “:formatted as text” to generate different values for if it’s the live version or test version.

Let me know if this makes sense!

1 Like

Thanks, you are correct, I forgot to blank out the values. I have reset those values since I am still in the process of developing both the service and the website.

When you say “When you implement the API in your app” are you referring to the API Connector definition or somewhere else?

Nevermind, I figured it out!! Thanks so much for your help.

This topic was automatically closed after 70 days. New replies are no longer allowed.