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 (can be blank if location_external_id is set)
location_external_idStringoptional (required if location_id is blank)
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 (can be blank if location_external_id is set)
location_external_idStringoptional (required if location_id is blank)
nameStringrequired
colorStringoptional

Information

Updating an existing Working Area requires finding the specific record
in the Database. This can be achieved via the Working Areas’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 (if external_id not set)
external_idstringrequired (if id 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 if location_external_id is not set
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"
}