Locations
The API functions for Locations in Papershift
Get Locations
Get location(s) from your Papershift account
URLhttps://app.papershift.com/public_api/v1/locations
MethodGET
Parameters| Parameters | Type | Required |
|---|---|---|
| api_token | String | required |
A successful request returns all locations
Example{
"api_token" : "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK"
}var settings = {
"async": true,
"crossDomain": true,
"url": "https://app.papershift.com/public_api/v1/locations?api_token=eeMbGG4pOojjDuRIyNgrSj75xpTLevTKtGzkJBOw",
"method": "GET",
"headers": {
"cache-control": "no-cache",
"postman-token": "6ooIiSZaiBwaFBLxveJkm7pP8uTOPLPSwDL6QsOK"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});{
"locations": [
{
"id": 1,
"name": "Test AG",
"updated_at": "2016-08-04T20:21:11+02:00",
"external_id": "test",
"status": "active"
}
]
}Get Location by ID
Get location by its unique ID or external ID
URLhttps://app.papershift.com/public_api/v1/locations
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": 64785
}{
"id": 64785,
"name": "Julias Standort",
"updated_at": "2019-07-02T11:28:15+02:00",
"external_id": "loc_julia",
"status": "active"
}Create Location
Create a new location
URLhttps://app.papershift.com/public_api/v1/locations
MethodPost
Parameters| Parameters | Type | Required |
|---|---|---|
| api_token | string | required |
| name | string | required |
| user_id | integer | required |
| active | string | optional |
{
"api_token": "XXXX",
"name": "HQ",
"user_id": "42"
}{
"id": 64785,
"name": "HQ",
"updated_at": "2019-07-02T11:28:15+02:00",
"status": "active"
}The parameter user_id is required and must belong to an account admin. That user will automatically be included in the new location.
Update Location
Update an existing location
URLhttps://app.papershift.com/public_api/v1/locations
MethodPUT
Parameters| Parameters | Type | Required |
|---|---|---|
| api_token | string | required |
| id | integer | required |
| external_id | string | required if id is not set |
| name | string | optional |
| active | string | optional |
{
"api_token": "XXXX",
"location": {
"id": "42",
"name": "HQ Berlin"
}
}{
"id": 64785,
"name": "HQ Berlin",
"updated_at": "2019-07-03T11:28:15+02:00",
"status": "active"
}Delete Location
Delete an existing location
URLhttps://app.papershift.com/public_api/v1/locations
MethodDELETE
Parameters| Parameters | Type | Required |
|---|---|---|
| api_token | string | required |
| id | integer | required |
| external_id | string | required if id is not set |
{
"api_token": "XXXX",
"location": {
"id": "42"
}
}{
"id": 64785,
"name": "HQ",
"updated_at": "2019-07-02T11:28:15+02:00",
"status": "inactive"
}Updated 4 months ago
