Users

The API functions for Users in Papershift

Create a new User

Create a new user in your Papershift account

URL

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

Method

POST

Parameters

ParametersTypeRequired
api_tokenStringrequired
location_idsInteger, comma-separated string for multiple IDsrequired
location_external_idsString, comma-separated for multiple external IDsrequired if location_ids is not set
working_area_idsInteger, comma-separated string for multiple IDsoptional
working_area_external_idsString, comma-separated for multiple external IDsoptional
usernameStringrequired
emailString (valid format, unique)optional (automatically sends an invitation mail)
abbrevStringoptional
initial_time_accountFloatoptional
salaryFloatoptional
home_officeBooleanoptional
working_sessions_creatorBooleanoptional
staff_numberStringoptional
external_idStringoptional
locale‚de‘ | ‚en‘optional
tagsString, comma-separated string for multiple IDsoptional
data_profilesHashoptional

Information

Provide one or more valid locations and, optionally, one or more working areas within the authorized Enterprise. Use either an external ID that you assigned or the record ID from the database.

Examples

{
  "api_token": "XXXX",
  "user": {
    "location_ids": "1",
    "working_area_ids": "2,3",
    "username": "User 1",
    "tags": "1,2,3",
    "locale": "de",
    "home_office": true,
    "salary": "11.9",
    "email": "[email protected]",
    "data_profiles": {
      "birthday": "1980-06-20",
      "desc": "Sample description"
    }
  }
}
function createUser() {
  var params = {
    "api_token": "XXXX",
    "user": {
      "location_ids": "1",
      "working_area_ids": "2,3",
      "username": "User 1",
      "tags": "1,2,3",
      "locale": "de",
      "home_office": true,
      "salary": "11.9",
      "email": "[email protected]",
      "data_profiles": {
        "birthday": "1980-06-20",
        "desc": "Sample description"
      }
    }
  };

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/users",
    type: 'POST',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
  "id": 115,
  "abbrev": null,
  "email": "[email protected]",
  "external_id": null,
  "home_office": true,
  "initial_time_account": 0,
  "locale": "de",
  "salary": 11.9,
  "staff_number": null,
  "username": "User 1",
  "working_sessions_creator": false,
  "enterprise_id": 1,
  "location_ids": [1],
  "working_area_ids": [2, 3],
  "tags": [3, 2, 1],
  "data_profiles": {
    "birthday": {
      "label": "Geburtstag",
      "value": "1980-06-20"
    }
  }
}

Update an existing User

Update an existing user in your Papershift account

URL

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

Method

PUT

Parameters

ParametersTypeRequired
api_tokenStringrequired
idIntegerrequired
external_idStringrequired if id not set
working_area_idsInteger, comma-separated string for multiple IDsoptional
working_area_external_idsString, comma-separated for multiple external IDsoptional
usernameStringoptional
emailString (valid format, unique)optional
abbrevStringoptional
initial_time_accountFloatoptional
salaryFloatoptional
home_officeBooleanoptional
working_sessions_creatorBooleanoptional
staff_numberStringoptional
locale‚de‘ | ‚en‘optional
tagsString, comma-separated string for multiple IDsoptional
data_profilesHashoptional

Information

To update an existing user, identify the record by the user’s external ID or record ID.

Examples

{
  "api_token": "XXXX",
  "user": {
    "id": 112,
    "working_area_ids": "7,3",
    "tags": "1,2",
    "home_office": false,
    "salary": 23,
    "username": "User 2",
    "email": "[email protected]",
    "data_profiles": {
      "birthday": "1980-06-20",
      "desc": "Sample description"
    }
  }
}
function updateUser() {
  var params = {
    "api_token": "XXXX",
    "user": {
      "id": 112,
      "working_area_ids": "7,3",
      "tags": "1,2",
      "home_office": false,
      "salary": 23,
      "username": "User 2",
      "email": "[email protected]",
      "data_profiles": {
        "birthday": "1980-06-20",
        "desc": "Sample description"
      }
    }
  };

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/users",
    type: 'PUT',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
  "abbrev": null,
  "desc": null,
  "email": "[email protected]",
  "external_id": null,
  "home_office": false,
  "id": 112,
  "initial_time_account": 0,
  "locale": "de",
  "salary": 23,
  "staff_number": null,
  "username": "User 2",
  "working_sessions_creator": false,
  "enterprise_id": 1,
  "location_ids": [1],
  "working_area_ids": [7, 3],
  "tags": [2, 1],
  "data_profiles": {
    "birthday": {
      "label": "Geburtstag",
      "value": "1980-06-20"
    }
  }
}

Get User by ID

Get a user by their unique ID or external ID

URL

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

Method

GET

Parameters

ParametersTypeRequired
api_tokenstringrequired
idintegerrequired
external_idstringrequired if id is not set

Examples

