I’m trying to input some data into our Cisco Meraki using Postman Runner with a CSV file. Using Put {{baseUrl}}/networks/{{networkId}}/groupPolicies/{{groupPolicyId}}
I have the BaseUrl, and network ID put into the environment. For group policy, I have a column in my CSV for that.
When I run the put from post man runner, I get a 200 ok response, but no data is being put into where it’s supposed to go. Also Below the actions, it says This request does not have any tests.
I was able to send a successful PUT request using a different API called Airtable. Maybe sharing what I did will help us troubleshoot this issue.
Here I go:
First, I made sure I was hitting the correct environment with the right variables and Bearer Token: https://api.airtable.com/v0/{{baseId}}/Types/{{recordId}}
It sounds like you’re passing in what you need to call updateNetworkGroupPolicy, so I think you’re good here.
Then, I set my Headers to have the correct Content-Type for the Body I’m sending: Content-Type: application/json
What are you passing in for Content-Type?
Finally, I needed to make sure I was providing the properties required in the JSON Body: {"fields": {"Botanical Name": "TESTING 100"}}
From the updateNetworkGroupPolicy docs, it looks like the properties you need to pass in are name and scheduling. Does your CSV file reflect that?
The content type is correct. As for the headers, I have the following…
comment policy protocol srcPort SrcCidr destPort destCidr SyslogEnabled
These are the settings within that page that I’m trying to change.
When I did a get of an existing policy with firewall rules, I got those same headers. This SHOULD work… I think… haha I REALLY don’t want to have to input almost 300 rules manually.
Have you been able to successfully run a single PUT request? If not, I would try just to make sure the request even works. Also, can you please share the Response Body you’re getting?
Here’s what I did to successfully run 5 iterations of a PUT request via Postman Runner:
Btw, in Headers I only have Content-Type set to application/json. And in Tests I’m only checking whether or not the response status I get is 200:
pm.test("Status code is 200", function () {
pm.response.to.have.status(200);
});
If you look at the Test Results in the screenshot above, you’ll see that this test passed.
Step 2. Cool. Now that I know my PUT request works, I’m going to turn the values of name & job into variables. This way, Postman Runner will be able to map every row of name and job from my .csv file to these variables.
I was able to get everything imported, but I had to convert the CSV to JSON format and not use runner. Which is a little unfortunate, but it is what it is.