Skip to content
This repository was archived by the owner on Jan 14, 2026. It is now read-only.
This repository was archived by the owner on Jan 14, 2026. It is now read-only.

Can not upload file using V2 API #8

Description

@tonytangau

Keep getting 500

500 - An error has occurred and administrators have been notified. For more information, please contact * with reference code "soidfdix"

when post file to upload:

    const config = {
        headers: {
          "Authorization": `Bearer ${TOKEN}`,
          "Content-Type": "multipart/form-data" //application/json
        }
    }

    const payload = {
      "file": fs.readFileSync(filePath),
      "fileUri": FILE_URI,
      "fileType": "json"
    }

    axios.post(SMARTLING_URL, payload, config)
    .then(res => {
      return res;
    })
    .catch(e => {
      return e
    })

Also tried FormData and pipe fs.readFile, but none of them are working. Could you please provide a clearer example of how to POST to your API?

BTW, I'm also considering creating a node-smartling package to help the others so they can easily use V2 API without the hard work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions