Example node.js code for uploading a file to create a new Asset
constfs=require("fs");constfetch=require("node-fetch");constFormData=require("form-data");constform=newFormData();constfilePath="./myFile.png";form.append("file",fs.createReadStream(filePath));constauthToken="my auth token"; // obtained from the authentication processconstcreativeId="sdnkrn7wcdnbpyy5"; // must be the creative ID of an existing creativeconstassetId="myNewAssetId";constnetworkId="myNetworkId";fetch('https://api.adnuntius.com/api/v1/assets/' + creativeId + '/' + assetId + '?context=' + networkId + '&auth_token=' + authToken, {
method:'POST', body: form});