Bagtower API production_v2 (3.4.0)

Download OpenAPI specification:Download

API for the Bagtower application

Companies

POST companies

Creates all the resources for the company

Authorizations:
api_key
Request Body schema: application/json
object (CompanyLimitsDefinition)
paymentMethodAddedTs
integer

Time when the payment method was added

invoiceInformationTs
number

Indicates if the company has given invoice information

companyName
required
string [ 1 .. 20 ] characters

Name of the company

description
string

Description of the company

deviceStarted
boolean

Indicates if the created device has started

ownerId
string

userId of the owner of the company

object (CompanySubscriptionStripeInformation)
deviceCreated
boolean

Indicates if the first device has been created for the company

object (CompanyInvoiceInformation)
hasInvoiceInformation
boolean

Indicates if the company has given invoice information

causes
Array of strings

Configuration regarding causes of alert

deviceStartedTs
number

Timestamp where the created device has started

object (CompanyPaymentInformation)
Array of objects (CompanyPromotionalCodesItem)

list of promotional codes that may be applied to the company

customerStripeId
string

Id of the customer on stripe

object (CompanyKeyvaluePool)
object (CompanyKeyvaluePool)
userValidated
boolean

indicates whether the owner has validated his account (first connection)

Array of objects (CompanyKanbanStageListItem)
paymentMethodAdded
boolean

Indicates whether at least one payment method was added

createdTs
number

Timestamp of the creation of the company

deviceCreatedTs
number

Timestamp where the first device was created

object (CompanyOwnerInformation)
users
Array of strings

List of users belonging to the company

tags
Array of strings

Tags

isBetaTester
boolean

Indicates if the company has access to beta features

companyId
string

A unique id for the company

object (CompanyCostConfiguration)
userValidatedTs
number

time when the owner user connected for the first time

Responses

Request samples

Content type
application/json
{
  • "limitsDefinition": {
    },
  • "paymentMethodAddedTs": 0,
  • "invoiceInformationTs": 0,
  • "companyName": "string",
  • "description": "string",
  • "deviceStarted": true,
  • "ownerId": "string",
  • "subscriptionStripeInformation": {
    },
  • "deviceCreated": true,
  • "invoiceInformation": {
    },
  • "hasInvoiceInformation": true,
  • "causes": [
    ],
  • "deviceStartedTs": 0,
  • "paymentInformation": {
    },
  • "promotionalCodes": [
    ],
  • "customerStripeId": "string",
  • "keyvaluePool": {
    },
  • "keyvalue": {
    },
  • "userValidated": true,
  • "kanbanStageList": [
    ],
  • "paymentMethodAdded": true,
  • "createdTs": 0,
  • "deviceCreatedTs": 0,
  • "ownerInformation": {
    },
  • "users": [
    ],
  • "tags": [
    ],
  • "isBetaTester": true,
  • "companyId": "string",
  • "costConfiguration": {
    },
  • "userValidatedTs": 0
}

Response samples

Content type
application/json
{
  • "limitsDefinition": {
    },
  • "paymentMethodAddedTs": 0,
  • "invoiceInformationTs": 0,
  • "companyName": "string",
  • "description": "string",
  • "deviceStarted": true,
  • "ownerId": "string",
  • "subscriptionStripeInformation": {
    },
  • "deviceCreated": true,
  • "invoiceInformation": {
    },
  • "hasInvoiceInformation": true,
  • "causes": [
    ],
  • "deviceStartedTs": 0,
  • "paymentInformation": {
    },
  • "promotionalCodes": [
    ],
  • "customerStripeId": "string",
  • "keyvaluePool": {
    },
  • "keyvalue": {
    },
  • "userValidated": true,
  • "kanbanStageList": [
    ],
  • "paymentMethodAdded": true,
  • "createdTs": 0,
  • "deviceCreatedTs": 0,
  • "ownerInformation": {
    },
  • "users": [
    ],
  • "tags": [
    ],
  • "isBetaTester": true,
  • "companyId": "string",
  • "costConfiguration": {
    },
  • "userValidatedTs": 0
}

GET companies/{companyId}

This information is accessed only by owner and admin users

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
{
  • "limitsDefinition": {
    },
  • "paymentMethodAddedTs": 0,
  • "invoiceInformationTs": 0,
  • "companyName": "string",
  • "description": "string",
  • "deviceStarted": true,
  • "ownerId": "string",
  • "subscriptionStripeInformation": {
    },
  • "deviceCreated": true,
  • "invoiceInformation": {
    },
  • "hasInvoiceInformation": true,
  • "causes": [
    ],
  • "deviceStartedTs": 0,
  • "paymentInformation": {
    },
  • "promotionalCodes": [
    ],
  • "customerStripeId": "string",
  • "keyvaluePool": {
    },
  • "keyvalue": {
    },
  • "userValidated": true,
  • "kanbanStageList": [
    ],
  • "paymentMethodAdded": true,
  • "createdTs": 0,
  • "deviceCreatedTs": 0,
  • "ownerInformation": {
    },
  • "users": [
    ],
  • "tags": [
    ],
  • "isBetaTester": true,
  • "companyId": "string",
  • "costConfiguration": {
    },
  • "userValidatedTs": 0
}

PUT companies/{companyId}

Only admin and owner users can perform this action. Only companyName information can be modified

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company to modify

Responses

Response samples

Content type
application/json
{
  • "limitsDefinition": {
    },
  • "paymentMethodAddedTs": 0,
  • "invoiceInformationTs": 0,
  • "companyName": "string",
  • "description": "string",
  • "deviceStarted": true,
  • "ownerId": "string",
  • "subscriptionStripeInformation": {
    },
  • "deviceCreated": true,
  • "invoiceInformation": {
    },
  • "hasInvoiceInformation": true,
  • "causes": [
    ],
  • "deviceStartedTs": 0,
  • "paymentInformation": {
    },
  • "promotionalCodes": [
    ],
  • "customerStripeId": "string",
  • "keyvaluePool": {
    },
  • "keyvalue": {
    },
  • "userValidated": true,
  • "kanbanStageList": [
    ],
  • "paymentMethodAdded": true,
  • "createdTs": 0,
  • "deviceCreatedTs": 0,
  • "ownerInformation": {
    },
  • "users": [
    ],
  • "tags": [
    ],
  • "isBetaTester": true,
  • "companyId": "string",
  • "costConfiguration": {
    },
  • "userValidatedTs": 0
}

