Search code examples
pythonzapier

Zapier - Input data not able to form payload


I've used Zapier quite a bit, but not real familiar with Python. I grabbed the Python Code for creating a room on Daily.co and want to name the room based on data from a form fill to create a video chat link for applicants. I can create a room with a static name, but not sure how to form the payload part of the response with data from Zapier. The Daily.co formatting is not what I have seen in other examples. I added an input_data called roomname, but can't get it into the payload string. I'm including a screen shot and would appreciate some help since I am a novice on Python. image of Zapier screen

import requests

url = "https://api.daily.co/v1/rooms"

payload = "{"name":"Room1"}"

headers = { 'content-type': "application/json", 'authorization': "Bearer ad95XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX84dd" }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)


Solution

  • I believe you simply need to remove the outer "" from the payload line. Try:

    payload = {'name': 'Room1'}