Evaluations

The API-Functions for Evaluations on Papershift



Get Evaluations

Get existing evaluations from your Papershift account

URL

https://app.papershift.com/public_api/v1/evaluations

Method

GET

Parameters

ParameterTypeRequiered
api_tokenStringrequired
user_idIntegerrequired
user_external_idStringrequired if user_id not set
range_startStringrequired
range_endStringoptional
pageIntegeroptional

Information

A successful request returns an array of the n-th 25 evaluations
depending on the page param.

If range_end is not specified in the request it will be set to today by default.

Example

{
        "api_token" : "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK",
        "user_id": 1,
      	"range_start": "2017-01-01",
      	"range_end": "2017-12-31",
      	"page": 2
      }
function getEvaluations() {
  $.ajax({
    url: "https://app.papershift.com/public_api/v1/evaluations?api_token=6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK&user_id=1&range_start=2017-01-01&range_end=2017-12-31&page=2",
    type: 'GET',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
  "evaluations": [
    {
      "actual": 0,
      "charged": 0,
      "compensation": 0,
      "created_at": "2016-08-19T20:54:33+02:00",
      "day": "2017-01-01",
      "id": 179300,
      "payout": 0,
      "plan": 0,
      "target": 0,
      "updated_at": "2016-08-19T20:54:33+02:00",
      "user_id": 1255,
      "vacation": 0,
      "vacation_source_id": null,
      "vacation_source_type": null
    },
    {
      "actual": 0,
      "charged": 0,
      "compensation": 0,
      "created_at": "2016-08-19T20:54:33+02:00",
      "day": "2017-01-02",
      "id": 179301,
      "payout": 0,
      "plan": 0,
      "target": 8,
      "updated_at": "2016-10-22T14:40:41+02:00",
      "user_id": 1255,
      "vacation": 0,
      "vacation_source_id": null,
      "vacation_source_type": null
    }
  ]
}



Get Evaluation by ID

Get evaluation by its unique ID

URL

https://app.papershift.com/public_api/v1/evaluations

Method

GET

Parameters

ParametersTypeRequired
api_tokenstringrequired
idintegerrequired

Example

{
    "api_token": "XXXX",
    "id": 130119909
}
{
    "absent_balance": 0,
    "absent_calc": 0,
    "active": true,
    "actual": 14.5,
    "charged": null,
    "compensation": 0,
    "created_at": "2019-06-04T15:52:38+02:00",
    "data": {
        "plan": 14.5,
        "actual": 14.5,
        "payout": 0,
        "target": 8,
        "charged": null,
        "absences": [
            {
                "type": null,
                "source_id": null,
                "hours_real": 0,
                "hours_balance": 0
            }
        ],
        "compensation": 0
    },
    "day": "2019-07-02",
    "id": 130119909,
    "payout": 0,
    "plan": 14.5,
    "target": 8,
    "updated_at": "2019-07-10T14:32:18+02:00",
    "user_id": 327066,
    "vacation_source_id": null,
    "vacation_source_type": null
}



Create a new Evaluation

Create a new evaluation in your Papershift account

URL

https://app.papershift.com/public_api/v1/evaluations

Method

POST

Parameters

ParameterTypeRequired
api_tokenStringrequired
user_idIntegerrequired
user_external_idStringrequired if user_id is not set
dayStringrequired
actualFloatoptional
planFloatoptional
targetFloatoptional
compensationFloatoptional

Information

A successful request returns the newly created evaluation as JSON.

Example

{
  "api_token": "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK",
  "evaluation": {
    "user_id": 1255,
    "day": "2018-10-16",
    "actual": 12,
    "plan": 8
  }
}
function createEvaluation() {
  var params = {
    {
      "api_token": "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK",
      "evaluation": {
        "user_id": 1255,
        "day": "2018-10-16",
        "actual": 12,
        "plan": 8
      }
    }
  };

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/evaluations",
    type: 'POST',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
    "actual": 12,
    "charged": null,
    "compensation": 0,
    "created_at": "2017-10-02T13:54:25+02:00",
    "day": "2021-10-12",
    "id": 1801403,
    "payout": 0,
    "plan": 8,
    "target": 0,
    "updated_at": "2017-10-02T13:54:25+02:00",
    "user_id": 1255,
    "vacation": 0,
    "vacation_source_id": null,
    "vacation_source_type": null
}



Update an existing Evaluation

Update an existing evaluation in your Papershift account

URL

https://app.papershift.com/public_api/v1/evaluations

Method

PUT

Parameters

ParameterTypeRequired
api_tokenStringrequired
idIntegerrequired
user_idIntegerrequired if evaluation_id is not set
user_external_idStringrequired if user_id is not set
dayStringrequired if evaluation_id is not set
actualFloatoptional
planFloatoptional
targetFloatoptional
compensationFloatoptional

Information

A successful request returns the updated created evaluation as JSON.

Example

{
  "api_token": "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK",
  "evaluation": {
    "user_id": 1255,
    "day": "2018-10-16",
    "actual": 12,
    "plan": 9
  }
}
function updateEvaluation() {
  var params = {
    {
      "api_token": "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK",
      "evaluation": {
        "user_id": 1255,
        "day": "2018-10-16",
        "actual": 12,
        "plan": 9
      }
    }
  };

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/evaluations",
    type: 'PUT',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
    "actual": 12,
    "charged": null,
    "compensation": 0,
    "created_at": "2017-10-02T13:54:25+02:00",
    "day": "2021-10-12",
    "id": 1801403,
    "payout": 0,
    "plan": 9,
    "target": 0,
    "updated_at": "2017-10-02T13:54:25+02:00",
    "user_id": 1255,
    "vacation": 0,
    "vacation_source_id": null,
    "vacation_source_type": null
}