Api reference


Get started

The api may only be accessed by authenticated users, with relevant permissions for each endpoint. Methods allowed for endpoints are GET, POST, PUT, PATCH and DELETE. PUT and PATCH act the same. Most endpoints use the same structure, using an index for the default route / of a resource, such as api.inndeks.com/products/ using the GET method to display all allowed items. A show .../products/{id} (GET), a store .../products/ (POST), an update .../products/{id} (PUT/PATCH) and delete .../products/{id} (DELETE). Certain endpoints only allow a limited selection of method types, such as not allowing delete or store methods. All endpoints utilize certain permissions, which relate to the user that is authenticated. Users may have differing roles depending on membership with the service.

Authentication

To authenticate with the api send a POST request https://api.inndeks.com/login, pass email and password in the request body. Using Postman with raw json this looks like: { "email" : "[email protected]", "password" : "validpassword" }. If the credentials are valid you will receive a token, which should be passed as a bearer token. You are now authenticated until the token expires and assume the permissions apply to that users role.

Authorization

Each user has a role that gives them permissions that control what actions they are allowed to do. This applies to groups as well, meaning that a user may have permissions to view and create products of a group but not update/remove any of them, per example.

The full list of permissions that exist are given below:

'create-posts','update-posts','delete-posts','manage-users','view-reports',
'create-products','associate-products','show-products','update-products','delete-products',
'create-calendars','assign-calendars','associate-calendars','show-calendars','update-calendars','delete-calendars',
'create-calendar-events','assign-calendar-events','associate-calendar-events','show-calendar-events''update-calendar-events','delete-calendar-events',
'create-calendar-event-associations','show-calendar-event-associations','update-calendar-event-associations','delete-calendar-event-associations',
'create-notifications','associate-notifications','show-notifications','update-notifications','delete-notifications',
'create-groups','assign-groups','show-groups','update-groups','delete-groups'

Queries

When viewing all items of an endpoint via a GET request, filter constraints may be applied. Passing the parameters sort_by=... and sort_direction=... as a query string allows for greater control of the output. The parameters per_page=... and page=... allow control over result pagination. Endpoints may also have parameters that relate directly to the content it is fetching, such as filtering a tag request by the type=... parameter, in the logs endpoint .../logs?type=history.

Certain endpoints also have related data that can be included in the request by passing include=... as a parameter.

Formatting for sort_by, sort_direction and include parameters are given as comma separated strings, such as sort_by=type,id and sort_direction=desc,asc and include=related,also_related.

A real world example of practical filtering creates a query string like:

https://api.inndeks.com/logs?
loggable_type=App\Models\Product&type=history&
per_page=20&page=1&sort_by=loggable_id&sort_direction=desc&
include=content_logs,loggable

Meta data

GET requests to view all items of an endpoint include meta data, which describe filters applied to the result alongside information about result size. Results are paginated meaning that results are separated into pages. Meta data values include

  • count, count of results on the current page.
  • total, count of all results from the response.
  • per_page, limit on how many results should be displayed per page.
  • current_page, the results page that is currently displayed.
  • last_page, count of how many pages exist for the result.
  • sorted_by, filters applied via the sort_by parameter.
  • sort_direction, directionality (asc/desc) applied to each parameter for sorted_by via the sort_direction parameter.

Status codes

Status codes are returned automatically alongside responses and are automatically processed and displayed via http request applications such as Postman. The api is meant to reflect the standard http response status codes as defined by the RFC internet standard. This standard can be found on Mozilla http statuses.

Tags

Route: https://api.inndeks.com/tags

Methods: GET POST PUT/PATCH DELETE

# Create Update Filter Order
id false false false true
name true true true true
description true true true true
created_at false false true true
updated_at false false true true

Related data includes: NONE

Groups

Route: https://api.inndeks.com/groups

Methods: GET POST PUT/PATCH DELETE

# Create Update Filter Order
id false false false true
name true true true true
description true true true true
is_private true true true true
created_at false false true true
updated_at false false true true

Related data includes: NONE

Products

Route: https://api.inndeks.com/products

Methods: GET POST PUT/PATCH DELETE

