Goto APIs

Feature API

General:

Basics:

Base-URL: https://capi.lagerkoll.com/v1/feature/
Parameters in the url should all be encoded and all data sent should be UTF-8

MAX number of requests per minute is set to 200.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.

Headers:

There are 2 ways to be authenticated when using this API. in both ways you add headers to the request.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
store: <<STORE>>
user_id: <<USER_ID>>
user_token: <<USER_TOKEN>>
api_key: <<API_KEY>>
Accept: application/json
Content-Type: application/json

Errors:

Code Description
900001 Credentials don't match
900101 Common error
900429 Too many requests
902101 Error when getting feature
902102 Error when uploading feature
902103 Error when updating feature
902104 Error when deleting feature
902105 Error when creating feature
902111 Error when getting feature data
902112 Error when adding feature data
902114 Error when deleting feature data
902122 Dependency not installed
902123 API feature has not been activated
902124 Reversed dependency installed
902125 Feature not installed
{
  "errorCode" : 900101,
  "errorMessage" : "Something went wrong on the server",
  "errorField" : null,
  "errorData" : null
}

Feature API:

Feature

Get features

GETUrl:
Headers:
Accept: application/json
Get list of features
Body:
Successfull response:

{"features": [{ "image": "image", "server": true, "roles": [{}], "icon": "icon", "description": {}, "version": "version", "credits": "credits", "price": 8098.588277174247, "name": {}, "annual": false, "publisher": "publisher", "files": [{ "filename": "filename", "menuTitle": {}, "index": 3077 }], "id": "id", "category": [{}], "dashboard": "dashboard" }]}

Get file for feature

GETUrl: /{id}/{file : .+}
Headers:
Get a file for specified feature
Body:
Successfull response:

Get feature

GETUrl: /{id}
Headers:
Accept: application/json
Get list of files for feature
Body:
Successfull response:

{ "image": "image", "server": true, "roles": [{}], "icon": "icon", "description": {}, "version": "version", "credits": "credits", "price": 9192.671428168862, "name": {}, "annual": false, "publisher": "publisher", "files": [{ "filename": "filename", "menuTitle": {}, "index": 7434 }], "id": "id", "category": [{}], "dashboard": "dashboard" }

Create feature

POSTUrl: /create
Headers:
Accept: application/zip or application/json
Content-type: application/json
Create stubs for a new feature. This method will return a zip-file with the basic files needed to develop the feature
Body:

{ "server": "false", "name": "{\"sv\": \"Svenskt namn\", \"en\": \"English name\"}", "icon": "fas fa-info", "description": "{\"sv\": \"Svensk beskrivning\", \"en\": \"English description\"}", "id": "id", "api": "false", "category": "[\"misc\"]", "dashboard": "false" }
Successfull response:

Upload feature

POSTUrl:
Headers:
Accept: application/json or application/xml
Content-type: multipart/form-data
Upload a zipfile with feature files

Valid parameters:

Parameter Description Default value Allowed values
file
file

Body:
Successfull response:

{ "image": "image", "server": true, "roles": [{}], "icon": "icon", "description": {}, "version": "version", "credits": "credits", "price": 2523.538429780543, "name": {}, "annual": true, "publisher": "publisher", "files": [{ "filename": "filename", "menuTitle": {}, "index": 4804 }], "id": "id", "category": [{}], "dashboard": "dashboard" }

Upload feature file

POSTUrl: /{feature_id}/file
Headers:
Accept: application/json or application/xml
Content-type: multipart/form-data
Upload a file to an existing feature

Valid parameters:

Parameter Description Default value Allowed values
file
file
folder

Body:
Successfull response:

Update feature

PUTUrl: /{id}
Headers:
Accept: application/json or application/xml
Content-type: application/json
Update role on installed feature
Body:

{ "image": "image", "server": false, "roles": [{}], "icon": "icon", "description": {}, "version": "version", "credits": "credits", "price": 692.2703003870434, "name": {}, "annual": false, "publisher": "publisher", "files": [{ "filename": "filename", "menuTitle": {}, "index": 5473 }], "id": "id", "category": [{}], "dashboard": "dashboard" }
Successfull response:

Delete feature

DELETEUrl: /{id}
Headers:
Accept: application/json or application/xml
Delete feature

Valid parameters:

Parameter Description Default value Allowed values
delete_data false

Body:
Successfull response:

Feature API

Execute API request

GETUrl: /{feature_id}/api/{path : .+}
Headers:
Accept: */*
Execute GET request for the feature API

Valid parameters:

Parameter Description Default value Allowed values
force_reload false

Body:
Successfull response:

Feature Swagger

GETUrl: /{feature_id}/api/swagger.json
Headers:
Accept: application/json
Get Swagger for Feature API
Body:
Successfull response:

Execute API request

POSTUrl: /{feature_id}/api/{path : .+}
Headers:
Accept: */*
Content-type: application/json or application/xml or application/x-www-form-urlencoded
Execute POST request for the feature API

Valid parameters:

Parameter Description Default value Allowed values
force_reload false

Body:
Successfull response:

Execute API request