DeviceAnnotations

GET companies/{companyId}/annotations/device/{deviceId}

Get the list of all annotations for a given device

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the device

deviceId
required
string

Id of the device for which we are getting the annotations

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POST companies/{companyId}/annotations/device/{deviceId}

Create an annotation for a device

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the device

deviceId
required
string

Id of the device for which creating the annotation

Request Body schema: application/json
unixTimestamp
integer

Timestamp of the annotation

companyId
string

id of the company to which the device belongs

id
string

id of the annotation

title
string

Title of the annotation

deviceId
string

Device id associated to the annotation

userId
string

id of the user that made the annotation

content
string

Content of the annotation (in HTML)

Responses

Request samples

Content type
application/json
{
  • "unixTimestamp": 0,
  • "companyId": "string",
  • "id": "string",
  • "title": "string",
  • "deviceId": "string",
  • "userId": "string",
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "unixTimestamp": 0,
  • "companyId": "string",
  • "id": "string",
  • "title": "string",
  • "deviceId": "string",
  • "userId": "string",
  • "content": "string"
}

PUT companies/{companyId}/annotations/{annotationId}

Update an annotation

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
annotationId
required
string

Id of the annotation to update

companyId
required
string

Id of the company of the device

Request Body schema: application/json
unixTimestamp
integer

Timestamp of the annotation

companyId
string

id of the company to which the device belongs

id
string

id of the annotation

title
string

Title of the annotation

deviceId
string

Device id associated to the annotation

userId
string

id of the user that made the annotation

content
string

Content of the annotation (in HTML)

Responses

Request samples

Content type
application/json
{
  • "unixTimestamp": 0,
  • "companyId": "string",
  • "id": "string",
  • "title": "string",
  • "deviceId": "string",
  • "userId": "string",
  • "content": "string"
}

Response samples

Content type
application/json
{
  • "unixTimestamp": 0,
  • "companyId": "string",
  • "id": "string",
  • "title": "string",
  • "deviceId": "string",
  • "userId": "string",
  • "content": "string"
}

DELETE companies/{companyId}/annotations/{annotationId}

Delete an annotation

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
annotationId
required
string

Id of the annotation to delete

companyId
required
string

Id of the company of the device

Responses

Response samples

Content type
application/json
{ }

assetTemplates

GET /companies/{companyId}/assettemplates

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Causes

GET CAUSES companies/{companyId}/causes

Get all the causes defined for a given company

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company to get the list of causes

query Parameters
issueId
string

id of the issue to get the possible list of causes

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POST CAUSE companies/{companyId}/causes

Creates a new cause

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the cause

Request Body schema: application/json
companyId
string

Id of the company

modifiedTs
number

time of modification of the cause

description
string

Description of the cause

id
string

A unique id

title
string [ 1 .. 20 ] characters

Title of the cause

createdTs
number

time of creation of the cause

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

GET Cause by Id companies/{companyId}/causes/{causeId}

Get a cause by id

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
causeId
required
string

Id of the cause to access

companyId
required
string

Id of the company to get the list of causes

Responses

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

UPDATE CAUSE companies/{companyId}/causes/{causeId}

Updates a new cause

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
causeId
required
string

Id of the cause to update

companyId
required
string

Id of the company of the cause

Request Body schema: application/json
companyId
string

Id of the company

modifiedTs
number

time of modification of the cause

description
string

Description of the cause

id
string

A unique id

title
string [ 1 .. 20 ] characters

Title of the cause

createdTs
number

time of creation of the cause

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

DELETE CAUSE companies/{companyId}/causes/{causeId}

Delete a solution

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
causeId
required
string

Id of the cause to delete

companyId
required
string

Id of the company to delete the cause from

Responses

Response samples

Content type
application/json
{ }

DELETE SOLUTION companies/{companyId}/solutions/{solutionId}

Delete a solution

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company to delete the solution from

solutionId
required
string

Id of the solution to delete

Responses

Response samples

Content type
application/json
{ }

Logs

GET companies/{companyId}/datalogs/{id}

Get the logs of a given device during a given period of time

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company to which the device belongs

id
required
string

Unique id of the device

query Parameters
start
string

(not required) Initial timestamp (epoch value in seconds as integer) to get logs

raw
string

(not required) Ask for raw data and not summary data

end
string

(not required) End timestamp (epoch value in seconds as integer) to get logs

Responses

Response samples

Content type
application/json
[
  • {
    }
]

GET companies/{companyId}/lastlogs/{id}

This action can be performed by owner and developer users.

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company to which the device belongs

id
required
string

Unique id of the device

Responses

Response samples

Content type
application/json
{
  • "unixTimestamp": 0,
  • "data": [
    ],
  • "deviceId": "string"
}

POST logs

Requires a valid API Key

Authorizations:
api_key
Request Body schema: application/json
unixTimestamp
number

Timestamp in seconds of the device log

Array of objects (LogDataItem)

Data for the device

UTCTimestamp
string

UTC Timestamp as ISO8601 format of the log for the device

deviceId
string

The unique UUID of the device sending the log

Responses

Request samples

Content type
application/json
{
  • "unixTimestamp": 0,
  • "data": [
    ],
  • "UTCTimestamp": "string",
  • "deviceId": "string"
}

Response samples

Content type
application/json
{
  • "period": 0,
  • "deviceId": "string"
}

POST logs/pool

Post a log using a pool key. Multiple devices can post here with the same API key

Authorizations:
api_key
header Parameters
sensor-id
string

ID of the sensor you are integrating (i.e. for sigfox integration use the sigfox id)

frame-type
string

Type of frame you are sending, this is used to properly decode the information sent by device

company-id
string

ID of your company

Responses

Response samples

Content type
application/json
{
  • "period": 0,
  • "deviceId": "string"
}

DataViews

GET dataviews per device

Get the list of all data views for a given device

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the device

deviceId
required
string

Id of the device for which we are getting the data views

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POST a dataview per device

Create a data view for a device

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the device

deviceId
required
string

Id of the device for which we are getting the data views

Request Body schema: application/json
companyId
string

