Calendly single-use link generator

Updated and easy to use version of my previous snippet Copy of Snippet "Single use Calendly link generator"

{note: trim=yes}

---USER START: Fill personal access token here:
{personal_access_token=""}
---USER END

{booking_url=""}
{if: personal_access_token <> ""}
{urlload: https://api.calendly.com/users/me; method=GET; done=(res) -> ["response"=catch(fromJSON(res), "???")]; headers=Authorization=Bearer {=personal_access_token}}
{user_uri=response["resource"]["uri"]}

{urlload: https://api.calendly.com/event_types?user={=user_uri}; method=GET; done=(res) -> ["response2"=catch(fromJSON(res), "???")]; headers=Authorization=Bearer {=personal_access_token}}
{events=response2["collection"]}
{event_slugs=map(events, event -> event["slug"])}
{formmenu: default=Please select a slug; values={=event_slugs}; name=selected_event_slug}
{=selected_event_slug}

{if: selected_event_slug <> "Please select a slug"}
{required_event=filter(events, event -> event["slug"] == selected_event_slug)[1]}
{event_uri=required_event["uri"]}

{urlload: https://api.calendly.com/scheduling_links?owner={=event_uri}&owner_type="EventType"&max_event_count=1; method=POST; done=(res) -> ["response3"=catch(fromJSON(res), "???")]; headers=Authorization=Bearer {=personal_access_token}}
{booking_url=response3["resource"]["booking_url"]}
{else}
Please select event slug to generate the booking URL
{endif}
{else}
Please enter your personal access token in the snippet (find it at this link)
{endif}
{endnote}
{if: booking_url <> ""; trim=yes}
Congratulations, your booking URL is {=booking_url}
{endif}