Skip to main content
POST
/
api
/
admin
/
histories
/
charts
/
weekly
Get weekly chart data for admin histories
curl --request POST \
  --url https://pria.praxislxp.com/api/admin/histories/charts/weekly \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "institution": "65cfebc32f5e1b37d4e52329",
  "granularity": "month",
  "range": -3,
  "dimension": "count",
  "aggregate": false
}'
{
  "success": true,
  "data": [
    {
      "_id": {
        "granularity": "2023-11-07T05:31:56Z",
        "institution": "<string>"
      },
      "dimension": 123
    }
  ]
}

Authorizations

Authorization
string
header
required

JWT token passed in x-access-token header

Body

application/json
institution
string
required

Institution ID

Example:

"65cfebc32f5e1b37d4e52329"

granularity
enum<string>
required

Time granularity for the chart data

Available options:
day,
week,
month,
year
Example:

"month"

range
integer
required

Time range (negative values for past periods)

Example:

-3

dimension
enum<string>
required

Data dimension to measure

Available options:
count,
sum,
average
Example:

"count"

aggregate
boolean
required

Whether to aggregate the data

Example:

false

Response

Successfully retrieved chart data

success
boolean

Indicates if the request was successful

data
object[]

Array of chart data points