连接创建媒体文件连接器时出错 - Mule4 中的 google 驱动器

Error while connecting Create media file connector - google drive in Mule4

我必须通过 mule 集成将图像上传到 google 驱动器。我在执行 google 驱动器创建媒体文件配置时遇到了麻烦。有人可以帮助我或指导我相关的教程吗?

这是我尝试连接到 google 驱动器时出现的错误消息

Message               : Request returned status code 403
Element               : imageuploaderFlow/processors/4 @ 
imageuploader:imageuploader.xml:39 (Create media file)
Element DSL           : <google-drive:create-media-file doc:name="Create media file" doc:id="hhhhhjhj" config-ref="Google_Drive_Connector_Config" contentType="application/octet-stream">
<google-drive:file-content><![CDATA[
#[payload.parts.image.content write "application/octet-stream"]
]]></google-drive:file-content>
</google-drive:create-media-file>
Error type            : GOOGLE-DRIVE:CLIENT_ERROR
FlowStack             : at imageuploaderFlow(imageuploaderFlow/processors/4 @ imageuploader:imageuploader.xml:39 (Create media file))

连接器xml片段

<google-drive:create-media-file doc:name="Create media file" doc:id="ac59e7fe-e615-fggh-9473-2we5cd73ecb7" config-ref="Google_Drive_Connector_Config" contentType="application/octet-stream">
            <google-drive:file-content ><![CDATA[#[payload.parts.image.content write "application/octet-stream"]]]></google-drive:file-content>
        </google-drive:create-media-file>

Google 驱动连接器的版本是 1.0.1

确保您的项目中有 Enabled the Google Drive API。不启用它也会引发 403 错误。此外,大多数情况下,Google API 会在您做错事时发送非常明确的信息。您可以使用 error.errorMessage.payload 和 headers 使用 error.errorMessage.attributes.headers

访问详细的 HTTP 响应