Docs

Endpoints

The base URL to send all API requests is https://propensityapp.com/api/.... HTTPS is required for all API requests.

The Propensity API follows RESTful conventions, with operations performed via GET, POST, PATCH, and DELETE requests on page and database resources. Request and response bodies are encoded as JSON.

Scores

Create a score

Create a score for a specific user against a given metric.

[POST] /scores/createscore

{
 "userId": [id]
 "metricId": [id]
}

Get all scores

Returns all metrics and the score associated with that metric for a given user.

[GET] /scores/getscores?userId=[id]

Get a score

Returns the score associated with a given metric id for a given user.

[GET] /scores/getscore?userId=[id]&metricId=[id]

Increase score

Increases the score associated with a given metric id for a given user.

[GET] /scores/alterscore/increase?userId=[id]&metricId=[id]

Decrease score

Decreases the score associated with a given metric id for a given user.

[GET] /scores/alterscore/decrease?userId=[id]&metricId=[id]

Metrics

Create a metric

Creates a new metric with a given name

[POST] /metrics/createmetric

{
 "name": [metric name]
}

Delete a metric

Deletes the metric with the given id

[POST] /metrics/deletemetric

{
 "metricId": [metric id]
}