Premise: I am creating a process where a maintained classifications file can be fully or partially manually be uploaded to Analytics' Classifications API and data is updated. This can be done with relative ease using FTP file transfer to send items in, but since the API has more options, we decided to investigate would it cover our needs. Even though the Classifications Datasets are a bit more hassle to explain and especially to get them programmatically with indications which one to use, I've managed to build the flow nicely and can run everything in Postman Flows. Almost everything that is.
There was another post (I will add a link when I find it) that was trying to do something similar and ran into this issue as well. Sending the upload lead to this error message:
{
"errorCode": "500",
"errorDescription": "Cannot invoke \"javax.servlet.http.Part.getInputStream()\" because \"filePart\" is null",
"errorId": "abcd1234"
}
What this means is that the receiving Java servlet cannot find the file uploaded to process. This is likely because the documentation does not say where that file is supposed to be attached, as we can see here: Import API classifications by uploading files, more specifically this part:
This defines the name of the file and where that file is located on the sending device. All good, but that doesn't actually mean the file is attached to the request in cURL, nor will cURL try to read it based on these values. I have tried to replace the "Value" with cURL's upload syntax, added a new field and so on, but since I don't know the name of the field, the file never gets processed. In another post I read comments related to the file not being accessible, which should not be the case, but to be sure I ran the same code in cURL locally in Windows directly, as well as a separate Unix server, all with the same results.
To put this shortly: Does anyone know what is the filename Classifications API file upload is expecting, so I could successfully send a file to it, OR alternatively: Am I doing this wrong and the API example should work as defined?
Views
Replies
Total Likes
In relation to the question I referred, one of the replies referred to file uploads to cloud destinations (Locations) and file locations. This, I think, is the issue: I consider file uploads to be actual uploads, but in reality they are likely ways to tell Classifications API in which cloud location the file is and to download it from there, rather than actually being a file upload. In my opinion this naming is a bit misleading and the documentation does not refer to locations in any way. I will test this out and see if this solves my issue.
Views
Replies
Total Likes
Please let us know what you find!
I was in that previous discussion, and I have not used this... but my guess is that the file location needs an absolute location (https://www.domain.com/folder/location/file.tsv), as opposed to a relative location (/folder/location/file.tsv).... unless this script is being run from a web server, and the file is on the same server where the relative link can be accessed, I don't see how Adobe could possibly find the file based on the limited information.. and if running the API locally (i.e. using Postman), files located on your hard drive are not accessible to the web.
Good luck testing.
Views
Replies
Total Likes
Indeed and thanks for chipping in. The documentation refers as the only example to a local filepath, but this could be a local filepath in any system. I assumed it is local, but that is not how it works with cURL, so I will be adding a file location today and testing how it would work with e.g. SFTP.
If this is the case, I'm wondering how we separate between different location accounts as an example, since the documentation only shows file name and full path including file name, but lets assume I have two different SFTP servers I use, so how are the location specifics passed on? With SFTP (which is FTP wrapped in SSH) you can do this as a part of the URL, but how about Azure or Amazon locations? I can only guess.
Agreed, the documentation is a bit lacking in those regards....
Views
Replies
Total Likes