POSTMAN Runner test function to extract interfaceid

NeilPN
Here to help

POSTMAN Runner test function to extract interfaceid

Hi

 

I'm facing a challenge with POSTMAN runner and the Meraki API, I have a number of collections set up which work really well but I'm looking to do a bit more. I have a collection setup for 'Update Device Switch Routing Interface DHCP' which is '{{baseUrl}}/devices/{{serial}}/switch/routing/interfaces/{{interfaceId}}/dhcp' this works great with a .csv file but I still have to go and get the 'interfaceid' before I can start and add it into there.

 

What I would like to do would be to run '{{baseUrl}}/devices/{{interfaceId}}/switch/routing/interfaces' first and use the test function in runner to then extract the interface ID and insert it as an environment variable. The vlan id would be in the .csv file so this could be referenced in the script but my JavaScript knowledge is not up to the task. 

 

If any one has done something similar and used something like a vlan id to extract an interface id using the test function please let me know.

 

Thank you

 

Neil

0 REPLIES 0
Get notified when there are additional replies to this discussion.