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
MethodPOST
Parameters
| Parameters | Type | Required |
|---|---|---|
| api_token | String | required |
| location_ids | Integer, comma-separated string for multiple IDs | required |
| location_external_ids | String, comma-separated for multiple external IDs | required if location_ids is not set |
| working_area_ids | Integer, comma-separated string for multiple IDs | optional |
| working_area_external_ids | String, comma-separated for multiple external IDs | optional |
| username | String | required |
| String (valid format, unique) | optional (automatically sends an invitation mail) | |
| abbrev | String | optional |
| initial_time_account | Float | optional |
| salary | Float | optional |
| home_office | Boolean | optional |
| working_sessions_creator | Boolean | optional |
| staff_number | String | optional |
| external_id | String | optional |
| locale | ‚de‘ | ‚en‘ | optional |
| tags | String, comma-separated string for multiple IDs | optional |
| data_profiles | Hash | optional |
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
MethodPUT
Parameters
| Parameters | Type | Required |
|---|---|---|
| api_token | String | required |
| id | Integer | required |
| external_id | String | required if id not set |
| working_area_ids | Integer, comma-separated string for multiple IDs | optional |
| working_area_external_ids | String, comma-separated for multiple external IDs | optional |
| username | String | optional |
| String (valid format, unique) | optional | |
| abbrev | String | optional |
| initial_time_account | Float | optional |
| salary | Float | optional |
| home_office | Boolean | optional |
| working_sessions_creator | Boolean | optional |
| staff_number | String | optional |
| locale | ‚de‘ | ‚en‘ | optional |
| tags | String, comma-separated string for multiple IDs | optional |
| data_profiles | Hash | optional |
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
MethodGET
Parameters
| Parameters | Type | Required |
|---|---|---|
| api_token | string | required |
| id | integer | required |
| external_id | string | required 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
MethodGET
Parameters
| Parameters | Type | Required |
|---|---|---|
| api_token | String | required |
| location_ids | Integer, comma-separated for multiple IDs | optional |
| location_external_ids | String, comma-separated for multiple external IDs | optional |
| working_area_ids | Integer, comma-separated for multiple IDs | optional |
| working_area_external_ids | String, comma-separated for multiple external IDs | optional |
| tags | String, comma-separated string for multiple IDs | optional |
| page | Integer | optional |
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
MethodPATCH
Parameters
| Parameter | Type | Required |
|---|---|---|
| api_token | String | required |
| id | Integer | required |
| external_id | String | required 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
MethodPATCH
Parameters
| Parameter | Type | Required |
|---|---|---|
| api_token | String | required |
| id | Integer | required |
| external_id | String | required 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
MethodDELETE
Parameters
| Parameter | Type | Required |
|---|---|---|
| api_token | String | required |
| id | Integer | required |
| external_id | String | required 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)