# Create Update Filter Order
id false false false true
group_id true false true true
container_id false false true true
location_id false false true true
serial_number true true true true
long_name true true true true
short_name true true true true
description true true true true
image_path true true false false
created_at false false true true
updated_at false false true true

Related data includes:

include=group,container,location,tags,logs,content_logs

Related data: container

# Create Update Filter Order
id false false false false
container_type true true true false
width true true false false
height true true false false
depth true true false false
weight true true false false
size_unit true true false false
weight_unit true true false false
created_at false false false false
updated_at false false false false

Related data: location

# Create Update Filter Order
id false false false false
index true true false false
area true true false false
created_at false false false false
updated_at false false false false

Related data: tags

# Create Update Filter Order
id false false true false
name false false false false
description false false false false
created_at false false false false
updated_at false false false false

Product containers

Route: https://api.inndeks.com/containers

Methods: GET PUT/PATCH

# Create Update Filter Order
id false false true true
container_type false true true true
width false true true true
height false true true true
depth false true true true
weight false true true true
size_unit false true true true
weight_unit false true true true
created_at false false true true
updated_at false false true true

Related data includes:

include=product,product_group,product_location,product_tags

Related data: No create, update, filter or ordering applicable.

Product locations

Route: https://api.inndeks.com/locations

Methods: GET PUT/PATCH

# Create Update Filter Order
id false false false true
index false true true true
area false true true true
created_at false false true true
updated_at false false true true

Related data includes:

include=product,product_group,product_location,product_tags

Related data: No create, update, filter or ordering applicable.

Calendars

Route: https://api.inndeks.com/calendars

Methods: GET POST PUT/PATCH DELETE

# Create Update Filter Order
id false false false true
group_id true false true true
name true true true true
description true true true true
created_at false false true true
updated_at false false true true

Related data includes:

include=group,tags

Related data: No create, update, filter or ordering applicable.

Calendar events

Route: https://api.inndeks.com/calendarevents

Methods: GET POST PUT/PATCH DELETE

# Create Update Filter Order
id false false false true
group_id true false true true
calendar_id true false true true
name true true true true
description true true true true
created_at false false true true
updated_at false false true true

Related data includes:

include=group,calendar,calendar_group,attribute,tags

Related data: No create, update, filter or ordering applicable.

Calendar event attributes

Route: https://api.inndeks.com/calendareventattributes

Methods: GET PUT/PATCH

# Create Update Filter Order
id false false false true
calendar_event_id false false true true
start_time false true true true
end_time false true true true
period_type false true true true
period_frequency false true true true
created_at false false true true
updated_at false false true true

Related data includes:

include=calendar_event,calendar_event_group,calendar,calendar_group

Related data: No create, update, filter or ordering applicable.

Calendar event associations

Route: https://api.inndeks.com/calendareventassociations

Methods: GET POST PUT/PATCH DELETE

# Create Update Filter Order
id false false false true
calendar_event_id true false true true
associable_type true true true true
associable_id true true true true
created_at false false true true
updated_at false false true true

Related data includes:

include=calendar_event,calendar_event_group,calendar,calendar_group,associated,associated_group

Related data: No create, update, filter or ordering applicable.

Notifications

Route: https://api.inndeks.com/notifications

Methods: GET POST PUT/PATCH DELETE

# Create Update Filter Order
id false false false true
group_id true false true true
calendar_event_id true false true true
notification_time true true true true
notification_type true true true true
notification_severity true true true true
is_sent false false true true
is_handled false false true true
created_at false false true true
updated_at false false true true

Related data includes:

include=group,calendar_event,calendar_event_group,calendar_event_attribute,calendar,calendar_group,tags

Related data: No create, update, filter or ordering applicable.

Logs

Route: https://api.inndeks.com/logs

Methods: GET

# Create Update Filter Order
id false false false true
type false false true true
loggable_type false false true true
loggable_id false false true true
created_at false false true true
updated_at false false true true

Related data includes:

include=content_logs,loggable,loggable_group

Related data: No create, update, filter or ordering applicable.

Log contents

Route: https://api.inndeks.com/contentlogs

Methods: GET

# Create Update Filter Order
id false false false true
log_id false false true true
content false false true true
created_at false false true true
updated_at false false true true

Related data includes:

include=log,loggable,loggable_group

Related data: No create, update, filter or ordering applicable.