id of the company to which the data view belongs

Array of objects (DataViewGraphsItem)

List of graphs configuration

shareValue
string

Share value: group id or user id or ALL

positionView
integer

Position of the view in the list

name
string

Name of the data view

showUnknownGraphs
boolean

If true, show all new metrics not defined in the view

id
string

id of the data view

deviceId
string

Device id associated to the data view

shareType
string
Enum: "GROUP" "USER"

Share type for the data view

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "graphs": [
    ],
  • "shareValue": "string",
  • "positionView": 0,
  • "name": "string",
  • "showUnknownGraphs": true,
  • "id": "string",
  • "deviceId": "string",
  • "shareType": "GROUP"
}

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "graphs": [
    ],
  • "shareValue": "string",
  • "positionView": 0,
  • "name": "string",
  • "showUnknownGraphs": true,
  • "id": "string",
  • "deviceId": "string",
  • "shareType": "GROUP"
}

PUT a data view

Update a dataview for a device

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
dataviewId
required
string

Id of the data view to update

companyId
required
string

Id of the company of the device

Request Body schema: application/json
companyId
string

id of the company to which the data view belongs

Array of objects (DataViewGraphsItem)

List of graphs configuration

shareValue
string

Share value: group id or user id or ALL

positionView
integer

Position of the view in the list

name
string

Name of the data view

showUnknownGraphs
boolean

If true, show all new metrics not defined in the view

id
string

id of the data view

deviceId
string

Device id associated to the data view

shareType
string
Enum: "GROUP" "USER"

Share type for the data view

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "graphs": [
    ],
  • "shareValue": "string",
  • "positionView": 0,
  • "name": "string",
  • "showUnknownGraphs": true,
  • "id": "string",
  • "deviceId": "string",
  • "shareType": "GROUP"
}

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "graphs": [
    ],
  • "shareValue": "string",
  • "positionView": 0,
  • "name": "string",
  • "showUnknownGraphs": true,
  • "id": "string",
  • "deviceId": "string",
  • "shareType": "GROUP"
}

DELETE dataview companies/{companyId}/dataviews/{dataviewId}

Delete a data view

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
dataviewId
required
string

Id of the data view to delete

companyId
required
string

Id of the company to delete the data view from

Responses

Response samples

Content type
application/json
{ }

Decoders

GET decoders

Get the list of decoders for the user

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of company

Responses

Response samples

Content type
application/json
{
  • "Items": [
    ]
}

POST decoders/attach

Attach a decoder

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string
Request Body schema: application/json
companyId
string

Id of the company to which the decoder belongs

decoderName
string

The unique id of the decoder

code
string

string containing the code executed by the decoder

attachType
string
Enum: "device" "tag" "group"

type of attachement for the decoder

attachedDevices
Array of strings

list of attched devices, tags, groups

decoderId
required
string

The unique id of the decoder

language
string
Enum: "python" "javascript"

language on which the decoder is written

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "decoderName": "string",
  • "code": "string",
  • "attachType": "device",
  • "attachedDevices": [
    ],
  • "decoderId": "string",
  • "language": "python"
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

POST company/{companyId}/decoders/deploy

Deploy a decoder

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company

Request Body schema: application/json
companyId
string

Id of the company to which the decoder belongs

decoderName
string

The unique id of the decoder

code
string

string containing the code executed by the decoder

attachType
string
Enum: "device" "tag" "group"

type of attachement for the decoder

attachedDevices
Array of strings

list of attched devices, tags, groups

decoderId
required
string

The unique id of the decoder

language
string
Enum: "python" "javascript"

language on which the decoder is written

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "decoderName": "string",
  • "code": "string",
  • "attachType": "device",
  • "attachedDevices": [
    ],
  • "decoderId": "string",
  • "language": "python"
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

GET companies/{companyId}/decoders/device/{deviceId}

Get the decoder of a device

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company

deviceId
required
string

Unique id of the device

Responses

Response samples

Content type
application/json
{
  • "decoderName": "string",
  • "information": {
    }
}

POST decoders/validate

Validate the code of a decoder

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string
Request Body schema: application/json
code
string

string containing the code executed by the decoder

decoderId
string

The unique id of the decoder

language
string
Enum: "python" "javascript"

language on which the decoder is written

frame
string

Frame to be tested

Responses

Request samples

Content type
application/json
{
  • "code": "string",
  • "decoderId": "string",
  • "language": "python",
  • "frame": "string"
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

GET companies/{comapnyId}/decoders/{id}

Get a decoder by id, if the decoder Id does not exist, it is created

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company

id
required
string

Unique id of the decoder

Responses

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "decoderName": "string",
  • "code": "string",
  • "attachType": "device",
  • "attachedDevices": [
    ],
  • "decoderId": "string",
  • "language": "python"
}

DELETE companies/{companyId}/decoders/{id}

Delete an existing decoder (id)

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company

id
required
string

Unique id of the decoder

Responses

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "decoderName": "string",
  • "code": "string",
  • "attachType": "device",
  • "attachedDevices": [
    ],
  • "decoderId": "string",
  • "language": "python"
}

Devices

GET devices

Get the list of all devices

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the device

Responses

Response samples

Content type
application/json
{
  • "Items": [
    ]
}

POST devices

Creates a new device as well as an apikey associated to it. This action can be performed by develper and owner users

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the device

query Parameters
deviceId
string

(WARNING) Id of the device, it must unique and it is your responsability

Request Body schema: application/json
alertStatus
boolean

Inform whether the status alert is active

timezone
string

Timezone of the device

companyName
string

name of the company

keyId
string

id of the API key associated to the device

deviceId
string

A unique id

deviceName
required
string [ 1 .. 50 ] characters

Name of the device

enabled
boolean

enable/disable monitoring of device

group
string [ 1 .. 15 ] characters

name of the the group

period
required
number >= 60

push period of the device in seconds

types
object

Object containing the types of all the logs

lastAlertMessage
string

last message of alert for this device

failedMonitors
object

list of ongoing failed monitors

Array of objects (DeviceFramesItem)

list of frames to test the decoders

assetTemplateId
string

Id of the template from which the device was created

lastStateChangeTs
number

timestamp of the last state change of device

pool
boolean

informs whether the device belongs to the pool. Used for sigfox devices