POSTUrl: /{feature_id}/api/{path : .+}
Headers:
Accept: */*
Content-type: multipart/form-data
Execute POST request for the feature API

Valid parameters:

Parameter Description Default value Allowed values
force_reload false

Body:
Successfull response:

Execute API request

PUTUrl: /{feature_id}/api/{path : .+}
Headers:
Accept: */*
Content-type: application/json or application/xml or application/x-www-form-urlencoded
Execute PUT request for the feature API

Valid parameters:

Parameter Description Default value Allowed values
force_reload false

Body:
Successfull response:

Execute API request

PUTUrl: /{feature_id}/api/{path : .+}
Headers:
Accept: */*
Content-type: multipart/form-data
Execute PUT request for the feature API

Valid parameters:

Parameter Description Default value Allowed values
force_reload false

Body:
Successfull response:

Execute API request

DELETEUrl: /{feature_id}/api/{path : .+}
Headers:
Accept: */*
Execute DELETE request for the feature API

Valid parameters:

Parameter Description Default value Allowed values
force_reload false

Body:
Successfull response:

Feature Data

Get feature data (default)

GETUrl: /{feature_id}/data/{data_id : .+}
Headers:
Accept: application/json
Get data for a feature based on id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field
Body:
Successfull response:

Get feature data

GETUrl: /{feature_id}/type/{structure_type}/data/{data_id : .+}
Headers:
Accept: application/json
Get data for a feature based on structure type and id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field
Body:
Successfull response:

Get feature datas (default)

GETUrl: /{feature_id}/data
Headers:
Accept: application/json
Get data rows for a feature based on id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field

Valid parameters:

Parameter Description Default value Allowed values
page 0
limit 25
query Filter on fields in structure. I.e: screen_id eq abc (Url-enocded: screen_id%20eq%20abc). Operator allowed is limited to eq, and the parameter must be url encoded

Body:
Successfull response:

Get feature datas

GETUrl: /{feature_id}/type/{structure_type}/data
Headers:
Accept: application/json
Get data rows for a feature based on structure type and id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field

Valid parameters:

Parameter Description Default value Allowed values
page 0
limit 25
query Filter on fields in structure. I.e: screen_id eq abc (Url-enocded: screen_id%20eq%20abc). Operator allowed is limited to eq, and the parameter must be url encoded

Body:
Successfull response:

Add feature data (default)

POSTUrl: /{feature_id}/data/{data_id : .+}
Headers:
Accept: application/json
Content-type: application/json
Add or updates data for a feature based on id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field

Valid parameters:

Parameter Description Default value Allowed values
enable_for_group true if the feature data should apply for the whole group, false if it only applies for the specified store false

Body:
Successfull response:

Add feature data

POSTUrl: /{feature_id}/type/{structure_type}/data/{data_id : .+}
Headers:
Accept: application/json
Content-type: application/json
Add or updates data for a feature based on structure type and id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field

Valid parameters:

Parameter Description Default value Allowed values
enable_for_group true if the feature data should apply for the whole group, false if it only applies for the specified store false

Body:
Successfull response:

Add feature datas (default)

POSTUrl: /{feature_id}/data
Headers:
Accept: application/json
Content-type: application/json
Add or updates data from a list for a feature based on id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field

Valid parameters:

Parameter Description Default value Allowed values
enable_for_group true if the feature data should apply for the whole group, false if it only applies for the specified store false

Body:
Successfull response:

Add feature datas

POSTUrl: /{feature_id}/type/{structure_type}/data
Headers:
Accept: application/json
Content-type: application/json
Add or updates data from a list for a feature based on structure type and id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field

Valid parameters:

Parameter Description Default value Allowed values
enable_for_group true if the feature data should apply for the whole group, false if it only applies for the specified store false

Body:
Successfull response:

Delete feature datas (default)

POSTUrl: /{feature_id}/data/delete
Headers:
Accept: application/json
Content-type: application/json
Delete data from a list for a feature based on id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field
Body:
Successfull response:

Delete feature datas

POSTUrl: /{feature_id}/type/{structure_type}/data/delete
Headers:
Accept: application/json
Content-type: application/json
Delete data from a list for a feature based on structure type and id. To be able to store data for a feature, the feature must have a data-structure defined in its config-file and be uploaded to the store. The data posted in this request MUST match the config´s data structure and MUST contain a key field
Body:
Successfull response:

Delete feature data (default)

DELETEUrl: /{feature_id}/data/{data_id : .+}
Headers:
Accept: application/json
Delete data for a feature based on id
Body:
Successfull response:

Delete feature data

DELETEUrl: /{feature_id}/type/{structure_type}/data/{data_id : .+}
Headers:
Accept: application/json
Delete data for a feature based on structure type and id
Body:
Successfull response:

Feature Server Function

Count server function queue

GETUrl: /{feature_id}/server/function/queue
Headers:
Accept: application/json
Count number of server functions that is in queue for a specific feature
Body:
Successfull response:

{"queue": 476}

Count function queue

GETUrl: /server/function/queue
Headers:
Accept: application/json
Count number of server functions that is in queue
Body:
Successfull response:

