-
Notifications
You must be signed in to change notification settings - Fork 2
General troubleshooting
Amrik edited this page Apr 29, 2021
·
3 revisions
- Always make sure you are running the latest version of the command. To confirm, run
ado update
in Stata. - Type
help sctoapi
in Stata and confirm that no parameter is missing from your command. Here, you can go to section Examples for specific examples of commands. - Make sure all parameters were entered correctly:
- server() - ensure that the name of your server is correct and without typos.
-
user() and password() - double check your SurveyCTO credentials:
- The credentials you’re using should be from a user with permission "Can download data" (permissions are configured to user roles).
- From previous experience, passwords with special characters may cause issues with the command. If needed, remove any special characters from your password and try again.
-
date() - If you’re passing 0 in this parameter, ensure that you’re taking into account our API rate limits. Otherwise, if you’re passing a specific date, ensure that:
- It is a valid date value. You can type
help sctoapi
to learn more about all valid formats, but a unix timestamp is probably the most common one. - You have completed submissions from after that date (inclusive).
- It is a valid date value. You can type
- output() - Ensure that your folder path exists and it’s valid. If you’re having trouble, try to run the same command with a different, shorter output folder (e.g. "C:\Users\user\Desktop") to see if the outcome changes.
- Confirm that your Stata limits are enough to accommodate the dataset you are trying to download. If possible, export your data via the Export tab / SurveyCTO Desktop, to understand the structure and size of your data.
- The sctoapi command first generates and saves a JSON file in your output folder. From there, it saves the dataset in CSV format. Always search for JSON files in your output folder for clues. If there was any API request error, it will probably be saved inside the JSON file.
If you are still having troubles after following these steps, and if you’re a trial or paid SurveyCTO user, start a support ticket to get help and share all the troubleshooting steps you followed, as well as Stata logs and relevant JSON files.