alertData
object

data regarding current alerts for the device. Used internally, do not modify.

createdTs
number

time of creation of the device

tags
Array of strings

Tags

companyId
required
string

unique id of the company

modifiedTs
number

time of modification of the device

Array of objects (DeviceAlertSettingsItem)

[Deprecated] List of services data for the device

lastAlertId
string

id of the last detected alert

kpis
Array of strings
status
string

status of the device

Responses

Request samples

Content type
application/json
{
  • "alertStatus": true,
  • "timezone": "string",
  • "companyName": "string",
  • "keyId": "string",
  • "deviceId": "string",
  • "deviceName": "string",
  • "enabled": true,
  • "group": "string",
  • "period": 60,
  • "types": { },
  • "lastAlertMessage": "string",
  • "failedMonitors": { },
  • "frames": [
    ],
  • "assetTemplateId": "string",
  • "lastStateChangeTs": 0,
  • "pool": true,
  • "alertData": { },
  • "createdTs": 0,
  • "tags": [
    ],
  • "companyId": "string",
  • "modifiedTs": 0,
  • "alertSettings": [
    ],
  • "lastAlertId": "string",
  • "kpis": [
    ],
  • "status": "string"
}

Response samples

Content type
application/json
{
  • "alertStatus": true,
  • "timezone": "string",
  • "companyName": "string",
  • "keyId": "string",
  • "deviceId": "string",
  • "deviceName": "string",
  • "enabled": true,
  • "group": "string",
  • "period": 60,
  • "types": { },
  • "lastAlertMessage": "string",
  • "failedMonitors": { },
  • "frames": [
    ],
  • "assetTemplateId": "string",
  • "lastStateChangeTs": 0,
  • "pool": true,
  • "alertData": { },
  • "createdTs": 0,
  • "tags": [
    ],
  • "companyId": "string",
  • "modifiedTs": 0,
  • "alertSettings": [
    ],
  • "lastAlertId": "string",
  • "kpis": [
    ],
  • "status": "string"
}

companies/{companyId}/devices/{id}

Get device with device id and company

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the device

id
required
string

Unique id of the device

Responses

Response samples

Content type
application/json
{
  • "alertStatus": true,
  • "timezone": "string",
  • "companyName": "string",
  • "keyId": "string",
  • "deviceId": "string",
  • "deviceName": "string",
  • "enabled": true,
  • "group": "string",
  • "period": 60,
  • "types": { },
  • "lastAlertMessage": "string",
  • "failedMonitors": { },
  • "frames": [
    ],
  • "assetTemplateId": "string",
  • "lastStateChangeTs": 0,
  • "pool": true,
  • "alertData": { },
  • "createdTs": 0,
  • "tags": [
    ],
  • "companyId": "string",
  • "modifiedTs": 0,
  • "alertSettings": [
    ],
  • "lastAlertId": "string",
  • "kpis": [
    ],
  • "status": "string"
}

PUT companies/{companyId}/devices/{id}

Update a device for a company

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company

id
required
string

Unique id of the device to modify

Request Body schema: application/json
alertStatus
boolean

Inform whether the status alert is active

timezone
string

Timezone of the device

companyName
string

name of the company

keyId
string

id of the API key associated to the device

deviceId
string

A unique id

deviceName
required
string [ 1 .. 50 ] characters

Name of the device

enabled
boolean

enable/disable monitoring of device

group
string [ 1 .. 15 ] characters

name of the the group

period
required
number >= 60

push period of the device in seconds

types
object

Object containing the types of all the logs

lastAlertMessage
string

last message of alert for this device

failedMonitors
object

list of ongoing failed monitors

Array of objects (DeviceFramesItem)

list of frames to test the decoders

assetTemplateId
string

Id of the template from which the device was created

lastStateChangeTs
number

timestamp of the last state change of device

pool
boolean

informs whether the device belongs to the pool. Used for sigfox devices

alertData
object

data regarding current alerts for the device. Used internally, do not modify.

createdTs
number

time of creation of the device

tags
Array of strings

Tags

companyId
required
string

unique id of the company

modifiedTs
number

time of modification of the device

Array of objects (DeviceAlertSettingsItem)

[Deprecated] List of services data for the device

lastAlertId
string

id of the last detected alert

kpis
Array of strings
status
string

status of the device

Responses

Request samples

Content type
application/json
{
  • "alertStatus": true,
  • "timezone": "string",
  • "companyName": "string",
  • "keyId": "string",
  • "deviceId": "string",
  • "deviceName": "string",
  • "enabled": true,
  • "group": "string",
  • "period": 60,
  • "types": { },
  • "lastAlertMessage": "string",
  • "failedMonitors": { },
  • "frames": [
    ],
  • "assetTemplateId": "string",
  • "lastStateChangeTs": 0,
  • "pool": true,
  • "alertData": { },
  • "createdTs": 0,
  • "tags": [
    ],
  • "companyId": "string",
  • "modifiedTs": 0,
  • "alertSettings": [
    ],
  • "lastAlertId": "string",
  • "kpis": [
    ],
  • "status": "string"
}

Response samples

Content type
application/json
{
  • "alertStatus": true,
  • "timezone": "string",
  • "companyName": "string",
  • "keyId": "string",
  • "deviceId": "string",
  • "deviceName": "string",
  • "enabled": true,
  • "group": "string",
  • "period": 60,
  • "types": { },
  • "lastAlertMessage": "string",
  • "failedMonitors": { },
  • "frames": [
    ],
  • "assetTemplateId": "string",
  • "lastStateChangeTs": 0,
  • "pool": true,
  • "alertData": { },
  • "createdTs": 0,
  • "tags": [
    ],
  • "companyId": "string",
  • "modifiedTs": 0,
  • "alertSettings": [
    ],
  • "lastAlertId": "string",
  • "kpis": [
    ],
  • "status": "string"
}

DELETE companies/{companyId}/devices/{id}

Delete a device given the deviceId

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company

id
required
string

Unique id of the device to delete

Responses

Response samples

Content type
application/json
{ }

GET companies/{companyId}/devices/{id}/apikey

This action can be performed by owner and developer users.

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company to which the device belongs

id
required
string

Unique if of the device

Responses

Response samples

