Skip to main content

Hi folks,

 

I am trying to setup an API call in order to setup a keyboard shortcut for one off meetings usings Espanso (a text replacement piece of software)

 

:m15 will give me a one off link for a 15min meeting

:m30 will give me a one off link for a 30 min meeting

:m50 will give me a one off link for a 60 min meeting

 

The issue is that I need to define a start and end date, whereas ideally I would like to have it so that people can book into my calender from today, up to 2 months away in my diary.

 

I have copied the code block below; any help with this would be very much appreciated!

 

curl --request POST \
  --url https://api.calendly.com/one_off_event_types \
  --header 'Authorization: Bearer <myapikey>' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "15 Minute Meeting",
    "host": "https://api.calendly.com/users/<myhostlink>",
    "duration": 15,
    "timezone": "Europe/Dublin",
    "date_setting": {
      "type": "date_range",
      "start_date": "2024-10-15",
      "end_date": "2024-10-22"
    }
  }'

It sounds like you want to have your one off event type creation macro perpetually allow for scheduling between the current day and the next two months? If that’s the case you would need to update the date range daily, setting start_date to the current day and end_date to the current day + two months.

It looks like Espanso supports the concept of an offset regarding dates: https://espanso.org/docs/matches/extensions/#future-and-past-dates

So you would replace your “start_date” field with whatever you are replacing with “today” and replace “end_date” field with the 2 month offset from “today” with whatever you call your trigger.

I believe it would look something like this but might take some trial and error

curl --request POST \
--url https://api.calendly.com/one_off_event_types \
--header 'Authorization: Bearer <myapikey>' \
--header 'Content-Type: application/json' \
--data '{
"name": "15 Minute Meeting",
"host": "https://api.calendly.com/users/<myhostlink>",
"duration": 15,
"timezone": "Europe/Dublin",
"date_setting": {
"type": "date_range",
"start_date": ":today",
"end_date": ":two_months"
}
}'

 


Reply