how send calendarId to event? #250
Replies: 4 comments
-
Is this calendarId My calendarId looks nothing like this, it looks more like a complicated email address. Here is where you will get your calendar_id: |
Beta Was this translation helpful? Give feedback.
-
@abrahamluiss I also have this question, the code says that it is possible to inform an attribute that is the calendar id public function __set($name, $value)
{
$name = $this->getFieldName($name);
if (in_array($name, ['start.date', 'end.date', 'start.dateTime', 'end.dateTime'])) {
$this->setDateProperty($name, $value);
return;
}
if ($name == 'source') {
$this->setSourceProperty($value);
return;
}
Arr::set($this->googleEvent, $name, $value);
} did you manage to solve it in any other way? |
Beta Was this translation helpful? Give feedback.
-
$event = new Event();
$event->name = 'A new event';
$event->description = 'Event description';
$event->startDateTime = Carbon::now();
$event->endDateTime = Carbon::now()->addHour();
$calendar = GoogleCalendarFactory::createForCalendarId('[email protected]');
$calendar->insertEvent($event); try this one, you can not set |
Beta Was this translation helpful? Give feedback.
-
@ abrahamluiss If it helps, I use the uniqid function to create an event id which I can then search for using get.
then I save that unique id (here the retreat table's calendar_id field) into the table that the event is associated with and later when I want to get that event and update it I can use:
Does that help answer your question? When I have seen the error you are sharing, it is because the calendar_id provided is incorrect. So you want to distinguish between the calendar id and the event id. p.s. - feel free to look at how I implemented using the unique id. |
Beta Was this translation helpful? Give feedback.
-
I'm doing this
$event = new Event;
$event->name = 'name';
$event->description = 'description ';
$event->startDateTime = Carbon\Carbon::now();
$event->endDateTime = Carbon\Carbon::now()->addHour();
$event->calendarId = '5';
$event->save();
now
answer
{ "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "Not Found" } ], "code": 404, "message": "Not Found" } }
Beta Was this translation helpful? Give feedback.
All reactions