Content type
application/json
{
  • "name": "string",
  • "id": "string",
  • "value": "string",
  • "enabled": true
}

Groups

GET groups for a given company

Get the list of gorups for a company

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company for which we want to get the groups

Responses

Response samples

Content type
application/json
{
  • "groups": [
    ]
}

IssueEvents

POST COMMENT companies/{companyId}/issueevents/comment/{id}

Create comment for a given issue

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Id of the issue for which the comment will be created

companyId
required
string
Request Body schema: application/json
content
string

Content of the comment

parentId
string

ignored

Responses

Request samples

Content type
application/json
{
  • "content": "string",
  • "parentId": "string"
}

Response samples

Content type
application/json
{
  • "issueId": "string",
  • "triggerId": "string",
  • "eventType": "ALERT_CREATED",
  • "message": {
    },
  • "createdTs": 0,
  • "parentId": "string",
  • "isCreatedByUser": true,
  • "content": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "context": { },
  • "id": "string",
  • "timestamp": 0
}

GET companies/{companyId}/issueevents/issue/{id}

Get issueEvents list by IssueId

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Issues

GET companies/{companyId}/issues

Get issues list

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

query Parameters
archived
string

Get archived alerts

closed
string

Get closed alerts

active
string

Get only active issues

stopts
string

End time (in seconds)

startts
string

Start time (in seconds)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POST companies/{companyId}/issues

Create a new issue (manually)

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company for which we create the issue

Request Body schema: application/json
userMessage
required
string

Message to send as notification to users

causeId
string

Id of cause of the Issue.

kanbanStageId
string

id of the column in the Issue Kanban

cost
number

Cost information

solutionId
string

Id of solution of the Issue.

title
string

Name of the issue

deviceId
required
string

Device associated to the issue

Responses

Request samples

Content type
application/json
{
  • "userMessage": "string",
  • "causeId": "string",
  • "kanbanStageId": "string",
  • "cost": 0,
  • "solutionId": "string",
  • "title": "string",
  • "deviceId": "string"
}

Response samples

Content type
application/json
{
  • "kanbanStageId": "string",
  • "cost": 0,
  • "isArchived": true,
  • "lastIssueEvent": {
    },
  • "display": {
    },
  • "isManual": true,
  • "cause": "string",
  • "inferedCauseId": "string",
  • "solutionIssueEventId": "string",
  • "startTs": 0,
  • "inferedSolutionId": "string",
  • "createdTs": 0,
  • "threadId": "string",
  • "causeId": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "causeMonitorId": "string",
  • "stopTs": 0,
  • "isMonitorFailed": true,
  • "causeIssueEventId": "string",
  • "id": "string",
  • "solutionId": "string"
}

POST CLOSE companies/{companyId}/issues/close/{id}

Close an issue and all the alerts associated to it

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the issue to close

companyId
required
string

Id of the company for which we create the issue

Responses

Response samples

Content type
application/json
{
  • "kanbanStageId": "string",
  • "cost": 0,
  • "isArchived": true,
  • "lastIssueEvent": {
    },
  • "display": {
    },
  • "isManual": true,
  • "cause": "string",
  • "inferedCauseId": "string",
  • "solutionIssueEventId": "string",
  • "startTs": 0,
  • "inferedSolutionId": "string",
  • "createdTs": 0,
  • "threadId": "string",
  • "causeId": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "causeMonitorId": "string",
  • "stopTs": 0,
  • "isMonitorFailed": true,
  • "causeIssueEventId": "string",
  • "id": "string",
  • "solutionId": "string"
}

GET BY DEVICE ID companies/{companyId}/issues/device/{id}

Get issues list by deviceId

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

id
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POST REOPEN companies/{companyId}/issues/reopen/{id}

Open an issue associated to it

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the issue to open

companyId
required
string

Id of the company for which we create the issue

Responses

Response samples

Content type
application/json
{
  • "kanbanStageId": "string",
  • "cost": 0,
  • "isArchived": true,
  • "lastIssueEvent": {
    },
  • "display": {
    },
  • "isManual": true,
  • "cause": "string",
  • "inferedCauseId": "string",
  • "solutionIssueEventId": "string",
  • "startTs": 0,
  • "inferedSolutionId": "string",
  • "createdTs": 0,
  • "threadId": "string",
  • "causeId": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "causeMonitorId": "string",
  • "stopTs": 0,
  • "isMonitorFailed": true,
  • "causeIssueEventId": "string",
  • "id": "string",
  • "solutionId": "string"
}

POST SET CAUSE /issues/setcause/{id}

Set the cause of an issue. If the causeId is passed, the cause is set and the other fields are ignored. If the causeId is not passed, a new cause is created with the given title and description. If the issueEventId is passed it is used to set the causeIssueEventId of the issue.

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the issue to be updated

companyId
required
string

Id of the company for which we create the issue

Request Body schema: application/json
causeId
string

Id of the cause to associate with the issue

description
string

Additional text for the cause

title
string <= 20 characters

Title of the cause

issueEventId
string

Id of the issue event from which the cause is being created

Responses

Request samples

Content type
application/json
{
  • "causeId": "string",
  • "description": "string",
  • "title": "string",
  • "issueEventId": "string"
}

Response samples

Content type
application/json
{
  • "kanbanStageId": "string",
  • "cost": 0,
  • "isArchived": true,
  • "lastIssueEvent": {
    },
  • "display": {
    },
  • "isManual": true,
  • "cause": "string",
  • "inferedCauseId": "string",
  • "solutionIssueEventId": "string",
  • "startTs": 0,
  • "inferedSolutionId": "string",
  • "createdTs": 0,
  • "threadId": "string",
  • "causeId": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "causeMonitorId": "string",
  • "stopTs": 0,
  • "isMonitorFailed": true,
  • "causeIssueEventId": "string",
  • "id": "string",
  • "solutionId": "string"
}

POST SET SOLUTION companies/{companyId}/issues/setsolution/{id}

Set the solution of an issue. If the solutionId is passed, the solution is set and the other fields are ignored. If the solutionId is not passed, a new solution is created with the given title and description. If the issueEventId is passed it is used to set the solutionIssueEventId of the issue.

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the issue to be updated

companyId
required
string

Id of the company for which we create the issue

