/files/v3/files/import-from-url/async returns link which is not valid
SOLVE
I've been trying to attach a file from a URL in file manager and from file manager to deal through engagement. Previously, I was trying to do this process using this endpoint
/filemanager/api/v3/files/upload
but I wan't lucky enough to do my thing using that endpoint and posted a separate question for it on forum.
Now I'm trying to upload files from a url to file manager using this endpoint
Now I'm confused about this response because of two reasons
status link in the response is not working and returning 404 Not Found
If I've to attach this specific file with the engagement how can I do it because engagement takes attachment id of file not the id I'm getting in the response.
This is my code
var options = {
"method": "POST",
"hostname": "api.hubapi.com",
"port": null,
"path": "/files/v3/files/import-from-url/async?hapikey=demo",
"headers": {
"accept": "application/json",
"content-type": "application/json"
}
};
var req = http.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
var body = Buffer.concat(chunks);
console.log(body.toString());
console.log(body)
});
});
req.write(JSON.stringify({
access: 'PUBLIC_INDEXABLE',
ttl: 'P3M',
name: 'test image',
url: "https://app.arrivy.com/api/files/AMIfv95pvfFG9Yvgxx2LVLTv7BFfIwsfRjeGXeQjUQYhlB3ul32Bwc86NYYR2uKcUXfv0KRoVwIwPCDy3sAaww3Msra-Kg4oZJsa9GgYVQIxjgNPMi1vRmmlnRQswrHQ2IDq3cRfGHY0Fcp62ocnsdq-d_772HWono9AyWYd6NOiAKbBhCUi95TYC0S74OPY6itN6owPt6MxU8TkuV1WR7UOgsVFVPjmjrt8ZVdHE1gF3Wi9epodApJ7Vgtswhhrfy7hqrCdXO5hsY2uTQtiXuTbu2SqYEurO8fOLBIbePjhjy4gmAyEiJuGgLYHcexNlUdRdWwwbjP68tgVgCanSDCfTmvWPhmwh9JPlykbunb194kfX2XQtWk",
folderPath: 'docs',
duplicateValidationStrategy: 'NONE',
duplicateValidationScope: 'ENTIRE_PORTAL',
overwrite: true
}));
req.end();
/files/v3/files/import-from-url/async returns link which is not valid
SOLVE
Thanks @Teun@dennisedson@TiphaineCuisset for your response. I've resolved my issue. It was related to filename not the folder path. If you don't mention extention(like .csv, .jpg, .txt) in your filename, you'll get an error on the status link found in response of /import-from-url/async Api.
/files/v3/files/import-from-url/async returns link which is not valid
SOLVE
Thanks @Teun@dennisedson@TiphaineCuisset for your response. I've resolved my issue. It was related to filename not the folder path. If you don't mention extention(like .csv, .jpg, .txt) in your filename, you'll get an error on the status link found in response of /import-from-url/async Api.
/files/v3/files/import-from-url/async returns link which is not valid
SOLVE
Hey @Teun I tried with folderId and still the url I got in the response giving me 404. Though my file get attached in the file manager by running the above mentioned script but the problem is to get the exact id of that file to attach it with the engagement.
/files/v3/files/import-from-url/async returns link which is not valid
SOLVE
@UmairKhan I think @dennisedson is giving you the answer, if you look at the docs the "folderPath" contains a / before the folder name. If that isn't working, could you try swapping the folderPath for a folderId parameter? That way, you know for sure that you have no issues with the relative path.
Learn more about HubSpot by following me on LinkedIn or YouTube
✅ Did my answer solve your issue? Help the community by marking it as the solution.
/files/v3/files/import-from-url/async returns link which is not valid
SOLVE
Hey guys @himanshurauthan@DanielSanchez did you get a chance to look into my problem ? Actually I'm blocked and I'll be thankful if you suggest me some kind of solution to my problem. And thankyou @TiphaineCuisset for mentioning daniel and himanshu.