'Need help using Postman to bulk upload a bunch of patch calls with different endpoints

I've been trying to do this using postman and python and not having any success. What I need to do is call a patch api to update about 600 different values in my database. The issue that I'm having is that the endpoint changes depending on the item I'm updating and I need to update two values in the body of my request with each unique endpoint. I have all of this data in a CSV file with the endpoint in one column, and the two values that need to be updated in the other columns.

I'm also using a json object in the body to patch in the changes (I can't figure out how to do this with parameters (also keeping me from using python to do this)). Postman body json object Python Script Example. When I use python for this, I get back a 415 error so I think there's an issue with the headers?

How do I iterate through the CSV to change the endpoint based on column 1 and update the old/new values with columns 2,3 in the body of the request?

CSV Example



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source