Request Body schema: application/json
description
string

Additional text for the solution

solutionId
string

Id of the solution to associate with the issue

title
string <= 20 characters

Title of the solution

issueEventId
string

Id of the issue event from which the solution is being created

Responses

Request samples

Content type
application/json
{
  • "description": "string",
  • "solutionId": "string",
  • "title": "string",
  • "issueEventId": "string"
}

Response samples

Content type
application/json
{
  • "kanbanStageId": "string",
  • "cost": 0,
  • "isArchived": true,
  • "lastIssueEvent": {
    },
  • "display": {
    },
  • "isManual": true,
  • "cause": "string",
  • "inferedCauseId": "string",
  • "solutionIssueEventId": "string",
  • "startTs": 0,
  • "inferedSolutionId": "string",
  • "createdTs": 0,
  • "threadId": "string",
  • "causeId": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "causeMonitorId": "string",
  • "stopTs": 0,
  • "isMonitorFailed": true,
  • "causeIssueEventId": "string",
  • "id": "string",
  • "solutionId": "string"
}

GET companies/{companyId}/issues/{id}

Get issue information

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the issue

companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
{
  • "kanbanStageId": "string",
  • "cost": 0,
  • "isArchived": true,
  • "lastIssueEvent": {
    },
  • "display": {
    },
  • "isManual": true,
  • "cause": "string",
  • "inferedCauseId": "string",
  • "solutionIssueEventId": "string",
  • "startTs": 0,
  • "inferedSolutionId": "string",
  • "createdTs": 0,
  • "threadId": "string",
  • "causeId": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "causeMonitorId": "string",
  • "stopTs": 0,
  • "isMonitorFailed": true,
  • "causeIssueEventId": "string",
  • "id": "string",
  • "solutionId": "string"
}

PUT companies/{companyId}/issues/{id}

Update an issue

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the issue to be updated

companyId
required
string

Unique id of the company to modify

Request Body schema: application/json
kanbanStageId
string

id of the column in the Issue Kanban

cost
number

Cost information

isArchived
boolean

Define the archived status of the issue

object (IssueLastIssueEvent)
object (IssueDisplay)
isManual
boolean

True if the issue was triggered manually

cause
string

Cause of the Issue.

inferedCauseId
string

Id of the cause infered by bagtower

solutionIssueEventId
string

Id of the issueEvent that is the solution of the issue

startTs
number

Start timestamp of the Issue (unix timestamp, in seconds)

inferedSolutionId
string

Id of the solution infered by bagtower

createdTs
number

Item creation unix timestamp (seconds)

threadId
string

Id of the conversation associated to the issue

causeId
string

Id of the cause of the Issue.

companyId
string

Id of the company

modifiedTs
number

Item last modification unix timestamp (seconds)

causeMonitorId
string

Id of the monitor that has triggered the issue

stopTs
number

Stop timestamp of the Issue (unix timestamp, in seconds, default 9876543210)

isMonitorFailed
boolean

True if the issue was triggered by an error in monitor code

causeIssueEventId
string

Id of the issueEvent that is the cause of the issue

id
string

Unique id for the item

solutionId
string

Id of the solution of the Issue.

Responses

Request samples

Content type
application/json
{
  • "kanbanStageId": "string",
  • "cost": 0,
  • "isArchived": true,
  • "lastIssueEvent": {
    },
  • "display": {
    },
  • "isManual": true,
  • "cause": "string",
  • "inferedCauseId": "string",
  • "solutionIssueEventId": "string",
  • "startTs": 0,
  • "inferedSolutionId": "string",
  • "createdTs": 0,
  • "threadId": "string",
  • "causeId": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "causeMonitorId": "string",
  • "stopTs": 0,
  • "isMonitorFailed": true,
  • "causeIssueEventId": "string",
  • "id": "string",
  • "solutionId": "string"
}

Response samples

Content type
application/json
{
  • "kanbanStageId": "string",
  • "cost": 0,
  • "isArchived": true,
  • "lastIssueEvent": {
    },
  • "display": {
    },
  • "isManual": true,
  • "cause": "string",
  • "inferedCauseId": "string",
  • "solutionIssueEventId": "string",
  • "startTs": 0,
  • "inferedSolutionId": "string",
  • "createdTs": 0,
  • "threadId": "string",
  • "causeId": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "causeMonitorId": "string",
  • "stopTs": 0,
  • "isMonitorFailed": true,
  • "causeIssueEventId": "string",
  • "id": "string",
  • "solutionId": "string"
}

DELETE companies/{companyId}/issues/{id}

Remove a issue from DB

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the issue to be deleted

companyId
required
string

Responses

Response samples

Content type
application/json
{ }

Kanban

GET the kanbanStageList from the given company

Get the list of all the issue kanban stages defined by the user for the company.

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company to get the list of issue kanban stages from.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POST the issue kanban stages list

Updates the list of issue kanban stages associated to the given company.

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company involved in the issue kanban stages list update.

Request Body schema: application/json
Array
headerColor
string

Header (text) color of the stage column in a kanban representation.

cardBackgroundColor
string

Card background color of an alert included to the stage column in a kanban representation.

headerBackgroundColor
string

Header background color of the stage column in a kanban representation.

name
required
string

Stage name, as defined by the user.

index
number

Index of the stage column in a kanban representation.

description
string

Stage description, as defined by the user.

id
required
string

Index of the stage (column) in a kanban representation.

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

Kpis

GET BY DEVICE ID companies/{companyId}/kpis/device/{id}

Get KPIS by deviceId

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

id
required
string

Responses

Response samples

Content type
application/json
{ }

PUTcompanies/{companyId}/kpis/device/{id}

Update kpis for a device

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the device for which we update the kpis

companyId
required
string

Unique id of the company to modify

Request Body schema: application/json
object (Kpis)

Data model for device kpis

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }

Monitors

GET monitors

Get monitors list

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POST monitor/

Create a new monitor

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string
Request Body schema: application/json
object (MonitorCost)
attachmentType
required
string
Enum: "DEVICE" "GROUP" "TAG"

Criteria type used to attach devices to the monitor.

createdTs
number

Item creation unix timestamp (seconds)

triggerCount
number

Monitor triggering counter value, computed from alerts counter (read only).

