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:
- 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:
|
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 | GeoJSON | Get a list of tasks | 19.03+ | https://sg.smap.com.au/api/v1/tasks |
Parameters
| Filter | Description | Version | Example |
|---|---|---|---|
| user | The user ident. If the ident is not specified then tasks for all users are returned. You can set the ident to "_unassigned" to only get tasks that have not been assigned to a user. | 19.03+ | https://sg.smap.com.au/api/v1/tasks?user=_unassigned |
| tg_id | The task group id. If the id is not specified then tasks for all task groups are returned. | 19.03+ | https://sg.smap.com.au/api/v1/tasks?tg_id=112 |
| period | Restrict tasks to those scheduled within a recent period. If the period is not set then "all" is assumed and all tasks and no period restriction is set. Other period values are "week" (default) and "month" which will return tasks scheduled moer recently than a week / month ago. This includes tasks scheduled for the future. | 19.03+ | https://sg.smap.com.au/api/v1/tasks?period=month |
| start | The first task to get. You should probably be using the default ordering by increasing task id when using this option. | 19.03+ | https://sg.smap.com.au/api/v1/tasks?user=tom&start=121 |
| limit | The number of records to return | 19.03+ | https://sg.smap.com.au/api/v1/tasks?start=12&limit=10 |
| sort | The property to sort on. This can be "id" the task id(default) or "scheduled", the scheduled time of the task | 19.03+ | https://sg.smap.com.au/api/v1/tasks?sort=scheduled |
| dirn | The direction of sort. This can be "asc" (default) or "desc" | 19.03+ | https://sg.smap.com.au/api/v1/tasks?sort=scheduled&dirn=asc |
| tz | Timezone | 19.03+ | https://sg.smap.com.au/api/v1/tasks?tz=Australia/Brisbane |