Hi can anyone has experience with BOX integration ...
# suitescript
m
Hi can anyone has experience with BOX integration using Suitelet? I'm encountering an issue when trying to send file to BOX . here's my snippet
Copy code
var stURL = '<https://upload.box.com/api/2.0/files/content>';
            var headerObj ={
                "Authorization" : 'Bearer ' + apiToken
            };
            var objPayload ={
                attributes : {
                    name : objFile.name,
                    parent  :{
                        id : folderId
                    }
                },
                file : objFile.getContents()
            }

            <http://https.post|https.post>({
                url: stURL,
                headers: headerObj,
                body : JSON.stringify(objPayload)
            });
Thanks advance.
b
you will probably have trouble doing this via suitescript
the box api notes that the content type is supposed to be multipart/form-data which requires an excessive amount of work. You might end up struggling with binary files since netsuite tends to have poor support there.
m
thank you for the response. 😄