This topic contains 1 reply, has 0 voices, and was last updated by michoel 6 years, 6 months ago.

  • Author
    Posts
  • #17902

    jsheaffer

    Has anyone had success using either the amazon javascript sdk or the amazon REST api in suitescript 2.0? I am trying to add the ability to get a .json file from amazon into netsuite via suitescript.

    I cannot properly sign the REST request using the crypto module. I believe this is due to suitescript requiring the creation of a GUID and amazon requiring the inclusion of a custom “string to sign” based on your request.

    I get an error when i try to load the sdk as a custom module and I am not sure if it is possible to use that. This is the error:

    {“type”:”error.SuiteScriptModuleLoaderError”,”name “:”UNEXPECTED_ERROR”,”message”:”ReferenceError : “Uint32Array” is not defined. (aws-sdk.min.js$1133916$debugger.user#48)”,”stack”:[“(adhoc$-1$debugger.user:1)”]}

    Any help is appreciated.
    This is a cached copy. Click here to see the original post.

  • #17903

    michoel

    Originally posted by jsheaffer

    View Post

    {“type”:”error.SuiteScriptModuleLoaderError”,”n ame “:”UNEXPECTED_ERROR”,”message”:”ReferenceError : “Uint32Array” is not defined. (aws-sdk.min.js$1133916$debugger.user#48)”,”stack”:[“(adhoc$-1$debugger.user:1)”]}

    This error sounds like the module you are trying to import uses a JS feature called Typed Arrays which the NetSuite JS engine (Rhino) doesn’t support

    You can try using a polyfill such as https://github.com/substack/typedarray

You must be logged in to reply to this topic.