Working Areas
The API functions for working areas in Papershift
Create a new Working Area
Creates a new working area in your Papershift account
URLhttps://app.papershift.com/public_api/v1/working_areas
MethodPOST
Parameters| Parameter | Type | Required |
|---|---|---|
| api_token | String | required |
| location_id | Integer | required |
| location_external_id | String | required if location_id is not set |
| name | String | required |
| color | String | optional |
| external_id | String | optional |
Creating working areas requires a valid location 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.
{
"api_token": "XXXX",
"location_id": 1,
"working_area": {
"name": "1st Area"
}
}function createWorkingArea() {
var params = {
"api_token": "XXXX",
"location_id": 1,
"working_area": {
"name": "1st Area"
}
};
$.ajax({
url: "https://app.papershift.com/public_api/v1/working_areas",
type: 'POST',
dataType: 'json',
data: JSON.stringify(params),
complete: function (data) {
console.log(data.responseText);
}
});
}{
"color": null,
"company_id": 1,
"created_at": "2018-02-21T13:33:24Z",
"external_id": null,
"id": 107930,
"name": "1st Area",
"status": "active",
"updated_at": "2018-02-21T13:33:24Z"
}Update a Working Area
Update an existing working area in your Papershift account
URLhttps://app.papershift.com/public_api/v1/working_areas
MethodPUT
Parameters| Parameter | Type | Required |
|---|---|---|
| api_token | String | required |
| location_id | integer | required |
| location_external_id | String | required if location_id is not set |
| name | String | required |
| color | String | optional |
Updating an existing working area requires finding the specific record
in the database. This can be achieved via the working area's external ID
or record ID.
{
"api_token": "XXXX",
"location_id": 1,
"working_area": {
"name": "Colored Area",
"color": "#1abc9c"
}
}function updateWorkingArea() {
var params = {
"api_token": "XXXX",
"location_id": 1,
"working_area": {
"name": "Colored Area",
"color": "#1abc9c"
}
};
$.ajax({
url: "https://app.papershift.com/public_api/v1/working_areas",
type: 'PUT',
dataType: 'json',
data: JSON.stringify(params),
complete: function (data) {
console.log(data.responseText);
}
});
}{
"color": "#1abc9c",
"company_id": 1,
"created_at": "2018-02-21T13:33:24Z",
"external_id": null,
"id": 107930,
"name": "Colored Area",
"status": "active",
"updated_at": "2018-02-21T13:35:24Z"
}Get Working Area by ID
Get working area by its unique ID or external ID
URLhttps://app.papershift.com/public_api/v1/working_areas
MethodGET
Parameters| Parameters | Type | Required |
|---|---|---|
| api_token | string | required |
| id | integer | required |
| external_id | string | required if id is not set |
{
"api_token": "XXXX",
"id": 127520
}{
"external_id": "s",
"id": 127520,
"name": "Service",
"status": "active",
"location_id": 60414,
"location_name": "Marcos Firma"
}Get Working Areas
Get existing working areas from your Papershift account
URLhttps://app.papershift.com/public_api/v1/working_areas
MethodGET
Parameters| Parameter | Type | Required |
|---|---|---|
| api_token | String | required |
| location_id | Integer | optional |
| location_external_id | String | optional |
A Successful Request returns an Array of all working areas
Example{
"api_token" : "XXXX",
"location_external_id" : "123test"
}var settings = {
"async": true,
"crossDomain": true,
"url": "https://app.papershift.com/public_api/v1/working_areas?api_token=XXXX",
"method": "GET",
"headers": {
"cache-control": "no-cache",
"postman-token": "3dca8a88-867c-1644-48b1-81dd8aee2b1c"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});{
"working_areas": [
{
"external_id": "",
"id": 1,
"name": "Default",
"status": "active",
"location_id": 1,
"location_name": "Florian Suchan Holding"
"color": "#101ca7"
},
{
"external_id": null,
"id": 2,
"name": "Kücheee",
"status": "active",
"location_id": 1,
"location_name": "Florian Suchan Holding"
"color": "#ffff00"
}
]
}Delete Working Areas
Delete working areas from your Papershift account
URLhttps://app.papershift.com/public_api/v1/working_areas
MethodDELETE
Parameters| Parameter | Type | Required |
|---|---|---|
| api_token | String | required |
| location_id | Integer | required |
| location_external_id | String | required if location_id is not set |
A successful request returns the deleted working area.
Example{
"api_token" : "XXXX",
"location_external_id" : "123test"
}{
"external_id": "123test",
"id": 127520,
"name": "Service",
"status": "inactive",
"location_id": 60414,
"location_name": "Marcos Firma"
}Updated 4 months ago
