在我的laravel-application中,我希望通过使用Cronofy API和来自cronofy-php的包来包含我的google-calendar。
当我尝试创建一个事件时,我得到了错误422 Unprocessable Entity,但我真的不知道为什么。
下面是我的create/post请求
$cronofy = new Cronofy\Cronofy([
"client_id" => config('cronofy.client_id'),
"client_secret" => config('cronofy.client_secret'),
"access_token" => $access_token->value,
"refresh_token" => $refresh_token->value
]);
$params = [
'calendar_id' => (string)request()->calendar_id,
'event_id' => (string)request()->event_id,
'summary' => request()->summary,
'description' => request()->description,
'start' => request()->start,
'end' => request()->end
];
$new_event = $cronofy->upsertEvent($params);
return response('event added!', $new_event);我在"calendar_id“和"event_id”上尝试了不使用和使用(string),但都没有成功。
那么,我做错了什么呢?
发布于 2021-01-29 21:35:58
您可以通过以下两种方式之一获得有关422原因的更多信息。
JSON
这应该有助于您了解是哪个参数值导致了问题。create and update event docs将为您提供有关允许值和格式的指导。
如果您需要进一步的帮助,您也可以从开发人员仪表板向我们的支持团队提出建议。
https://stackoverflow.com/questions/65955128
复制相似问题