Working Areas

The API- functions for working areas in Papershift



Create a new Working Area

Creates a new working area in your Papershift account

URL

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

Method

POST

Parameters

ParameterTypeRequired
api_tokenStringrequired
location_idIntegerrequired
location_external_idStringrequired if location_id is not set
nameStringrequired
colorStringoptional
external_idStringoptional

Information

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.

Example

{
   "api_token":  "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
   "location_id": 1,
   "working_area":    {
     "name": "1st Area"
   }
 }
function createWorkingArea() {
  var params = {
    "api_token":  "rJkAk7Bzm5uDipfJY9aZtWhHxfsz06oO5ggJyvI7",
    "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

URL

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

Method

PUT

Parameters

ParameterTypeRequired
api_tokenStringrequired
location_idintegerrequired
location_external_idStringrequired if location_id is not set
nameStringrequired
colorStringoptional

Information

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.

Example

{
   "api_token":  "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
   "location_id": 1,
   "working_area":    {
     "name": "Colored Area",
     "color": "#1abc9c"
   }
 }
function updateWorkingArea() {
  var params = {
    "api_token":  "rJkAk7Bzm5uDipfJY9aZtWhHxfsz06oO5ggJyvI7",
    "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

URL

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

Method

GET

Parameters

ParametersTypeRequired
api_tokenstringrequired
idintegerrequired
external_idstringrequired if id is not set

Example

{
    "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

URL

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

Method

GET

Parameters

ParameterTypeRequired
api_tokenStringrequired
location_idIntegeroptional
location_external_idStringoptional

Information

A Successful Request returns an Array of all working areas

Example

{
        "api_token" : "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK",
        "location_external_id" : "123test"
      }
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://app.papershift.com/public_api/v1/working_areas?api_token=eeMbGG4pOojjDuRIyNgrSj75xpTLevTKtGzkJBOw",
  "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 Holdingh"
      "color": "#101ca7"
    },
    {
      "external_id": null,
      "id": 2,
      "name": "Kücheee",
      "status": "active",
      "location_id": 1,
      "location_name": "Florian Suchan Holdingh"
      "color": "#ffff00"
    }
  ]
}



Delete Working Areas

Delete working areas from your Papershift account

URL

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

Method

DELETE

Parameters

ParameterTypeRequired
api_tokenStringrequired
location_idIntegerrequired
location_external_idStringrequired if location_id is not set

Information

A successful request returns the deleted working area.

Example

{
        "api_token" : "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK",
        "location_external_id" : "123test"
      }
{
    "external_id": "123test",
    "id": 127520,
    "name": "Service",
    "status": "inactive",
    "location_id": 60414,
    "location_name": "Marcos Firma"
}