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
Parameter | Type | Required |
---|---|---|
api_token | String | required |
location_id | Integer | required |
location_external_id | String | required if location_id is not set |
title | String | required |
active | Boolean | optional |
external_id | String | optional |
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
Parameter | Type | Required |
---|---|---|
api_token | String | required |
location_id | integer | required |
location_external_id | String | required if location_id is not set |
title | String | optional |
active | Boolean | optional |
id | String | required |
external_id | String | required 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
Parameters | Type | Required |
---|---|---|
api_token | string | required |
id | integer | required |
external_id | string | required 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
Parameter | Type | Required |
---|---|---|
api_token | String | required |
location_id | Integer | required |
location_external_id | String | required 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"
}
]
}
Updated 5 months ago