object (MonitorCustomTemplate)
logicOperator
string
Enum: "AND" "OR"

Operator to apply to the conditions

customScript
string

Custom script written by the developer to perform custom monitoring (complex condition(s)).

companyId
string

Id of the company associated to the monitor

modifiedTs
number

Item last modification unix timestamp (seconds)

delay
required
integer

Delay before triggering the issue

attachmentValue
required
string

Criteria value used to attach devices to the monitor (device id, group name, tag value).

name
required
string

Monitor name, given by the user

metricList
required
Array of strings

List of metrics associated to this monitor

id
string

Unique id for the monitor item

number or string

The value to be compared with

Responses

Request samples

Content type
application/json
{
  • "cost": {
    },
  • "attachmentType": "DEVICE",
  • "createdTs": 0,
  • "triggerCount": 0,
  • "customTemplate": {
    },
  • "logicOperator": "AND",
  • "customScript": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "delay": 0,
  • "attachmentValue": "string",
  • "name": "string",
  • "metricList": [
    ],
  • "id": "string",
  • "target": 0
}

Response samples

Content type
application/json
{
  • "cost": {
    },
  • "attachmentType": "DEVICE",
  • "createdTs": 0,
  • "triggerCount": 0,
  • "customTemplate": {
    },
  • "logicOperator": "AND",
  • "customScript": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "delay": 0,
  • "attachmentValue": "string",
  • "name": "string",
  • "metricList": [
    ],
  • "id": "string",
  • "target": 0
}

POST monitors/validatecode

Validate code before deploying a monitor

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string
Request Body schema: application/json
required
object (Logs)

Log entry

required
object (MonitorInformation)

Monitor informatio

Responses

Request samples

Content type
application/json
{
  • "log": {
    },
  • "monitorInformation": {
    }
}

Response samples

Content type
application/json
{
  • "code": "string",
  • "message": "string"
}

GET monitors/{id}

Get monitor information

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the monitor

companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
{
  • "cost": {
    },
  • "attachmentType": "DEVICE",
  • "createdTs": 0,
  • "triggerCount": 0,
  • "customTemplate": {
    },
  • "logicOperator": "AND",
  • "customScript": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "delay": 0,
  • "attachmentValue": "string",
  • "name": "string",
  • "metricList": [
    ],
  • "id": "string",
  • "target": 0
}

PUT monitors/{id}

Update a Monitor

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the monitor to be updated

companyId
required
string

Unique id of the company to modify

Responses

Response samples

Content type
application/json
{
  • "cost": {
    },
  • "attachmentType": "DEVICE",
  • "createdTs": 0,
  • "triggerCount": 0,
  • "customTemplate": {
    },
  • "logicOperator": "AND",
  • "customScript": "string",
  • "companyId": "string",
  • "modifiedTs": 0,
  • "delay": 0,
  • "attachmentValue": "string",
  • "name": "string",
  • "metricList": [
    ],
  • "id": "string",
  • "target": 0
}

DELETE monitors/{id}

Remove a monitor from DB

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the monitor to be deleted

companyId
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

notificationTemplates

GET companies/{companyId}/notificationtemplates/default

Get the default notification template

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
{
  • "subjectTemplate": "string",
  • "messageTemplate": "string"
}

Report

GET Report

Get statistics of issues

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

query Parameters
costmin
string

Consider only issues that have a cost higher than this value

costmax
string

Consider only issues that have a cost lower than this value

durationmin
string

Consider only issues that last longer than this value

group
string

Consider only issues for the given group

causeid
string

Consider only issues for the given cause id

durationmax
string

Consider only issues that last less than this value

stopts
string

End time (in seconds)

startts
string

Start time (in seconds)

Responses

Response samples

Content type
application/json
{
  • "summary": {
    },
  • "graphs": {
    },
  • "globalSummary": {
    }
}

Solutions

GET SOLUTIONS companies/{companyId}/solutions

Get all the soltions defined for a given company

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company to get the list of solutions

query Parameters
issueId
string

id of the issue to get the possible list of solutions

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POST SOLUTION companies/{companyId}/solutions

Creates a new soltion

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the soltion

Request Body schema: application/json
companyId
string

Id of the company

modifiedTs
number

time of modification of the cause

description
string

Description of the solution

id
string

A unique id

title
string [ 1 .. 20 ] characters

Title of the cause

createdTs
number

time of creation of the cause

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

GET SOLUTION by id companies/{companyId}/solutions/{solutionId}

Get a solution

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company to get the list of solutions

solutionId
required
string

id of the solution to get

Responses

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

POST SOLUTION companies/{companyId}/solutions

Creates a new soltion

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the soltion

solutionId
required
string

Id of the solution to update

Request Body schema: application/json
companyId
string

Id of the company

modifiedTs
number

time of modification of the cause

description
string

Description of the solution

id
string

A unique id

title
string [ 1 .. 20 ] characters

Title of the cause

createdTs
number

time of creation of the cause

Responses

Request samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "modifiedTs": 0,
  • "description": "string",
  • "id": "string",
  • "title": "string",
  • "createdTs": 0
}

payment

GET companies/{companyId}/stripe/get-intent

Get stripe setupIntent to create a payment method

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

query Parameters
type
string

Type of payment method ['card', 'sepa_debit']

Responses

Response samples

Content type
application/json
{
  • "client_secret": "string"
}

GET

Get payment info companies/{companyId}/stripe/payment-information

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
{ }

GET companies/{companyId}/stripe/payment-methods

Get payment methods of a given company

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
{
  • "Items": [
    ]
}

DELETE companies/{companyId}/stripe/payment-methods

Delete a payment method for a company

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string
query Parameters
paymentId
string

Id (stripe) of the payment method to delete

Responses

Response samples

Content type
application/json
{
  • "Items": [
    ]
}

GET stripe/public-key

Get stripe public key

path Parameters
companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
{
  • "publicKey": "string"
}

GET companies/{companyId}/stripe/set-default

Set default payment method

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

query Parameters
paymentId
string

Id (stripe) of the payment method to set as default

Responses

Response samples

Content type
application/json
{ }

POST

Webhook: Catch invoice events

Responses

Response samples

Content type
application/json
{ }

Tags

GET companies/{companyId}/tags

Get the list of tags for the company

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company

