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.
Create a score for a specific user against a given metric.
[POST] /scores/createscore
{
"userId": [id]
"metricId": [id]
}
Returns all metrics and the score associated with that metric for a given user.
[GET] /scores/getscores?userId=[id]
Returns the score associated with a given metric id for a given user.
[GET] /scores/getscore?userId=[id]&metricId=[id]
Increases the score associated with a given metric id for a given user.
[GET] /scores/alterscore/increase?userId=[id]&metricId=[id]
Decreases the score associated with a given metric id for a given user.
[GET] /scores/alterscore/decrease?userId=[id]&metricId=[id]
Creates a new metric with a given name
[POST] /metrics/createmetric
{
"name": [metric name]
}
Deletes the metric with the given id
[POST] /metrics/deletemetric
{
"metricId": [metric id]
}