The DataScope API allows you to access the data and functionalities of our platform programmatically. With it, you can automate tasks, integrate with other applications, and make the most of DataScope's capabilities.
Before you begin, make sure you have the following:
API Key: You will need a valid API key to authenticate your requests. You can obtain it from your DataScope account.
API testing tool: This could be Postman, cURL, or any other tool of your choice.
Basic knowledge of HTTP: It’s helpful to have a basic understanding of how HTTP requests and responses work.
Step 1: Obtain Your API Key
To connect to the DataScope API, you first need an API key. Follow these steps to obtain it:
Log in to your DataScope account.
Navigate to the Integrations section.
Look for the "API Key" option.
Copy the generated API key and save it in a secure place.
Step 2: Make a Test Request
Now that you have your API key, you can make a test request to ensure everything is set up correctly.
If everything is configured properly, you should receive a JSON response with the requested data.
Example with Postman
Open Postman: If you don’t have Postman, download and install it from here.
Create a New Request.
Configure the Request: for example
https://www.mydatascope.com/api/external/v4/answers?token=[id token]&form_id=[formid]
Send the Request:
Click the "Send" button to send the request.
Review the response in the lower panel. You should see the data in JSON format if the request is successful.
Step 3: Integrate with Your Application
To integrate the DataScope API into your application, you can use any programming language that supports HTTP requests, such as Python, JavaScript (Node.js).
Step 4: Error Handling
It is important to handle potential errors that may occur when interacting with the API. Be sure to review the response status code and handle errors appropriately. Here are some common status codes:
200 OK: The request was successful.
400 Bad Request: The request is incorrect or malformed.
401 Unauthorized: Authentication failed. Verify your API key.
403 Forbidden: You do not have permission to access this resource.
404 Not Found: The requested resource does not exist.
Frequently Asked Questions
How do I obtain the form ID number?
You need to go to the form you want to link and obtain the ID.
ID: The Form ID can be found in the Configure > Configure App section of your form as shown in the image below:
*In this example, the Form ID is 490254.
In this case, for example, the link would be:
https://www.mydatascope.com/api/external/v2/answers?token=b1cd93mfls9fdmfkadn23&form_id=490254
This way, you will get all the forms completed in the last 7 days for the form ID 490254, or you can add parameters to extend the date range or other specific parameters you can find in the documentation.
Connecting to the DataScope API is a straightforward process that allows you to make the most of our platform’s functionalities
----------------------------------------------------------------------------------------
Related Articles
----------------------------------------------------------------------------------------