{
    "api_token": "XXXX",
    "id": 327066
}
function getUserById() {
  var api_token = "XXXX";
  var id = 327066;

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/users?api_token=" + api_token + "&id=" + id,
    type: 'GET',
    dataType: 'json',
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
    "abbrev": "cc",
    "email": "[email protected]",
    "external_id": "user_42",
    "home_office": true,
    "id": 327066,
    "initial_time_account": 0,
    "locale": null,
    "salary": 0,
    "staff_number": null,
    "status": "active",
    "username": "Carol",
    "working_sessions_creator": false,
    "enterprise_id": 39246,
    "location_ids": [
        72214
    ],
    "working_area_ids": [
        164359,
        159948,
        159949,
        159950
    ],
    "tags": [],
    "data_profiles": {
        "birthday": {
            "label": "Geburtstag",
            "value": "1994-02-14"
        }
    }
}

Get Users

Get user(s) from your Papershift account

URL

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

Method

GET

Parameters

ParametersTypeRequired
api_tokenStringrequired
location_idsInteger, comma-separated for multiple IDsoptional
location_external_idsString, comma-separated for multiple external IDsoptional
working_area_idsInteger, comma-separated for multiple IDsoptional
working_area_external_idsString, comma-separated for multiple external IDsoptional
tagsString, comma-separated string for multiple IDsoptional
pageIntegeroptional

Information

A successful request returns up to 25 users for the requested page. Pass one or more working area external IDs or record IDs to return only users in those working areas. Pass one or more location external IDs or record IDs to return only users in those locations.

Pass a comma-separated list of tag IDs to return only users with those tags. Include 0 in the list to include users without tags. The list must contain only positive integers and zero, for example 3,7,15,0,8.

Examples

{
  "api_token": "XXXX",

  "location_external_ids": "AAA,BBB",
  "working_area_external_ids": "XYZ1,XYZ2",
  "tags": "35,67,158",
  "page": 2
}
function getUsers() {
  var api_token = "XXXX";
  var location_external_ids = "AAA,BBB";
  var working_area_external_ids = "XYZ1,XYZ2";
  var tags = "35,67,158";
  var page = 2

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/users?api_token=" + api_token + "&location_external_ids=" + location_external_ids + "&working_area_external_ids=" + working_area_external_ids + "&tags=" + tags + "&page=" + page,
    type: 'GET',
    dataType: 'json',
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
  "users": [
    {
      "abbrev": "",
      "email": "[email protected]",
      "external_id": null,
      "home_office": false,
      "id": 1,
      "initial_time_account": 0,
      "locale": "",
      "salary": 0,
      "staff_number": "",
      "username": "User 10",
      "working_sessions_creator": false,
      "enterprise_id": 371,
      "location_ids": [55, 98],
      "working_area_ids": [235, 375],
      "tags": [35, 67, 158],
      "data_profiles": {
        "birthday": {
          "label": "Geburtstag",
          "value": null
        }
      }
    },
    {
      "abbrev": null,
      "email": "",
      "external_id": null,
      "home_office": false,
      "id": 4,
      "initial_time_account": 0,
      "locale": null,
      "salary": 0,
      "staff_number": null,
      "username": "User 25",
      "working_sessions_creator": false,
      "enterprise_id": 371,
      "location_ids": [55, 98],
      "working_area_ids": [235, 375],
      "tags": [35, 67, 158],
      "data_profiles": {
        "birthday": {
          "label": "Geburtstag",
          "value": "1980-06-20"
        }
      }
    }
  ],
  "next_page": "http://app.papershift.com/public_api/v1/users?api_token=XXXX&location_external_ids=AAA,BBB&page=3&working_area_external_ids=XYZ1,XYZ2&tags=35,67,158"
}

Activate a User

Activate an existing user in your Papershift account

URL

https://app.papershift.com/public_api/v1/users/activate

Method

PATCH

Parameters

ParameterTypeRequired
api_tokenStringrequired
idIntegerrequired
external_idStringrequired if id not set

Information

To activate an existing user, identify the record by the user’s external ID or record ID.

Examples

{
  "api_token": "XXXX",
  "user": {
    "id": 145
  }
}
function activateUser() {
  var params = {
    "api_token": "XXXX",
    "user": {
      "id": 145
    }
  };

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/users/activate",
    type: 'PATCH',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
Response 200 (application/json)

Deactivate a User

Deactivate an existing user in your Papershift account

URL

https://app.papershift.com/public_api/v1/users/deactivate

Method

PATCH

Parameters

ParameterTypeRequired
api_tokenStringrequired
idIntegerrequired
external_idStringrequired if id not set

Information

To deactivate an existing user, identify the record by the user’s external ID or record ID.

Examples

{
  "api_token": "XXXX",
  "user": {
    "id": 145
  }
}
function deactivateUser() {
  var params = {
    "api_token": "XXXX",
    "user": {
      "id": 145
    }
  };

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/users/deactivate",
    type: 'PATCH',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
Response 200 (application/json)

Delete an existing User

Delete an existing user in your Papershift account

URL

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

Method

DELETE

Parameters

ParameterTypeRequired
api_tokenStringrequired
idIntegerrequired
external_idStringrequired if id not set

Information

To delete an existing user, identify the record by the user’s external ID or record ID.

Examples

{
  "api_token": "XXXX",
  "user": {
    "id": 145
  }
}
function deleteUser() {
  var params = {
    "api_token": "XXXX",
    "user": {
      "id": 145
    }
  };

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/users",
    type: 'DELETE',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
Response 200 (application/json)