home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.87k stars 7.24k forks source link

Examples on how to call calendar.create_event with the RESTapi #28744

Open vague666 opened 1 year ago

vague666 commented 1 year ago

Feedback

It's unclear how the data should be formatted for a valid request when POSTing to /api/services/calendar/create_event (or if that is even supported yet)

URL

https://www.home-assistant.io/integrations/calendar/

Version

2023.08.1

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @home-assistant/core, mind taking a look at this feedback as it has been labeled with an integration (calendar) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `calendar` can trigger bot actions by commenting: - `@home-assistant close` Closes the feedback. - `@home-assistant rename Awesome new title` Renames the feedback. - `@home-assistant reopen` Reopen the feedback. - `@home-assistant unassign calendar` Removes the current integration label and assignees on the feedback, add the integration domain after the command.
github-actions[bot] commented 11 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved. If this issue is still relevant, please let us know by leaving a comment 👍 This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

vague666 commented 11 months ago

Keep open

On Mon, Oct 30, 2023, 00:03 github-actions[bot] @.***> wrote:

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved. If this issue is still relevant, please let us know by leaving a comment 👍 This issue has now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/home-assistant.io/issues/28744#issuecomment-1784257161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5IMLTMN27B7SRQXUMWLWDYB3OC5AVCNFSM6AAAAAA4FFW73OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBUGI2TOMJWGE . You are receiving this because you authored the thread.Message ID: @.***>

HenryTheSwede commented 9 months ago

@vague666 The body of the POST request needs to look like this for the create_event REST API call to work

{
    "entity_id": "calendar.garbage_collector",
    "summary": "My Test Entry",
    "start_date": "2024-01-01",
    "end_date": "2024-01-02"
}
vague666 commented 9 months ago

Thanks @HenryTheSwede :) that's a step in the right direction. I managed to add an event with that. My next issue is that I'd like to add a yearly recurring event, and looking at what data was returned from a GET request, I figured {"end_date":"2024-05-09","entity_id":"calendar.Birthdays","recurrence_id":"20240508","rrule":"FREQ=YEARLY","start_date":"2024-05-08","summary":"a birthday"} would work but I keep getting a 400 Bad request for any variation I try

vague666 commented 9 months ago

Looking at the source I guess create_event hasn't implemented those input parameters yet? Not too familiar with the inner workings of HA

HenryTheSwede commented 9 months ago

Agree @vague666, looking at the documentation of create_event, this function doesn't have these kind of parameters yet, therefore not available via the API either

alex-dokienko commented 3 months ago

I'm trying also use API to create events, but there is very little documentation on this. when I'm trying to do post to this url 'http://homeassistant.local:8123/api/services/calendar/create_event' I get bad request issue (I did enable api in configuration) really appreciate any help 🙏