我已经编写了一个Azure函数来将数据发送到Zoho CRM SDK中。SDK在使用时需要一个文件路径来写一些元数据(称为"resourcePath")。当我在本地开发时,我正在使用我的文档,它工作得很好。我需要找到可以在Azure环境中使用的位置。
根据我读过的文章,我尝试过System.IO.Path.GetTempPath()和context.FunctionAppDirectory'.,它们都抛出了权限错误。错误来自SDK {{ "code": "OAUTH_SCOPE_MISMATCH", "status": "error", "message": "invalid oauth scope to access this URL" }},我被告知这是文件位置上的权限错误。我应该将哪个位置用于Azure函数?
**回复@HariKrishnaRajoli-MT **
我更改了路径,现在我在CreateRecords()中获得了Object reference not set to an instance of an object.。RecordOperations、moduleApiName和bodyWrapper都有效。没有任何内容为空。
at Com.Zoho.Crm.API.Util.Utility.GetFieldsInfo(String moduleAPIName) at Com.Zoho.Crm.API.Util.Utility.GetFields(String moduleAPIName) at Com.Zoho.Crm.API.Record.RecordOperations.CreateRecords(String moduleAPIName, BodyWrapper request) at Zoho_CRM_Feed.feed_app.Lead.CreateNewLead(List1 leads) in C:\Users\xxxxxxxx\source\repos\Zoho_CRM_Feed\Zoho_CRM_Feed\feed_app\Lead.cs:line 75
有什么建议吗?
发布于 2021-09-21 09:12:00
您可以使用
System.IO.Path.GetTempFileName(),这将创建一个%userprofile%\Local\Temp\tmpE128.tmp文件
或
System.IO.Path.Combine(System.IO.Path.GetTempPath(),
System.IO.Path.GetRandomFileName()) 如果您收到错误,请生成](https://www.zoho.com/crm/developer/docs/api/v2/access-refresh.html) "https://www.zoho.com/crm/developer/docs/api/v2/access-refresh.html)")一个新的访问令牌,并检查您是否仍然收到相同的错误。
https://stackoverflow.com/questions/69260043
复制相似问题