Trying to automate my mock data creation via terminal commands to create the directories + do the API calls to get the mock data inside those directories.
Some of the schemas are used as datasets for other schemas that are ran during this workflow so I want to upload said schema as a dataset once it’s there, i.e. the workflow is as follows:
- Create mock data from Schema A
- Upload resulting data as DatasetA
- Create mock data from Schema B and C which use Schema A as a dataset
- Prompt user for a file from file system (aka choose a file) & upload this file as new DatasetZ
- Create mock data from SchemaZ using DatasetA and DatasetZ
Now, the actual problem is the response I’m getting. I’m convinced I’m making some basic mistake or missing something simple, so please do correct me at what I’m doing wrong.
CURL:
curl https://api.mockaroo.com/api/datasets \ -X POST \ -H "X-API-Key: KEYHERE" \ -H "Content-Type: text/csv" \ -d @/Users/user/Downloads/directory/file.csv
Error that I keep receiving both in terminal and Postman:
{"error":"undefined method `name' for nil:nilClass}