Time Tracking

The API functions for Time Tracking in Papershift



Create a new Time Tracking

Creates a new Time Tracking in your Papershift Account

URL

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

Method

POST

Parameters

ParametersTypeRequired
api_tokenStringrequired
location_idIntegerrequired
location_external_idStringrequired if location_id is not set
working_area_idIntegerrequired
working_area_external_idStringrequired if working_area_id is not set
user_idIntegerrequired
user_external_idStringrequired if user_id is not set
starts_atString (use ISO)required
ends_atString (use ISO)required
manual_pauseInteger (in minutes)optional
external_idStringoptional

Information

Creating Time Tracking requires a valid Location, Working Area
and User within the authorized Enterprise. You either get these through
the External-ID you simply set by yourself or the Record’s ID
from the Database.

Example

{
        "api_token":  "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
        "working_session":    {
                        "location_external_id":     "Company-A",
                        "working_area_external_id": "Area-Alpha",
                        "user_external_id":         "User-001",
                        "starts_at":                "2015-10-31T08:30:00+00:00",
                        "ends_at":                  "2015-10-31T17:30:00+00:00",
                        "manual_pause":             60,
                        "external_id":              "WorkingSession-001"
                      }
      }
function createWorkingSession() {
        var params = {
          "api_token":  "rJkAk7Bzm5uDipfJY9aZtWhHxfsz06oO5ggJyvI7",
          "working_session": {
            "location_external_id":     "Company-A",
            "working_area_external_id": "Area-Alpha",
            "user_external_id":         "User-001",
            "starts_at":                "2015-10-31T08:30:00+00:00",
            "ends_at":                  "2015-10-31T17:30:00+00:00",
            "manual_pause":             60,
            "external_id":              "WorkingSession-001"
          }
        };
  
        $.ajax({
          url: "https://app.papershift.com/public_api/v1/working_sessions",
          type: 'POST',
          dataType: 'json',
          data: JSON.stringify(params),
          complete: function (data) {
            console.log(data.responseText);
          }
        });
      }
{
        "id":                       1491029,
        "starts_at":                "2015-10-31T09:30:00+01:00",
        "ends_at":                  "2015-10-31T18:30:00+01:00",
        "updated_at":               "2015-11-19T19:14:27+00:00",
        "location_id":              8006,
        "employee_id":              1,
        "break_time":               3600
      }



Update an existing Time Tracking

Update an existing Time Tracking in you Papershift Account

URL

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

Method

PUT

Parameters

ParametersTypeRequired
api_tokenStringrequired
idIntegerrequired
external_idStringrequired if id not set
starts_atString (use ISO)required
ends_atString (use ISO)required
manual_pauseInteger (in minutes)optional
working_area_idIntegeroptional
working_area_external_idStringoptional

Information

To update an existing Time Tracking requires finding the specific
record in the Database. This can be achieved via the Time Tracking’s
External-ID or Record-ID.

Example

{
        "api_token":  "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
        "working_session":    {
                        "external_id":              "WorkingSession-001",
                        "starts_at":                "2015-10-31T08:15:00+00:00",
                        "ends_at":                  "2015-10-31T17:45:00+00:00",
                        "manual_pause":             50,
												"working_area_external_id": "Area-Alpha"
                      }
      }
function updateWorkingSession() {
        var params = {
          "api_token": "rJkAk7Bzm5uDipfJY9aZtWhHxfsz06oO5ggJyvI7",
          "working_session": {
            "external_id":  						"WorkingSession-001",
            "starts_at":    						"2015-10-31T08:15:00+00:00",
            "ends_at":      						"2015-10-31T17:45:00+00:00",
            "manual_pause": 						50,
            "working_area_external_id": "Area-Alpha"
          }
        };
  
        $.ajax({
          url: "https://app.papershift.com/public_api/v1/working_sessions",
          type: 'PUT',
          dataType: 'json',
          data: JSON.stringify(params),
          complete: function (data) {
            console.log(data.responseText);
          }
        });
      }
{
        "id":                       1491029,
        "starts_at":                "2015-10-31T09:15:00+01:00",
        "ends_at":                  "2015-10-31T18:45:00+01:00",
        "updated_at":               "2015-11-19T19:23:27+00:00",
        "location_id":              8006,
        "employee_id":              1,
        "break_time":               3000,
        "working_area_id": 					12
      }



Get Time Tracking by ID

Get Time Tracking by its unique ID or external ID

URL

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

Method

GET

Parameters

ParametersTypeRequired
api_tokenstringrequired
idintegerrequired (if external_id not set)
external_idstringrequired (if id not set)

Example

{
    "api_token": "XXXX",
    "id": 17325954
}
{
    "ends_at": "2019-06-10T18:00:00+02:00",
    "id": 17325954,
    "starts_at": "2019-06-10T08:00:00+02:00",
    "updated_at": "2018-09-18T10:46:10+02:00",
    "location_id": 60414,
    "employee_id": 245602,
    "breaks": [
        {
            "ends_at": "2019-06-10T15:54:00+02:00",
            "id": 9420514,
            "starts_at": "2019-06-10T14:54:00+02:00",
            "updated_at": "2018-09-26T17:22:02+02:00",
            "start_signature_id": null,
            "end_signature_id": null,
            "secure_id": "379bf999ea58561cae61f0d120519c27"
        }
    ],
    "break_time": 3600,
    "start_signature_id": null,
    "end_signature_id": null,
    "secure_id": "6312e2c07cc670c79d5567e8c40b6fdb",
    "filters": [
        {
            "id": 67087,
            "title": "Berater",
            "active": true,
            "external_id": null,
            "color": "#6C7A89"
        }
    ]
}



