data: {
statusCode: 400,
error: 'Bad Request',
message: 'Users file must not be empty',
errorCode: 'operation_not_supported'
}
Anyone can help me with this? (And maybe the docs could be updated with a working example?)
p.s. I have already tried to modify in different ways (following posts on here and stack overflow), and nothing has worked, always getting some kind of error…
Have you ensured the path of the users.json file you are using here is in the path the NodeJS script is looking for it in, and that the users.json file is not an empty file? There’s a basic example of the users.json file at Bulk User Import Database Schema and Examples you can use for testing, with more complex examples throughout that same page. Hope this helps.
Does it give the same behavior/error message with the sample file at the link shared above, specifically copying and pasting Bulk User Import Database Schema and Examples sample data into a users.json file and using this as the source of users for the upload script?
If it does give the same error, then you may want to double check the path you are using for referencing the file, as it would most likely be that it simply isn’t seeing the file.
If it does not give the same error and uploads correctly, can you try copying the data from the original non-working users.json file and pasting and overwriting the data in the file that works?
This will then reveal if it is a file data error if this doesn’t work, or an actual saved file format error if this does work, as is sometimes (depending on your OS) where a file editor may use a file encoding that doesn’t quite work as expected with an HTTP POST.
How else would I refer to the file? Shouldn’t it be clear or not my the code above if it would see the file or not? (Which is basically the same as the Auth0 example, I just set it to a variable instead of having it inline).
Hi, I got the same error, using python.
I use full path to json file and relative path and both the same error, if I exec from curl works fine. so the file is well json formed.
Any Help?
Hi, I’m seeing this issue in python, and the input file is not empty. Is the python snippet provided in the guide out of date? Guide: Bulk User Imports.
Hi there could someone help with my question? Thanks! I’d also like to add that I ran the curl command with my own parameters, and it worked fine. It seems to be the python snippet.
Hi, same applies to the C# snippet. It doesn’t work the way it seems to be setup. Saw some examples online that use RestRequest and they added the file with ‘request.AddFile()’ method so maybe something is missing in those code examples for User imports?