GetFeedback

Request Data using Public API

GetFeedback for Apps Campaigns let you survey your users from an Android or iOS app. After creating your Campaign, you’ll be able to analyze incoming feedback items through your GetFeedback Digital account or our public API.

This article is written for developers who want to request data using our public API. Before reading this article, we recommend you read our public API documentation.

The request URL for GetFeedback Digital for Apps Campaign data is:

The parameters below can be added to the query string of the request URL:

FieldTypeDescription
limitIntegerOptional URL query parameter that limits the number of retrieved results between 1 and 100. Defaults to 100 when omitted.
sinceTimestamp[Optional] UTC Timestamp (in milliseconds) URL query parameter used to retrieve items of which creation date is after the supplied value.

https://data.usabilla.com/live/apps/campaign?limit=1&since=1500336000

Success 200

FieldTypeDescription
idStringUnique identifier for a campaign.
createdAtDateThe creation date of the campaign, in UTC. The format being used is %Y-%m-%dT%H:%M:%S.%fZ as defined in ISO 8601.
lastModifiedAtDateThe date the campaign was last modified, in UTC. The format being used is %Y-%m-%dT%H:%M:%S.%fZ as defined in ISO 8601.
statusStringThe status of the campaign. Possible values are active or inactive.
nameStringThe name of the campaign given when created. Can be updated in the campaign setup page.
appIdsArrayAn array containing the IDs of the mobile apps where the campaign is running.

Image of what a sample success response would look like

Campaign Results returns the responses of one or all your Usabilla for Apps campaigns.

https://data.usabilla.com/live/apps/campaign/<id>/results

FieldTypeDescription
idStringThe campaign id. Use * (asterisk) to request feedback of all campaigns.
limitIntegerOptional URL query parameter that limits the number of retrieved results between 1 and 100. Defaults to 100 when omitted.
sinceTimestamp[Optional] UTC Timestamp (in milliseconds) URL query parameter used to retrieve items of which creation date is after the supplied value.
Image showing code example for campaign request

Success 200

FieldTypeDescription
idStringUnique identifier for a campaign response.
dateDateThe date when the campaign response was received by the GetFeedback Digital server, in UTC. The format being used is %Y-%m-%dT%H:%M:%S.%fZ as defined in ISO 8601.
campaignIdStringUnique identifier of the campaign the response belongs to.
appIdStringUnique identifier of the mobile app through which the response was received.
dataArrayAn array containing the values of the answers to the campaign’s questions.
contextArrayCustom variables that are provided by the mobile app.
metadataArrayAn array containing the metadata of the user’s device and its configuration.
app_nameStringName of the mobile app.
app_versionStringVersion of the mobile app.
batteryFloatNumber from 0-1 that represents the percentage of battery of the user’s device.
deviceStringDevice name on which the mobile app is running.
languageStringActive system language of the user’s device followed by the region.
network_connectionStringType of internet connection of the user’s device when the response was submitted
orientationStringThe orientation of the screen when the response was submitted (‘Portrait’ or ‘Landscape’).
os_versionStringOperating System version running on the user’s device.
screenStringScreen resolution of the user’s device
sdk_versionStringThe version of the GetFeedback Digital SDK running in the mobile app.
systemStringOperating System running on the user’s device
timestampStringDate and time (Unix timestamp) when the response was created in the mobile app.
completeBooleanWhether the user has fully progressed throughout the campaign.
Image of sample successful response

Before trying to make an API call, we need to make sure Python is installed on your computer. Some computers have Python pre-installed.
Open Terminal on your computer and type python

Screenshot of python. Adding in Python 2.7.10.

Based on the output above, we can see that Python 2.7 is installed. If you have version 2.7 (or 2.7.x), you can continue to step 2!

If not, we will have to install Python 2.7:
Navigate to www.python.org/downloads. Click the download link for version 2.7 and follow the installation instructions. After installing python, open your Terminal and type the command python again. The Python interpreter should now show the version number.

Now, let’s create a Python file to test your setup.

  1. Create a working folder where you can store your Python code.
  2. Open Visual Studio Code (or your editor of choice) and create a new file
  3. In the Visual Studio Code editor, type print(“Hello World!”)
  4. Save the file as test.py in your Python folder.
  5. Open Terminal and move into the folder where we saved our Python test file
    • Note: You can move from one directory to another one by typing cd followed by the path to move into the specific folder: cd full_path
  6. Execute the Python file by typing: python test.py
  7. If everything has been set up correctly you should get Hello World! printed out in your terminal output:
Screenshot of python code test

Now that you have Python installed, it’s time to install the GetFeedback Digital python library on your computer.

  1. Open Terminal
  2. Install pip on by running easy_install pip
  3. Type pip install usabilla-api

To get you started making API calls to our servers, let’s walk through an example of how you can retrieve all GetFeedback Digital buttons from your account

1. Start by creating a file in your Python folder which we will name getAllButtons.py

2. In the code editor, paste this code into your file:

Image showing the code for get all buttons digital API call

3. Change the access key and secret key and then save the file.

4. Open Terminal and move into the Python folder by using cd

5. Once you’re in your python folder with the getAllButtons.py file, you can execute it from the Terminal by typing: python getAllButtons.py in the Terminal window.