{"queues": [{ "featureName": {}, "featureId": "featureId", "queue": 4530 }]}

Execute server function

POSTUrl: /{feature_id}/server/function
Headers:
Accept: application/json
Add server function to be executed. The function will be placed last in queue and be executed as quickly as possible
Body:

{ "crud": "crud", "dataId": "dataId", "function": "function", "event": "event", "params": {} }
Successfull response:

{"queue": 6821}

Store feature

Get store features

GETUrl: /store
Headers:
Accept: application/json
Content-type: application/json
Get list of store features

Valid parameters:

Parameter Description Default value Allowed values
categories Comma seperated list of categories to include in result. Empty list will return all
features Comma seperated list of feature ids to return in result

Body:
Successfull response:

{"features": [{ "image": "image", "dbDataStructures": {}, "dependancy": [{}], "trialDays": 6832, "icon": "icon", "description": {}, "version": "version", "screenshots": [{ "filename": "filename", "description": {} }], "credits": "credits", "price": 4102.0889078121345, "name": {}, "annual": false, "publisher": "publisher", "files": [{ "filename": "filename", "menuTitle": {}, "index": 2655 }], "id": "id", "category": [{}] }]}

Get feature categories

GETUrl: /store/categories
Headers:
Accept: application/json
Content-type: application/json
Get list of store feature features
Body:
Successfull response:

{"categories": [{ "features": 6184, "category": "category" }]}

Install store feature

POSTUrl: /store/install
Headers:
Accept: application/json or application/xml
Content-type: application/json or application/xml
Install feature from store
Body:
Successfull response:

Classes:

CreateFeatureRequest

Field Type Description Default Mandatory Accepted values Example values Access
id String Id of feature POST R,W
name HashMap Name of feature. This is a map where key is the language and value is the translated string POST {"sv": "Svenskt namn", "en": "English name"} R,W
icon String Icon (Font Awesome v.5.15.4) to be rendered in the menu fas fa-info R,W
description HashMap Description of feature. This is a map where key is the language and value is the translated string {"sv": "Svensk beskrivning", "en": "English description"} R,W
server Boolean Indicates if this feature has event callbacks false R,W
api Boolean Indicates if this feature exposes a REST api false R,W
dashboard Boolean Indicates if this feature should show information in dashboard page in Lagerkoll false R,W
category List List of categories for this feature ["misc"] R,W

FeatureCategories

Field Type Description Default Mandatory Accepted values Example values Access
categories List List of categories for features R,W

FeatureCategory

Field Type Description Default Mandatory Accepted values Example values Access
category String Category name R,W
features Integer Number of features with this category R,W

FeatureFile

Field Type Description Default Mandatory Accepted values Example values Access
index int If file should have its own link in the menu, this will be rendered according to ascending index R,W
filename String Filename R
menuTitle HashMap If file should have its own link in the menu, this will be the title R,W

FeatureInstall

Field Type Description Default Mandatory Accepted values Example values Access
id String Id of feature R
roles List List of roles needed to access the feature R

FeatureQueue

Field Type Description Default Mandatory Accepted values Example values Access
queue int R

FeatureQueueInfo

Field Type Description Default Mandatory Accepted values Example values Access
featureId String R
featureName HashMap R
queue int R

FeatureQueueInfos

Field Type Description Default Mandatory Accepted values Example values Access
queues List R

FeatureResponse

Field Type Description Default Mandatory Accepted values Example values Access
id String Id of feature R
name HashMap Name of feature R
roles List List of roles needed to access the feature R,W
icon String Icon (Font Awesome v.5.15.4) to be rendered in the menu R
image String Name if image-file bundled in zip-file R
description HashMap Description of feature R
publisher String Name responsible person for this feature R
credits String Credits to people involved with this feature R
price Double Price for this feature R
annual Boolean Indicates if price is annual or onetime R
dashboard String Name of the function that renders data in the dashboard in Lagerkoll R
version String Version of feature R
files List List of files in the feature R
server Boolean Indicates if this feature has event callbacks R
category List List of categories for this feature R

FeatureScreenshot

Field Type Description Default Mandatory Accepted values Example values Access
filename String R
description HashMap R

FeatureServerFunction

Field Type Description Default Mandatory Accepted values Example values Access
function String R,W
event String R,W
crud String R,W
dataId String Data id for feature method, example article id or customer id for event methods. If both dataId and params is set, then params will be used R,W
params HashMap Params for feature method. If both dataId and params is set, then params will be used R,W

FeaturesResponse

Field Type Description Default Mandatory Accepted values Example values Access
features List List of features R

StoreFeatureResponse

Field Type Description Default Mandatory Accepted values Example values Access
id String R
name HashMap R
version String R
icon String R
image String R
description HashMap R
publisher String R
credits String R
price Double R
annual Boolean Indicates if price is annual or onetime R
trialDays Integer If this feature has a trial-period, this field contains the number of days R
dbDataStructures HashMap R
files List R
dependancy List R
category List R
screenshots List R

StoreFeaturesResponse

Field Type Description Default Mandatory Accepted values Example values Access
features List R