Target Hours

The API- functions for target hours in Papershift



Get Target Hours

Get existing target hours from your Papershift account

URL

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

Method

GET

Parameters

ParameterTypeRequiered
api_tokenStringrequired
user_idIntegerrequired
user_external_idStringrequired if user_id not set
start_dateStringoptional
end_dateStringoptional
pageIntegeroptional

Information

A successful request returns all target hour entries associated with the provided date filter inputs.

Example

{
        "api_token" : "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK",
        "user_id": 1,
      	"start_date": "2017-01-01",
      	"end_date": "2017-12-31",
      	"page": 2
      }
function getTargetHours() {
  $.ajax({
    url: "https://app.papershift.com/public_api/v1/target_hours?api_token=6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK&user_id=1&start_date=2017-01-01&end_date=2017-12-31&page=2",
    type: 'GET',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
    "target_hours": [
        {
            "id": 1237177,
            "rhythm_type": "weekly",
            "start_date": "2017-01-22",
            "end_date": null,
            "is_week": true,
            "is_month": false,
            "is_mon": true,
            "mon": 7.2,
            "is_tue": true,
            "tue": 7.2,
            "is_wed": true,
            "wed": 7.2,
            "is_thu": true,
            "thu": 7.2,
            "is_fri": true,
            "fri": 7.2,
            "is_sat": false,
            "sat": 0.0,
            "is_sun": false,
            "sun": 0.0,
            "per_day": false,
            "week": 36.0,
            "month": 0.0,
            "created_at": "2017-01-05T14:55:51Z",
            "updated_at": "2017-01-05T14:55:51Z",
            "regard_holidays": true,
            "target_limited": false,
            "status": "success",
            "updated_by_id": 1129410
        },
        {
            "id": 1237175,
            "rhythm_type": "weekly",
            "start_date": "2017-01-11",
            "end_date": "2017-01-21",
            "is_week": true,
            "is_month": false,
            "is_mon": true,
            "mon": 8.0,
            "is_tue": true,
            "tue": 8.0,
            "is_wed": true,
            "wed": 8.0,
            "is_thu": true,
            "thu": 8.0,
            "is_fri": true,
            "fri": 8.0,
            "is_sat": false,
            "sat": 0.0,
            "is_sun": false,
            "sun": 0.0,
            "per_day": false,
            "week": 40.0,
            "month": 0.0,
            "created_at": "2017-01-05T14:49:18Z",
            "updated_at": "2017-01-05T14:49:18Z",
            "regard_holidays": true,
            "target_limited": false,
            "status": "success",
            "updated_by_id": null
        }
    ],
    "page_number": 1,
    "total_pages": 1,
    "next_page": null
}