I’m hoping someone can help me and point me to some useful resources.
I’ve been tasked with creating an export of data from SQL which needs to be in the json format, and then bulk upload to create records on a third parties cloud based software. The documentation requires me to upload the data via a cURL command. I have produced an SQL query which can output the data into json, and with the integration of SQL in PowerShell, I wondered if it would be the right tool for the job?
The example command I have requires the json data to be read from a file, which can then be uploaded via the web link using an api key.
I’ve been looking into how this could be achieved, and have found articles on using Invoke-WebRequest, but not seen much with regards to reading a json file containing the data to upload. Is this possible in PowerShell? The version installed on the machine is 5.1.
The example command is:
curl -F “file=@/path_to_file/filename.json” https://site-domain-name/api/enrollearners?apikey=yourkey