Usage


The usage API allows you to view the number of submissions made by each user in a month. These can be further broken down by project and survey.

To use these functions you will need "admin" privilege

Methods

URL Request Type / Format Description Version Example
/surveyKPI/adminreport/usage/ {year}/ {month} GET / Excel File The number of submissions in the specified month by user 18.10+ https://sg.smap.com.au/surveyKPI/adminreport/usage/2018/1

Parameters

Parameter Description Version Example
year Specify the year of the data to be retrieved (required) 18.10+ https://sg.smap.com.au/surveyKPI/adminreport/usage/2018/1
month Specify the month of the data to be retrieved (required). Must be between 1 and 12 inclusive. 18.10+ https://sg.smap.com.au/surveyKPI/adminreport/usage/2018/1
project=true Show usage by project as well as user 18.10+ https://sg.smap.com.au/surveyKPI/adminreport/usage/2018/1?project=true
survey=true Show usage by survey as well as project and user 18.10+ https://sg.smap.com.au/surveyKPI/adminreport/usage/2018/1?survey=true

Resources


Resources are files used by forms. The following types of resources can be managed through the API:

  1. Media: For example a CSV file that contains choices or a photograph that is used to illustrate a choice in a select one question.

Media

Service Request Type / Format Description Version Example
/surveyKPI/upload/media GET JSON Get a list of the media available in the users current organisation. The response includes URLs to:
  • download the file
  • download a thumb nail
  • delete the file
17.10+ https://sg.smap.com.au/surveyKPI/upload/media
/surveyKPI/upload/media POST Upload a new file to the organisation. 17.10+ curl -u xxxx -i -X POST -H "Content-Type: multipart/form-data" -F "data=@phone.jpg" https://sg.smap.com.au/surveyKPI/upload/media

Parameters

Parameter Description Version Example
survey_id Retrieve a list of files or upload media only for the survey with specified id. You can also use the form field survey_id when posting media. 17.10+ https://sg.smap.com.au/surveyKPI/upload/media?survey_id=1778

Task List


Service Format Description Version Example
/api/v1/tasks JSON Get a list of tasks 16.03+ https://sg.smap.com.au/api/v1/tasks

Parameters

Filter Description Version Example
user The user id. (optional) 16.03+ https://sg.smap.com.au/api/v1/tasks/stats?x=scheduled&group=status&user=2

Task Statistics


This service is a Smap specific extension to the kobo api

Service Format Description Version Example
/api/v1/tasks/stats JSON Get statistics on tasks. In version 16.03 and below of the Smap server this only returns data on tasks that have been assigned to a user. 16.03+ https://sg.smap.com.au/api/v1/tasks/stats?x=scheduled&group=status

Filters

Filter Description Version Example
x X axis value. (Required) Alternatives:
  • scheduled
16.03+ https://sg.smap.com.au/api/v1/tasks/stats?x=scheduled&group=status
group Group results by this parameter. (Required) Alternatives:
  • status
16.03+ https://sg.smap.com.au/api/v1/tasks/stats?x=scheduled&group=status
user The user id. (optional) 16.03+ https://sg.smap.com.au/api/v1/tasks/stats?x=scheduled&group=status&user=2
period Group results by this time interval. (Optional) Alternatives:
  • day
  • month
  • year
  • week
16.03+ https://sg.smap.com.au/api/v1/tasks/stats?x=scheduled&group=status&period=month