I am trying to upload file in user computer to BOX using API. On GitHub I found this: https://github.com/Tackgnol/VBA-BOX-API/blob/master/mBox.bas
Box Sync and Box Drive are not solution (cannot force user install).
When I printed StatusText I got "Method Not Allowed".
65853643834 is folder id got from URL. h5ntjo525se0tbhwswq8ozpoqsge**** is from Box Dev "Client ID"
Sub UploadFile()
UploadBoxFile "h5ntjo525se0tbhwswq8ozpoqsge****"
End Sub
Sub UploadBoxFile(ByVal sToken As String)
Dim curlInput As XMLHTTP60
Dim sQuery As String
Dim sXMLInput As String
Set curlInput = CreateObject("MSXML2.XMLHTTP.6.0")
sQuery = "https://upload.box.com/api/2.0/files/content"
sXMLInput = "attributes={name: ""fileSample.txt"", ""parent"": {""id"": ""65853643834""}}" & vbNewLine & "file=C:\Users\MichalPalko\Downloads\fileSample.txt"
curlInput.Open "POST", sQuery, False
curlInput.setRequestHeader "Authorization:", "Bearer " & sToken & 3243
curlInput.send sXMLInput
Debug.Print curlInput.StatusText
End Sub
