Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Symfony google日历api错误400-资源id值无效_Symfony_Google Api_Google Calendar Api - Fatal编程技术网

Symfony google日历api错误400-资源id值无效

Symfony google日历api错误400-资源id值无效,symfony,google-api,google-calendar-api,Symfony,Google Api,Google Calendar Api,我想使用Symfony命令批处理通过API在Google日历中插入事件 当我插入一个ID为event01487的事件时,它抛出以下错误:代码:400,消息:无效的资源ID值 此id是唯一的,因为没有插入任何事件-它甚至没有插入一次。这个id似乎符合谷歌的要求 你知道我为什么得到这个吗 foreach($bookingsToSync as $booking){ $event = new Google_Service_Calendar_Event(); $event->se

我想使用Symfony命令批处理通过API在Google日历中插入事件

当我插入一个ID为event01487的事件时,它抛出以下错误:代码:400,消息:无效的资源ID值

此id是唯一的,因为没有插入任何事件-它甚至没有插入一次。这个id似乎符合谷歌的要求

你知道我为什么得到这个吗

foreach($bookingsToSync as $booking){
     $event = new Google_Service_Calendar_Event();
     $event->setId($booking['id']);
     $event->setSummary($booking['title']);
     $event->setDescription($booking['description']);

     $start = new \Google_Service_Calendar_EventDateTime();
     $start->setDateTime($booking['startDate']->format(DateTime::ATOM));
     $event->setStart($start);
     $end = new \Google_Service_Calendar_EventDateTime();
     $end->setDateTime($booking['endDate']->format(DateTime::ATOM));
     $event->setEnd($end);

     $output->writeln($event->getId());

     $service->events->insert($calendarId, $event);
}

您必须遵循此处定义的指导原则:


基本上,id必须介于5到1024个字符之间,并且由以下字母表中的字符组成:0123456789abcdefghijklmnopqrstuv

您必须遵循此处定义的指南:


基本上,id必须在5到1024个字符之间,并且由这个字母表中的字符组成:0123456789abcdefghijklmnopqrstuv

可能是Nope的重复,但不是。问题是一样的,但我已经做了被接受的答案said@RomHill这些小精灵很快就不需要实际检查就可以回答问题。钓点。可能是重复的不,不是。问题是一样的,但我已经做了被接受的答案said@RomHill这些小精灵很快就不需要实际检查就可以回答问题。寻找积分。JJP,你的答案有什么帮助?有问题的ID event01487符合这些准则,但存在错误。我遇到了同样的问题。我同意;我看不出这对标准类型故障有什么帮助。我惊讶地发现wxyz是不允许的;我以前没意识到这一点。我可以解释我看到的一些问题。JJP,你的回答有什么帮助?有问题的ID event01487符合这些准则,但存在错误。我遇到了同样的问题。我同意;我看不出这对标准类型故障有什么帮助。我惊讶地发现wxyz是不允许的;我以前没意识到这一点。可以解释我看到的一些问题。