Skip to main content
Version: 1.0.0

Import Files

info

See Field Limits for accepted characters, field-length rules, and error behavior shared by every import endpoint.

MethodDescription
uploadfileUpload a file to a folder on the server.
attachFilesAttach existing files to existing records.

Upload Files Method​

Upload a file to a folder on the server.
If you want to attach the file to an existing record, make sure to include the field "rows" - an array of objects that represent the combinations (recordType and recordId)

REST APIFilesApi/uploadfile

file Data​

The following parameters should be included in a formdata object (see example below)

FieldName-transTypeDescriptionתיאורDefault
file
Required
file. File name max 44 characters.קובץFile object
folder
Required
string (max 45). Must be an existing folder name.שם תקיהFolder name
publicPublic=1
Not public=0
ציבוריpublic0
typestring (max 45)סוג קובץtypetype
DescriptionString (max 45)תאורdescriptionEmpty value
uploadIfExistsbooleanהעלה גם אם קיים כבר קובץ בשם זהupload if file with the same name already existtrue
rowsSee table belowמערך של צירופיםArray of combinations

rows Data​

The following parameters should be included in a JSON.stringify rows (see example below)

FieldName-transTypeDescriptionתיאור
recordType
Required
One of: acc (account), itm (item), jurn (journal transaction), docs (document). recordId must exist.Type of recordסוג רשומה
recordId
Required
string record idמזהה רשומה

form-data Example​

formData: {
'file':fs.createReadStream('C:/images(1).jpg'),
'folder': 'תמונות',
'public': '1',
'type': 'type',
'Description': 'report',
"rows": JSON.stringify([
{
"recordType": "itm",
"recordId": 8600,
},
{
"recordType": "acc",
"recordId": 8600,
}]
)
},

uploadfile OutputData​

NameOptions
statusCode200 – OK / 500 - Errors
status
newIDID of the newly created record
errorsOK / Errors: "error description" / No Permission

How to upload a file via Postman​

From the web: https://makolyte.com/how-to-upload-a-file-with-postman/

In the Body tab, select the form-data option. Then hover your mouse over the row so you can see a dropdown appear that says Text. Click this dropdown and set it to File.

Set type to file

Fill in the key name file. Finally, click the Select Files button (the name may be different depending on which version of Postman you’re using):

fill in "file" in key and select "files"

Clicking Select Files will open a file selection dialog window. Select one file. Now you’ll see the selected filename in the Value column:

Select a file

Fill in the other fields

fill in file, folder, public, type and description

If you're adding rows make sure to attach the following:

Set type to file

warning

Postman doesn't support Hebrew file names.

Attach File Method​

Attach existing files to existing records.

REST APIFilesApi/attachFiles
ParametersDescriptionParameter Options/value
rowsobject name contains dataSee table below

file Data​

FieldName-transTypeDescriptionתיאור
recordType
Required
One of: acc (account), itm (item), jurn (journal transaction), docs (document). recordId must exist.סוג רשומהType of record
recordId
Required
string מזהה רשומהrecord id
fileId
Required
integer numberמזהה קובץFile id

JSON Example​

{
"rows":[ {
"recordType": "jurn",
"recordId": 8600,
"fileId": 10146
},
{
"recordType": "acc",
"recordId": 8600,
"fileId": 10150
}
]
}

attachFiles OutputData​

NameOptions
statusCode200 – OK / 500 - Errors
status
errorsOK / Errors: "error description" / No Permission