How To Use The SurveyToGo REST API

 


Overview

 

You can access your organization data using the SurveyToGo REST API. The REST API allows you to create a tight integration between the SurveyToGo system and any 3rd party system. Using the API requires prior knowledge of the REST protocol and experience in programming. You can use the REST API from any operating system and any programming language. The SurveyToGo REST API consists of a set of operations which are listed below. Please note we are adding to the list of operations so check back often or subscribe to this topic to stay on top of any new REST operation that is supported.

 

Downloading the Testbed App and Full Source code

Dooblo provides you with a free SurveyToGo REST API Testbed app that allows you to test all the available operations and see the output you will get to assist with the development process. In addition we provide the full C# source code of the Testbed app so that you can see the actual implementation of the code. Please note you can call the REST API from any language, not just C#:

 

SurveyToGo REST API Operations Available

The following operations are available:

General Account management:

  • GetCreditBalance – returns the current interview balance
  • GetStorageStatus – returns the current storage space usage 

 User Administration & Assignment

  • AddSurveyorUser – adds a new interviewer user to the organization
  • DeleteSurveyorUser – deletes the interviewer user from the organization
  • AssignSurveyorUserToProject – assigns the interviewer user to the project
  • UnassignSurveyorUserFromProject – unassign the interviewer user from the project
  • GetProjectSurveyorUsers – returns the list of interviewers users assigned to a project
  • GetProjectSurveyorGroups – returns the list of interviewer groups assigned to aproject
  • GetGroupUsers – returns the list of users in a group
  • GetSurveyorGroups - returns the list of all groups of surveyors
  • GetSurveyorUsers - returns the list of all surveyor users in the organization

Projects & Customers

  • Customers – returns the list of customers in the organization
  • CustomerProjects – returns the list of projects of a certain customer
  • ProjectSurveys – returns the list of surveys within a project
  • CreateCustomer – creates a new customer
  • CreateProject – creates a new project within a customer
  • CloneSurvey – creates a copy of an existing survey in the same or different project
  • Surveys – returns the details of a specific survey
  • GetSurveyXML – returns the full survey XML structure of a specific survey. We recommend using SimpleSurveyExport instead of this function.
  • SimpleSurveyExport – returns a simple JSON/XML survey structure of a specific survey. This is a more recommended function to use than GetSurveyXML.

Data

  • SimpleExport – Generates an "Excel" like export of the survey data but in JSON or XML format. 
  • OperationData – returns the interview operational data in a form similar to the operations console
  • SurveyInterviewIDs – returns the list of interview ID’s of a survey based on filters
  • SurveyInterviewIDsByLastModified – returns the list of interview ID’s of a survey based on the last modified time of the interviews.
  • SurveyInterviewData – returns the actual XML data of the interviews based on ID’s. The call will return the data of a maximum of 99 interviews per call. If you need to call this for more than 99 interviews please split your call to multiple calls each one would consist of up to 99 interview IDs.
  • IncludeNulls - Once it is set to true it will show empty answers. 

Interviews

  • ChangeStatus – changes the status of an interview

Additional Data Lists

 

URL For Calling the REST API

The SurveyToGo REST API is hosted at this URL: http://api.dooblo.net/newapi

Calling the actual operations involves referencing the correct URL and passing the relevant user/password details.

 

User ID for Accessing the REST API

To call the various operations you need to specify a valid user ID. The user ID is in the form of XXXX-XXXX-XXXX/YYYY where the first part is your organization REST API Key and the second part is the relevant user name you wish to use for the operations. Please note the user accessing the REST API needs to have the relevant permissions for the operations that user is calling. For example, if the user does not belong to a certain project that user will get an authorization error if that user attempts to call operations for that project.

 

For example, if the user you wish to use when calling the REST API is named “mark” and the organization REST API Key is: f150fc49-3a14-4ecb-9214-ca04698a9578 the user ID that you need to use when calling the REST API: f150fc49-3a14-4ecb-9214-ca04698a9578/mark

Contact support@dooblo.com to receive your organization REST API Key to use with the REST API.

 

Rate Limits

The SurveyToGo REST API has a built-in rate limit of up to 15 calls per second. Once the limit has been reached an HTTP 429 response code will be returned (Rate limit). You can either write code in your application to deal with the rate limit response code or build around this limit by adding rate limit code to your REST API calling code.

   

JSON vs XML Output of requests

In some calls you can request to receive the output of the data in either JSON or XML format. This is intended to cater to each programmer preference. However, please keep in mind that for some operations that return either interview data or survey data in them, only XML will be supported as an output format. If you try to call these with JSON as format you will receive an error: “Error: This method supports only xml” from the API.

 

Sharing of your SurveyToGo REST API Integration Success Stories

If you developed a cool integration using the SurveyToGo REST API, we would love to hear about it and possibly share the project highlights with the rest of our community along with your name and details (if you wish) to promote your expertise and broaden the horizon of our community! Let us know by emailing us to ofer@dooblo.com .

 

Missing an API that will assist you in your integration? Let us know!

If during the development of your integration you are missing an API please let us know at support@dooblo.com and we will make sure our SurveyToGo REST API product team is notified of the request to be reviewed for adding to future versions.

 

Visit us at: http://www.dooblo.net

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

2 comments
  • Is there a way to get SurveyInterviewIDs only for a particular device index? The RESTAPI-TestBed allows filters like projectID, SurveyIDs, Start and End Date, Subject IDs (Why we need a filter on subject Ids if we are fetching the subject Ids?) etc.,.

  • Dear Vishnu,

    Am also waiting for an answer to your query, let me know if you managed to get your way round by having a complete list of survey data for a survey

Please sign in to leave a comment.