Tags
The API functions for tags in Papershift
Create a new tag
Creates a new tag in your Papershift account
URLhttps://app.papershift.com/public_api/v1/filters
MethodPOST
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 |
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.
{
"api_token": "XXXX",
"location_id": 1,
"filter": {
"title": "1st tag"
}
}function createtag() {
var params = {
"api_token": "XXXX",
"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
URLhttps://app.papershift.com/public_api/v1/filters
MethodPUT
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) |
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.
{
"api_token": "XXXX",
"location_id": 1,
"filter": {
"title": "tag1.2",
"id": "1",
"active": "true"
}
}function updateWorkingArea() {
var params = {
"api_token": "XXXX",
"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
URLhttps://app.papershift.com/public_api/v1/filters
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": 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
URLhttps://app.papershift.com/public_api/v1/filters
MethodGET
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 an array of all tags from the chosen location.
Example{
"api_token" : "XXXX",
"location_id" : "1"
}var settings = {
"async": true,
"crossDomain": true,
"url": "https://app.papershift.com/public_api/v1/filters?api_token=XXXX&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 4 months ago
