Skip to content

API Callout Examples

yuenmichelle1 edited this page Jul 28, 2023 · 23 revisions

Querying Comments Stats (/comments)

Querying Comment counts based on provided params.

Authentication

None

URL

GET /comments

Request Parameters

Parameter Type Description Required?
project_id integer (or integers separated by , if querying for multiple project_id/s) ID/s of a Panoptes project No
user_id integer (or integers separated by , if querying for multiple project_id/s) ID/s of a Panoptes User No
start_date string of Date Format Starting date of comments you want to query from No
end_date string of Date Format Ending date range of comments you want to query from No
period string (either day, week, month, year) Time Bucket on how you want to bucket response data No

Example Request/s

## query to get count of all comments of all time
GET https://eras-staging.zooniverse.org/comments 

## query to get count of all comments relating to Project with id 1
GET https://eras-staging.zooniverse.org/comments?project_id=1

## query to get count of all comments relating to Projects with ids 1 or 2
GET https://eras-staging.zooniverse.org/comments?project_id=1,2  

## query to get count of all comments created by User with id 1
GET https://eras-staging.zooniverse.org/comments?user_id=1

## query to get count of all comments of all time bucketed by week 
GET https://eras-staging.zooniverse.org/comments?period=week

## query to get count of all comments relating to Project with id 1 and created by User with id 1  
GET https://eras-staging.zooniverse.org/comments?project_id=1&user_id=1

Response Parameters

Parameter Type Description
total_count integer Total count of comments given request parameters
data array Only returned when period is a request parameter. This shows the breakdown of comments bucketed by period that make up the response's total_count

Example Response/s

{
	"total_count": 4123
}
  • When period is a request param
{
	"total_count": 4123,
	"data": [
		{
                       "period": "2023-05-27T00:00:00Z",
			"count": 4000,
                 },
		{
			"period": "2023-05-28T00:00:00Z",
			"count": 123
                }
	]
}

/classifications

/classifications/users/:id

/classifications/user_groups/:id

Overview

Home
User Groups Stats Visibility Levels
Data Tables
Mappings from Source Tables to ERAS
Continuous Aggregates
Decisions Around Session Time Caps

API Documentation

Routes and Params
Examples
Troubleshooting

Clone this wiki locally