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, 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?