To update a PWYW schedule you will be
- Getting a list of instances using the event template ID, and converting that to a CSV
- Updating the CSV to insert the new times for the PWYW schedule
- Creating a new postman call, and using it to
- Update the instances with the new data
A new base PUT call must be made for each client and event template, since that is unique to each event and most of the data is unchanging from instance to instance. Please work with Kadee or Jesse to confirm that the PUT call in step 3 is formatted correctly before completing this process.Step 1: Getting a list of instances using the event template ID, and converting that to a CSV
- Get template ID from Backoffice and confirm the farthest date out that needs to be modified
- Start a session in Postman
- Open "Get Event instances for template ID"
- Update parameters to include event range start date in startTime, end range end date in endTime, and template ID
- Run
- Save as a JSON
- Using https://www.convertcsv.com/json-to-csv.htm
- Choose file
- Select UTF-8 as the encoding
- Skip step 2
- Click convert to CSV
- Download result
Step 2: Updating the CSV to insert the new times for the PWYW schedule
- Open the file in excel
- Find column heading "flexPays/0/startTime"
- Copy the column into a new sheet tab
- Using find and replace, change the time (T##:##:##-##:##) to the new start time in UTC
- eg: T11:00:00-04:00 changes to T00:00:00-04:00
- Paste it back over the original column
- Find column heading "flexPays/0/endTime"
- Use the same process to change to the new end time
- Paste it back over the original column
- Save the changes, keeping the file as a CSV
Step 3: Make New postman call
- open Event Script collection and open the edit event instance script template call
- Open get eventinstance call
- get an instance ID from backoffice, run the event instance get call for that ID
- copy the response, paste the response into the body of the template
- Alter the body to change certain fields to be a dynamic variable. Always change the following
- the first line to: "id": "{{id}}
- Start date
- end date
- flex pay start and end
- any other values you edited in the prior step
- save changes.
Step 4: Update the instances with the new data
- Confirm your env and session are both pointing to Prod (or the correct env)
- Next to the "Event Scripts" Collection, click the menu and select run collection
- unselect the template, and leave the new call you made selected
- Upload your file; the number of iterations will update automatically
- open advanced setting, select save responses
- Click run
- Confirm that you get 200 OK responses, spot check any 400 Bad Request lines as needed