Cannot get multiple mockup servers to work

Hi,
I am new to postman and want to use it to mock APIs to test my application. I have created three mock servers matched to three different example responses. However, all three mock servers return the same response.

In the logs of the mockup I can see that each request is processed by the correct mock server.

Here is two of my responses. The only difference is the server name, the path and query parameters are the same.

My one parameter is a very long jq filter containing spaces. Could that be an issue?

Here is the full jq parameter:


{result:{loadpoints:[.loadpoints[]|{chargePower,chargerFeatureHeating,charging,connected,vehicleName,vehicleSoc,title,phasesActive,mode,chargeRemainingDuration}],pvPower,gridPower,grid:{power:.grid.power},homePower,siteTitle,batterySoc,batteryPower,vehicles:.vehicles|map_values({title}),forecast:(if .forecast.solar then {solar:.forecast.solar|{scale,today:{energy:.today.energy},tomorrow:{energy:.tomorrow.energy},dayAfterTomorrow:{energy:.dayAfterTomorrow.energy}}} else {} end)}}

Any advice is appreciated!

1 Like

I have now created three different requests with one example response each.

Now the first mockup server returns the result of the third, while the second and third return the result of the first. I am lost …

I was already able to fix it. I had to put each request in a separate collection, and link the three mockup servers to three collections. It seems the server name is not enough to distinguish the different saved requests within one collection.

1 Like

Hey @the-ninth :waving_hand:

Glad to see you solved your issue here. :trophy:

I would also highly recommend not hardcoding sensitive data into you request.

Please make full use of variables or move the information to your own locally encrypted Postman Vault. :folded_hands:

1 Like

Thanks for the advice, I’ll make sure that we won’t have any sensitive data in the request!

1 Like