Skip to content

General troubleshooting

Amrik edited this page Apr 29, 2021 · 3 revisions

sctoapi

  1. Always make sure you are running the latest version of the command. To confirm, run ado update in Stata.
  2. 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.
  3. 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:
      1. The credentials you’re using should be from a user with permission "Can download data" (permissions are configured to user roles).
      2. 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:
      1. 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.
      2. You have completed submissions from after that date (inclusive).
    • 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.
  4. 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.
  5. 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.


Clone this wiki locally