Tags

The API- functions for tags in Papershift



Create a new tag

Creates a new tag in your Papershift account

URL

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

Method

POST

Parameters

ParameterTypeRequired
api_tokenStringrequired
location_idIntegerrequired
location_external_idStringrequired if location_id is not set
titleStringrequired
activeBooleanoptional
external_idStringoptional

Information

Creating tags 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,
   "filter":    {
     "title": "1st tag"
   }
 }
function createtag() {
  var params = {
    "api_token":  "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
    "location_id": 1,
    "filter": {
      "title": "1st tag"
    }
  };

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/filters",
    type: 'POST',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
  "id": 1,
  "title": "1st tag",
  "active": true,
  "external_id": null
}



Update a tag

Update an existing tag in your Papershift account

URL

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

Method

PUT

Parameters

ParameterTypeRequired
api_tokenStringrequired
location_idintegerrequired
location_external_idStringrequired if location_id is not set
titleStringoptional
activeBooleanoptional
idStringrequired
external_idStringrequired if location_id is not set (can just be set not updated)

Information

Updating an existing tag requires finding the specific one
in the database. This can be achieved via the tag's external ID
or record ID.

Example

{
   "api_token":  "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
   "location_id": 1,
   "filter":    {
     "title": "tag1.2",
     "id": "1",
     "active": "true"
   }
 }
function updateWorkingArea() {
  var params = {
    "api_token":  "U6H2QWD6UWsI8sgs6TyvoK1E6HdliuTL2LgniO18",
    "location_id": 1,
    "filter": {
      "title": "tag1.2",
      "id": "1"
    }
  };

  $.ajax({
    url: "https://app.papershift.com/public_api/v1/filters",
    type: 'PUT',
    dataType: 'json',
    data: JSON.stringify(params),
    complete: function (data) {
      console.log(data.responseText);
    }
  });
}
{
  "id": "1",
  "title": "tag 1.2",
  "active": true,
  "external_id": null
}



Get Tag by ID

Get tag by its unique ID or external ID

URL

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

Method

GET

Parameters

ParametersTypeRequired
api_tokenstringrequired
idintegerrequired
external_idstringrequired if id is not set

Example

{
    "api_token": "XXXX",
    "id": 67089
}
{
    "id": 67089,
    "title": "Neuwagen",
    "active": true,
    "external_id": "tag_neuwagen",
    "color": "#96281B"
}



Get all tags

Get existing tags of a specific location from your Papershift account

URL

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

Method

GET

Parameters

ParameterTypeRequired
api_tokenStringrequired
location_idIntegerrequired
location_external_idStringrequired if location_id is not set

Information

A successful request returns an array of all tags from the chosen location.

Example

{
        "api_token" : "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK",
        "location_id" : "1"
      }
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://app.papershift.com/public_api/v1/filters?api_token=eeMbGG4pOojjDuRIyNgrSj75xpTLevTKtGzkJBOw&location_id=1",
  "method": "GET",
  "headers": {
    "cache-control": "no-cache",
    "postman-token": "3dca8a88-867c-1644-48b1-81dd8aee2b1c"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
{
  "filters": [
    {
      "id": 52290,
      "title": "Empfang",
      "active": true,
      "external_id": null
    },
    {
      "id": 72923,
      "title": "TestTag1",
      "active": false,
      "external_id": "1"
    }
  ]
}