Get Time Tracking in Range

Get existing Time Tracking from your Papershift Account

URL

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

Method

GET

Parameters

ParametersTypeRequired
api_tokenStringrequired
range_startString (use ISO)required
range_endString (use ISO)required
user_idIntegeroptional
user_external_idStringoptional
pageIntegeroptional
tagsString (must contain comma-separated tag IDs and/or zero for Time Tracking without tags)optional
company_idIntegerrequired if ‚tags‘ is specified and ‚company_external_id‘ is not specified
company_external_idStringrequired if ‚tags‘ is specified and ‚company_id‘ is not specified

Information

A Successful Request returns an Array of the n-th 25 Time Tracking
depending on the Page-Param. You can also pass a User’s External- or
Record-ID to only query for Time Tracking of this specific User.

It is possible to pass a list of tag IDs to only query Time Tracking
with tags specified by the given IDs. The list of tags IDs can also
contain a zero to include Time Tracking without any tags. The list of
tag IDs must be a comma-separated string that must contain positive
integers including zero, e.g. ‚3,7,15,0,8‘. When using the ‚tags‘
attribute, ‚company_id‘ or ‚company_external_id‘ must also be specified.

Example

{
        "api_token":                "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
        "range_start":              "2015-10-01",
        "range_end":                "2015-10-31",
        "user_external_id":         "User-001",
        "user_id":                  5,
        "page":                     1
      }
function getWorkingSessions() {
        var api_token = "rJkAk7Bzm5uDipfJY9aZtWhHxfsz06oO5ggJyvI7";
        var range_start = "2015-10-01";
        var range_end = "2015-10-31";
        var page = 1;
  
        $.ajax({
          url: "https://app.papershift.com/public_api/v1/working_sessions?api_token=" + api_token + "&range_start=" + range_start + "&range_end=" + range_end + "&page=" + page,
          type: 'GET',
          dataType: 'json',
          complete: function (data) {
            console.log(data.responseText);
          }
        });
      }
{
        "working_sessions": [
          {
            "id":                       1491029,
            "starts_at":                "2015-10-31T09:15:00+01:00",
            "ends_at":                  "2015-10-31T18:45:00+01:00",
            "updated_at":               "2015-11-19T19:23:27+00:00",
            "location_id":              8006,
            "employee_id":              1,
            "break_time":               3000,
            "confirmed":                false,
            "last_edit_by":	        200178
          }
        ],
        "next_page": "https://app.papershift.com/public_api/v1/working_sessions?api_token=rJkAk7Bzm5uDipfJY9aZtWhHxfsz06oO5ggJyvI7&range_start=2015-10-01&range_end=2015-10-31&page=2
      }



Confirm existing Time Tracking

Confirm an existing Time Tracking in your Papershift Account

URL

https://app.papershift.com/public_api/v1/working_sessions/confirm

Method

PUT

Parameters

ParametersTypeRequired
api_tokenStringrequired
idIntegerrequired
external_idStringrequired if id not set

Information

To confirm an existing Time Tracking requires finding the specific
record in the Database. This can be achieved via the Time Tracking’s
External-ID or Record-ID.

Example

{
    "api_token": "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
    "working_session": {
        "id": "34567"
    }
}
{
    "ends_at": "2019-06-30T17:00:00+02:00",
    "id": 34567,
    "starts_at": "2019-06-30T09:00:00+02:00",
    "updated_at": "2019-07-01T09:57:07+02:00",
    "location_id": 234,
    "employee_id": 987654,
    "breaks": [],
    "break_time": 1800,
    "start_signature_id": null,
    "end_signature_id": null,
    "secure_id": "c3a17ab82e1f1782e1bb599b4550eac0",
    "filters": []
}



Delete an existing Time Tracking

Delete an existing Time Tracking in your Papershift Account

URL

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

Method

DELETE

Parameters

ParametersTypeRequired
api_tokenStringrequired
idIntegerrequired
external_idStringrequired if id not set

Information

To delete an existing Time Tracking requires finding the specific
record in the Database. This can be achieved via the Time Tracking’s
External-ID or Record-ID.

Example

{
        "api_token":  "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
        "working_session":    {
               "external_id": "WorkingSession-001"
                      }
      }
function updateWorkingSession() {
        var params = {
          "api_token":  "rJkAk7Bzm5uDipfJY9aZtWhHxfsz06oO5ggJyvI7",
          "working_session": {
            "external_id":  "WorkingSession-001"
          }
        };
  
        $.ajax({
          url: "https://app.papershift.com/public_api/v1/working_sessions",
          type: 'DELETE',
          dataType: 'json',
          data: JSON.stringify(params),
          complete: function (data) {
            console.log(data.responseText);
          }
        });
      }
Response 200 (application/json)