【问题标题】:Download file from NetSuite File Cabinet using API使用 API 从 NetSuite 文件柜下载文件
【发布时间】:2020-11-12 13:48:14
【问题描述】:

我正在尝试创建一个解决方案,在该解决方案中,我使用已保存的搜索运行 SuiteScript,并将结果以 CSV 格式导出到文件柜中。我有一个粗略的脚本和一个搜索,但我还没有找到通过默认 API 下载文件的方法。

我浏览了 NetSuite pdf 中关于 Web 服务和 rest/soap api 的内容,但对文件柜的唯一参考是 Web 服务 (https://docs.oracle.com/cloud/latest/netsuitecs_gs/NSTWP/NSTWP.pdf)。我也不知道如何使用模式浏览器(https://system.netsuite.com/help/helpcenter/en_US/srbrowser/Browser2020_1/script/record/salesorder.html

我可以使用默认 API(即 SOAP/Rest)下载 NetSuite 文件吗?我需要什么来调用 API? URL 会是什么样子?是否值得在 NetSuite 上创建新的集成?

(我的最终目标是:SuiteScript + 搜索 > CSV > 通过 API 下载文件 > 上传到 Azure Blob)

【问题讨论】:

  • 嘿,多姆!您使用哪个系统从 API 下载文件并上传到 Azure?
  • @jordanw,目前我正在尝试使用 Postman 和 SuiteTalk API 在本地下载文件。但我打算使用 PowerShell 上传到 Azure。 (我想在 Azure 函数中运行它,这就是我试图下载的原因)

标签: azure api netsuite suitescript


【解决方案1】:

使用 SOAP Web 服务“get”调用从 Netsuite 检索文件,然后导出到 Azure。下面是使用文件内部 id 的示例 xml,如果不知道 id,请通过 web 服务搜索特定文件夹以获取所有文件 id,然后对 Netsuite 进行 get 调用

<soapenv:Envelope
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:platformCore='urn:core_2020_1.platform.webservices.netsuite.com'
    xmlns:platformMsgs='urn:messages_2020_1.platform.webservices.netsuite.com'>
    <soapenv:Header>
        <passport xsi:type='platformCore:Passport'>
            <email xsi:type='xsd:string'>p@***</email>
            <password xsi:type='xsd:string'>*********</password>
            <account xsi:type='xsd:string'>*****</account>
            <role xsi:type='platformCore:RecordRef' internalId='3'/>
        </passport>
        <applicationInfo xsi:type='platformMsgs:ApplicationInfo'>
            <applicationId xsi:type='xsd:string'>7*****</applicationId>
        </applicationInfo>
    </soapenv:Header>
    <soapenv:Body>
        <get xsi:type='platformMsgs:GetRequest'>
            <baseRef xsi:type='platformCore:RecordRef' internalId='5902' type='file'/>
        </get>
    </soapenv:Body>
</soapenv:Envelope>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-12-15
    • 2020-05-02
    相关资源
    最近更新 更多