Responses

Response samples

Content type
application/json
[
  • {
    }
]

POST companies/{companyId}/tags

create a tag

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company of the device

Responses

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "metricId": "string",
  • "tagType": "label",
  • "description": "string",
  • "id": "string",
  • "value": "string",
  • "deviceId": "string"
}

GET companies/{companyId}/tags/{tagId}

Get a tag

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
tagId
required
string

Id of the tag

companyId
required
string

Id of the company

Responses

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "metricId": "string",
  • "tagType": "label",
  • "description": "string",
  • "id": "string",
  • "value": "string",
  • "deviceId": "string"
}

PUT companies/{companyId}/tags/{tagId}

Update a tag

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
tagId
required
string

Id of the tag to update

companyId
required
string

Id of the company of the device

Responses

Response samples

Content type
application/json
{
  • "companyId": "string",
  • "metricId": "string",
  • "tagType": "label",
  • "description": "string",
  • "id": "string",
  • "value": "string",
  • "deviceId": "string"
}

DELETE dataview companies/{companyId}/tags/{tagId}

Delete a tag

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
tagId
required
string

Id of the tag to delete

companyId
required
string

Id of the company to delete the tag from

Responses

Response samples

Content type
application/json
{ }

Uptime

GET uptime for the given company

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Id of the company

query Parameters
only_overall
string

If param given, the function returns only global information

Responses

Response samples

Content type
application/json
{
  • "overall": {
    },
  • "devicesData": [
    ]
}

Users

GET companies/{companyId}/users

Get the list of users of the company companyId.

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
{
  • "Items": [
    ]
}

POST user

If the user already exists it is added to the first company in the companies attribute given in body information

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string
Request Body schema: application/json
lastName
string [ 1 .. 50 ] characters

Last name of the user

hidden
boolean

If true do no render to list page

lastConnectionTs
integer

Last ts the user was connected (access to get devices route)

languageCode
string
Enum: "FR" "EN"

Lamguage preference for the user

userId
string

Unique id for the user

createdTs
number

timestamp of the creation of the user

isBageraUser
boolean

If true do no render to list page

tags
Array of strings

Tags associated to the user

Array of objects (UserCompaniesItem)

List of companies associted to the user

modifiedTs
number

time of modification of the user

phoneNumber
string

Phone number of the user

channels
Array of strings
Items Enum: "EMAIL" "SMS"
name
required
string [ 1 .. 50 ] characters

Name of the user

email
required
string <email>

Email address of the user

Responses

Request samples

Content type
application/json
{
  • "lastName": "string",
  • "hidden": true,
  • "lastConnectionTs": 0,
  • "languageCode": "FR",
  • "userId": "string",
  • "createdTs": 0,
  • "isBageraUser": true,
  • "tags": [
    ],
  • "companies": [
    ],
  • "modifiedTs": 0,
  • "phoneNumber": "string",
  • "channels": [
    ],
  • "name": "string",
  • "email": "user@example.com"
}

Response samples

Content type
application/json
{
  • "lastName": "string",
  • "hidden": true,
  • "lastConnectionTs": 0,
  • "languageCode": "FR",
  • "userId": "string",
  • "createdTs": 0,
  • "isBageraUser": true,
  • "tags": [
    ],
  • "companies": [
    ],
  • "modifiedTs": 0,
  • "phoneNumber": "string",
  • "channels": [
    ],
  • "name": "string",
  • "email": "user@example.com"
}

GET companies/{companyId}/users/{id}

If the request is done by an admin, user information is returned. Otherwise, a user can only get information of himself.

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
id
required
string

Unique id of the user

companyId
required
string

Unique id of the company

Responses

Response samples

Content type
application/json
{
  • "lastName": "string",
  • "hidden": true,
  • "lastConnectionTs": 0,
  • "languageCode": "FR",
  • "userId": "string",
  • "createdTs": 0,
  • "isBageraUser": true,
  • "tags": [
    ],
  • "companies": [
    ],
  • "modifiedTs": 0,
  • "phoneNumber": "string",
  • "channels": [
    ],
  • "name": "string",
  • "email": "user@example.com"
}

PUT companies/{companyId}/users/{id}

A user can modify his/her own information. An owner / admin can modify other users' information

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string

Unique id of the company to modify

id
required
string
Request Body schema: application/json
lastName
string [ 1 .. 50 ] characters

Last name of the user

hidden
boolean

If true do no render to list page

lastConnectionTs
integer

Last ts the user was connected (access to get devices route)

languageCode
string
Enum: "FR" "EN"

Lamguage preference for the user

userId
string

Unique id for the user

createdTs
number

timestamp of the creation of the user

isBageraUser
boolean

If true do no render to list page

tags
Array of strings

Tags associated to the user

Array of objects (UserCompaniesItem)

List of companies associted to the user

modifiedTs
number

time of modification of the user

phoneNumber
string

Phone number of the user

channels
Array of strings
Items Enum: "EMAIL" "SMS"
name
required
string [ 1 .. 50 ] characters

Name of the user

email
required
string <email>

Email address of the user

Responses

Request samples

Content type
application/json
{
  • "lastName": "string",
  • "hidden": true,
  • "lastConnectionTs": 0,
  • "languageCode": "FR",
  • "userId": "string",
  • "createdTs": 0,
  • "isBageraUser": true,
  • "tags": [
    ],
  • "companies": [
    ],
  • "modifiedTs": 0,
  • "phoneNumber": "string",
  • "channels": [
    ],
  • "name": "string",
  • "email": "user@example.com"
}

Response samples

Content type
application/json
{
  • "lastName": "string",
  • "hidden": true,
  • "lastConnectionTs": 0,
  • "languageCode": "FR",
  • "userId": "string",
  • "createdTs": 0,
  • "isBageraUser": true,
  • "tags": [
    ],
  • "companies": [
    ],
  • "modifiedTs": 0,
  • "phoneNumber": "string",
  • "channels": [
    ],
  • "name": "string",
  • "email": "user@example.com"
}

DELETE companies/{companyId}/users/{id}

Requires admin or owner permission

Authorizations:
authorizer-bagtower-api-multi-production
path Parameters
companyId
required
string
id
required
string

Responses

Response samples

Content type
application/json
{ }