Best answer

Luma Get Event Run Python Code in Zapier


Userlevel 1
Badge

I am trying to use this Lu.ma api code to create an event in Zapier using the Run Python in Code by Zapier.

 

Zapier is returning a success screen too me however my event itself isn’t appearing. Any help or insights into how I should modify the code? Sorry not a Python coder.

 

import requests

url = "https://api.lu.ma/public/v1/event/create"

return {'name': input_data ['name']}
return {'start_at': input_data ['start_at']}
return {'timezone': input_data ['timezone']}
return {'end_at': input_data ['end_at']}
return {'require_rsvp_approval': input_data ['require_rsvp_approval']}
return {'meeting_url': input_data ['meeting_url']}

payload = {
"name": 'name',
"start_at": 'start_at',
"timezone": 'timezone',
"end_at": 'end_at',
"require_rsvp_approval": 'require_rsvp_approval',
"meeting_url": 'meeting_url'
}

headers = {
"accept": "application/json",
"content-type": "application/json",
"x-luma-api-key": "REMOVED FOR SHARING"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

 

 

 

icon

Best answer by Troy Tessalone 25 May 2023, 22:39

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 1
Badge

@Troy Tessalone this totally solved my problem thank you!

Userlevel 7
Badge +14

Hi @Dan_GRHF 

Good question.

Why not try to use the Webhooks app to make the API request?

 

 

Userlevel 1
Badge

I didn’t know that existed. Let me try to see if that works. Thanks @Troy Tessalone !

 

Userlevel 1
Badge

@Troy Tessalone I have not used this one before and definetly not a developer so maybe you can help me out as the zapier documentation was confusing me.

 

This is the API code itself. https://docs.lu.ma/reference/create-event-1

Based on how the webhooks by zapier works for the data section would I be inserting my data based on the fields of this code?

 

So in the sample they have the below. I assume I could make a data field then called name and have data from my zap where it says enter text or insert data?

"name": "New Yeork Party",
  "start_at": "2023-12-31T23:59:00Z",
  "timezone": "America/New_York",
  "end_at": "2024-01-01T00:01:00Z",
  "require_rsvp_approval": false,
  "geo_address_json": {
    "type": "google",
    "place_id": "ChIJmQJIxlVYwokRLgeuocVOGVU",
    "description": "Let's meet by the hot dog stand!"

 

 

Userlevel 7
Badge +14

@Dan_GRHF 

Left side would be the name and right side would be the value.