NAV
json

Introduction

Welcome to VendNovation's Vendor API! You can use our API to build custom interfaces to your data within VendNovation's system.

To help you get started in your development, we provide a Postman collection that you can import. Download it here (right click and Save Link As). Our postman collection makes use of collection level variables which you can learn about here. The variable names have already been defined and inserted throughout the collection, you just need to enter your values.

By reading and using this documentation, you agree to these terms.

Concepts

General Documentation Information

Data Types

The api is written in C#, and as a result the data types in the documentation refer to C# data types. These map cleanly to similar types in other languages and generally do not need expanded upon. The only exception is the ? operator. This indicates a value may be null. So for example, if a data type is specified as bool? that indicates that the value may be null, and if it is not, then the type will be a bool. This also indicates that the api will accept a null in this field.

API Access Tokens

The Vendor API uses AWS api tokens to control access to the api and to manage rate limiting. If you do not have a token, email us!. To use your token please include a header like x-api-key: accessToken. This is required on all requests. We have a route to help you test that this is setup properly. See the Token Test route for more information.

If you do not have a token, perform the following:

  1. Create one or more User(s) within the Organization that requires API access. a. We suggest api@organizationName.com for the login email. b. Set a strong password - the password for this user will be used in conjunction with an organization specific API key to authenticate against the API.
  2. Contact api-request@vendnovation.com and provide your Organization Name and the login email(s) of those users you wish to enable API access for.
  3. VendNovation will enable API access for those Users and send you your Organization specific API Key.

Usage Plan Details

All new API access keys are limited to the following restrictions:

Limits
Rate 20 requests per second
Burst 100 requests
Quota 5,000 requests per day

Proper call optimization should allow you to stay within the limits. Remember that all calls support retrieving multiple data sets by ID simultaneously.

API Stages

The Vendor API has multiple deployments you can access. It is recommended you use the most current version of the API. The stages available currently are:

Stage Description
rc An early access deployment of the next release. Code deployed to this stage can be expected to work. If the release contains breaking changes, those changes will generally be posted here one month before full deployment. Non-breaking changes may be posted closer to the full deployment date.
v1 The original production release of the api.
v2 Current version of the API.

It is our goal to have the APIs exist in perpetuity, even when they are no longer receiving bugfixes. However, should a security-related issue be discovered that cannot be fixed in a non-breaking way, you will be given as much time as possible to migrate to a newer, secure version of the API.

Data Retrieval and Filters

{
  "organizationIds": [1],
  "siteIds": [1, 4, 6]
}

The Vendor API is not structured like a standard REST API (parent-resource/{parent-resource-id}/child-resource) and is instead built around bulk operations and achieving as much as possible in a single request while still having resource driven routes. To support this goal, api urls are flat. Even though accounts are a logical child resource of organizations, they are accessed at <base-url>/accounts. As the change in URL structure would imply, you are able to retrieve accounts from multiple parent organizations at the same time. The default behavior of the API is to send you all the data that you have access to. So if I have access to two organizations, and I call GET /machines, the api will return a result set of every single machine in both organizations at once.

As this is probably too broad for your use case, the API is filter driven. Almost every request accepts the standard request filter (found here) and supports multiple filters at the same time. In addition to the standard request filter, some route specific filters are also available and links to them will be found in the routes where applicable. Returning to our machines example, I could narrow it down a lot to only just the machines at any of the specified sites that also belong to a specific organization. To get a single (or a few specific machines) you would only specify machineIdentifiers. These principles apply to all routes in the API.

It is worth noting that not only retrieval is a bulk action. Every call in the api supports bulk actions across multiple tiers of parent resources. All bulk actions are treated as atomic sets, so if one element in your action fails, the entire set will be rolled back to it's initial state, and you will be notified of such, with as helpful an error message as can be provided.

DateTime Handling

Unless otherwise stated, all DateTimes are in UTC.

A Note on Time Zones

When working with DateTime filters, there are additional considerations regarding timezones. The DateTimes in our systems are stored in the local time as configured for the site/machine. The stored time for things like transactions report is the local time reported by the machine. As a result, to make working with DateTimes easier if you are not using the website for data tracking, you may consider configure your sites to be UTC.

StartDate and EndDate Clamping

When you provide a StartDate and/or EndDate in your request filter, the dates you provided will not necessarily be the dates used in your request. We apply a series of clamping rules to your DateTimes to restrict your maximum search range to no more than the maximum range (which varies between calls as performance allows) as well as generate either or both DateTimes if they were not both provided.

Here is a breakdown of this to help you understand how this works

StartDate Provided EndDate Provided Result
Yes Yes Your end date will be modified if the time span between provided start and end is larger than the maximum range
Yes No Your end date will be set to maximum range number of days from your start date
No Yes The start date will be generated as your end date minus range maximum
No No End date will be generated as DateTime.Now, and your start date will be range maximum days earlier

If applicable, the API response will include additional headers to help you detect when we have modified date-time search parameters. - search-range-start-date - will contain the modified search start date and time, as applicable. - search-range-end-date - will contain the modified search end date and time, as applicable.

Also of note, the time portion of the DateTime is optional. If omitted, StartDate will be given a time of 00:00:00 and EndDate will be given a time of 23:59:59.

Pagination

Paging is universally supported in the API. Page parameters are specified by headers.

Header Default Value Meaning
page 1 Which page of results are you requesting.
size 50 How many results per page would you like to retrieve. Will be clamped to 2000 if set higher.

The response's headers will include the paging information we used while processing the request as well as the total number of pages available to be retrieved.

Header Name Meaning
page The page of data returned by the API.
size The page size the api used while processing your request
total-pages How many pages of data are available to be retrieved.

Standardized Request Body

{
    "requestFilter": {
      // Request filter values, if any, go here.
    },
    "routeFilter": {
      // Route filter values, if any, go here.
    }
    "body": {
        //Your data, if any, goes here.
    }
}

Requests made to the api have standardized JSON keys to ensure uniformity of interaction with the API. - The request filter is to be assigned to a key named requestFilter. - Any route specific filter is to be assigned to a key named routeFilter. - Any data models you provide to the api (eg for creates or updates) is to be assigned to a key named body.

To simplify making requests, you can put this in every request body (sans comments) and add data on an as needed basis.

Error Handling

{
  "code": "DATA_ACCESS", // programatically useful error code
  "message": "You tried to update one or more sites outside of your organization. No changes have been made.", // human friendly error message
  "pointers": [1, 4, 7], // an identifier used to find the problem records in your payload
  "pointerName": "Site.Id" // a string that tells you what field the pointers represent
}

When the api encounters an error, it will send back a list of error objects like the one seen in the sidebar. These objects should make it easy to programmatically detect and adjust for errors. Below is a table documenting these common error codes. If a route can have other errors not found in this table a similar table will be found in that route's documentation.

HTTP Code Error Code Definition
401 API_TOKEN Your api token was not present or has expired. Call /authenticate to get one.
403 NO_API_ACCESS You do not have api access. Please contact vendnovation.
500 ACCESS_ERROR Something went wrong while trying to retrieve your data access permissions.
403 DATA_ACCESS An operation was requested for resources outside of your organizations.
500 UNKNOWN_ERROR Something went wrong that may be a problem on our end. Reach out to vendnovation support.
400 GENERIC_ERROR We encountered an error processing your request.
400 UNEXPECTED_RESULT_COUNT Fewer rows were affected by your request than expected, changes may have been made elsewhere.
404 MISSING_RECORD One or more of the specified records could not be found.
421 MISSING_REQUIRED_DATA Your request was serializable but was missing some data required by the business logic. Please refer to the documentation.
400 DESERIALIZATION_ERROR One of your fields could not be deserialized to the correct type.
400 INVALID_DATE_RANGE Your date range's start date was after its end date.
400 DATE_PARSING One or more of your dates was unparseable.

Multi-Route Filters

Request Filter

Most routes support a universal request filter to control the data that you receive back in the response. Not all routes support all features of the request filter, so in any given route's documentation page, you will see a table like below, indicating what request filter options are honored by that route. Specifying a request filter not honored by that route will not cause an error, but will also have no effect. Additionally, you can specify multiple ID filters if they are supported by the route, and they will all be applied.

Filter Name Type Default Value Description
startDate DateTime Current UTC DateTime - 7 Days Excludes all records that occurred before this date.
endDate DateTime Current UTC DateTime - 7 Days Excludes all records that occurred after this date.
includeDeleted bool False Includes deleted records that are normally excluded from the response.
organizationIds List<int> null Filter results to only the specified Organization or their child records.
accountIds List<int> null Filter results to only the specified Accounts or their child records.
siteIds List<int> null Filter results to only the specified Sites or their child records.
machineIdentifiers List<string> null Filter results to only the specified Machines or their child records. Supports specifying machines by either ID or PROSE.
selectionIds List<int> null Filter results to only the specified Selections or their child records.
productIds List<int> null Filter results to only the specified Products or their child records.

Permissions Filter

All role, role right, and right related routes use the PermissionsFilter for further filtering. It's definition follows:

Filter Name Type Definition
roleIdentifiers List<string> Filters the results to only roles that have either the specified ID or role name.
rightIds List<int> Filters the results to only the specified rights.
roleRightIds List<int> Filters the results to only the specified role right IDs.

Templating Filter

All template, template group and template selection related routes use the TemplatingFilter for filtering. It's definition follows:

Filter Name Type Definition
templateIds List<int> The template IDs you'd like to filter the result set to.
createdBefore DateTime? Only return records created before the specified date and time.
createdAfter DateTime? Only return records created after the specified date and time.
modelId int? Filters the result set to only records attached to machines with this model.
templateGroupIds List<int> Filters the result set to only records related to the specified template groups.
templateSelectionIds List<int> Filters the result set to only records related to the specified template selections.

Authentication

API Key Test

Request Body

None

Response body on failure

{
    "message": "Forbidden"
}

Response body on success

Access token was valid

Description

This endpoint helps you test that your access tokens are set in your header correctly. This endpoint does not require you to be authenticated. If you POST to it with your access token configured correctly it will tell you that your token is valid. Otherwise it will respond with a forbidden message. This is a great place to start your api development!

Filters Honored

None

Returns

On Success

A string indicating your API key was valid.

Get Login Token

Your request body should look like

{
    "username": "me@domain.tld",
    "password": "password"
}

You will receive a JSON response like

{
    "accessToken": "9f57c00f-a92d-49e5-86fd-0052b56e0161",
    "userName": "me@domain.com",
    "issued": "9/3/2020 11:17:40 PM",
    "expires": "9/6/2020 11:17:40 PM"
}

Description

Given a valid Vendor login returns an access token authenticating you for data retrieval. Tokens are good for three days from generation. It is worth noting that all credentials for an organization are not created equal as what data you can retrieve is tied to the credentials permissions within that organization.

Filters Honored

None

Returns

On Success

An object containing your access token.

On Error

HTTP Code Error Code Definition
403 INVALID_LOGIN Your username or password was incorrect.

Organizations

Get Organizations

Request body

{
  // optional list of IDs for the organizations you want to retrieve
  "requestFilter": {
    "organizationIds": []
  }
}

Response body

[
  {
    "Id": 1,
    "AdministrativeOrganizationId": 3,
    "Name": "Generic Vending",
    "Address": "123 Some St. Anytown, USA 12345",
    "Contact": "John Smith",-
    "Type": "Manager"
  }
]

Description

Returns a set of organizations.

Filters Honored

Returns

On Success

The requested set of organizations.

Model Definitions

Organization Definition

Attribute Type Description
id int Organization Id.
administrativeOrganizationId int Managing organization.
name string Organization name.
address string Organization address.
contact string Organization Point of Contact's name.
type string Indicates whether this organization is a client or owner organization.

Accounts

Get Accounts

Request body

{
    "requestFilter": {
      "organizationIds": [3],
      "accountIds": []
    }
}

Response body

[
    {
        "Id": 2,
        "Name": "John Vending",
        "VendorOrgId": 3,
        "ClientOrgId": 13,
        "IsVisible": true,
        "Contact": "Jane Smith",
        "TimeZone": null
    },
    {
        "Id": 3,
        "Name": "Smith Vending",
        "VendorOrgId": 3,
        "ClientOrgId": null,
        "IsVisible": true,
        "Contact": "Tom Smith",
        "TimeZone": null
    }
]

Description

Retrieves a list of accounts.

Filters Honored

Returns

On Success

The requested list of accounts.

Model Definitions

Account Definition

Attribute Type Description
id int JSON block ID
name string Name of the Account
vendorOrgId int Id of the Organization that manages the Account
clientOrgId int Account ID
isVisible bool Whether the Account is visible or not in the Client Portal
contact string Account Point of Contact
timeZone string Your accounts configured timezone

Sites

Get Sites

Request body

{
    "requestFilter": {
        "organizationIds": [3],
        "accountIds": [49,3],
        "siteIds": [205]
    }
}

Response body

[
    {
        "Id": 205,
        "AccountId": 49,
        "OrgId": 3,
        "Name": "ATS",
        "Contact": null,
        "CommissionPercentage": null,
        "IsActive": true,
        "TimeZone": "Pacific Standard Time",
        "IsEnabled": false,
        "MaxChargePrice": 5,
        "BillingAddress": "ATS\r\n6300 Merrill Creek Pkwy\r\nSuite A-100\r\nEverett, WA 98203",
        "ShippingAddress": "ATS\r\n6300 Merrill Creek Pkwy\r\nSuite A-100\r\nEverett, WA 98203",
        "MaximumMeterSalesJumpAllowed": 500,
        "CommissionTerms": "Net10",
        "ExternalAccountTerminalId": null
    }
]

Description

Get a list (or subset) of Sites belonging to an Organization.

Filters Honored

Returns

On Success

The requested set of sites.

Create Sites

Request Body

{
    "body":
    [
        {
            "Id": 196,
            "AccountId": 11,
            "OrgId": 3,
            "Name": "Clearwire4",
            "Contact": null,
            "CommissionPercentage": null,
            "IsActive": true,
            "TimeZone": "Pacific Standard Time",
            "IsEnabled": false,
            "MaxChargePrice": 5,
            "BillingAddress": "Clearwire\r\nPO Box 1726\r\nWoodinv, WA 98072",
            "ShippingAddress": "Clearwire\r\nPO Box 1726\r\nWoodinv, WA 98072",
            "MaximumMeterSalesJumpAllowed": 500,
            "CommissionTerms": "Net10",
            "ExternalAccountTerminalId": null
        }
    ]
}

Response body

// This is a list of the created site's IDs
[
  1673
]

Description

Creates a new Site within a specified Account. Below are the required fields and anything not filled out will be created as null.

Filters Honored

None.

Returns

On Success

The ids of the created sites.

On Error

HTTP Code Error Code Definition
400 NAME_UNIQUENESS Site names must be unique at the account level when updating or creating. See the error message for what names caused the issue.
422 SITE_VALIDATION One or more of your sites failed validation. See the error message for more detailed information.

Update Sites

Request body

{
    "body":
    [
        {
            "Id": 196,
            "AccountId": 11,
            "OrgId": 3,
            "Name": "Clearwire5",
            "Contact": null,
            "CommissionPercentage": null,
            "IsActive": true,
            "TimeZone": "Pacific Standard Time",
            "IsEnabled": false,
            "MaxChargePrice": 5,
            "BillingAddress": "Clearwire\r\nPO Box 1726\r\nWoodinv, WA 98072",
            "ShippingAddress": "Clearwire\r\nPO Box 1726\r\nWoodinv, WA 98072",
            "MaximumMeterSalesJumpAllowed": 500,
            "CommissionTerms": "Net10",
            "ExternalAccountTerminalId": null
        }
    ]
}

Response body

// 204 - No Content

Description

Updates the specified site(s). Below are the required fields and anything not filled out will be created as null. Changes to the isEnabled flag will be disregarded, please use the un/delete routes instead.

Filters Honored

None.

Delete Sites

Request body

{
    "requestFilter": {
        "siteIds": [153]
    }
}

Response body

[
    153
]

Description

Delete the specified site(s).

Filters Honored

Returns

On Success

The IDs of the deleted sites.

Undelete Sites

Request body

{
    "requestFilter": {
        "siteIds": [153]
    }
}

Response body

[
    153
]

Description

Undelete the specified site(s).

Filters Honored

Returns

On Success

The IDs of the undeleted sites.

Model Definitions

Site Definition

Attribute Type Required Description
id int On updates. JSON block ID
accountId int Yes Account ID that the Site belongs to
orgId int Yes Organization ID that the Site belongs to
name string Yes Name of the Site
contact string No Name of the Point of Contact for the Site
commissionPercentage int No For internal use.
isActive bool Yes Indicates whether the Site is active or inactive
timeZone string No Time zone that the Site is set to
isEnabled bool Yes Indicates whether the Site is enabled in Client UI. This is readonly, please use the delete/undelete routes.
maxChargePrice int Yes Maximum charge anticipated for machines assigned to Site
billingAddress string No Billing address for the Site
shippingAddress string No Shipping address for the Site
maximumMeterSalesJumpAllowed int Yes Maximum meter sales jump allowed
commissionTerms string Yes Commission terms period. See below for valid options.
externalAccountTerminalId string No ID to configure Site with external POS system

Valid CommissionTerms values:

Machines

Get Machines

Request body

{
  "requestFilter": {
    "organizationIds": [],
    "accountIds": [],
    "siteIds": [],
    "machineIdentifiers": [],
    "includeDeleted": false
  }
}

Response body

[
  {
    "id": 1166,
    "assetId": 318,
    "organizationId": 1,
    "siteId": 1,
    "typeId": 0,
    "machineMasterId": 0,
    "forceUpdate": false,
    "prose": null,
    "name": " - ROSEV0000000875",
    "modelNumber": "",
    "taxPercentage": 0.0,
    "commissionPercentage": 0.0,
    "callInCode": "U3EA142DP4",
    "creditProcessingFee": 0.0,
    "bluetoothId": null,
    "externalAccountsTerminalId": 0,
    "createdAt": "2014-08-06T09:56:58.55",
    "provisionedAt": "0001-01-01T00:00:00",
    "canRollbackFirmware": false,
    "ignoreDoorState": false,
    "controllerFirmware": {
      "current": null,
      "pendingUpdate": null
    },
    "pcFirmware": {
      "current": null,
      "pendingUpdate": null
    },
    "hasPlanogramChange": true,
    "enableAccountSales": false,
    "enableCashSales": false,
    "enableCreditSales": false,
    "mode": "unknown",
    "isVisible": true,
    "enableSlotCountTracking": true,
    "useInternetPricing": false,
    "hardwareSettingsChanged": true,
    "usePlangramPrice": false,
    "useMachineTaxRate": false,
    "useMachineCommissionRate": false,
    "lastHeartBeat": {
      "server": "0001-01-01T00:00:00",
      "local": "0001-01-01T00:00:00"
    },
    "lastCashSale": {
      "server": "0001-01-01T00:00:00",
      "local": "0001-01-01T00:00:00"
    },
    "lastCreditSale": {
      "server": "0001-01-01T00:00:00",
      "local": "0001-01-01T00:00:00"
    },
    "lastAccountSale": {
      "server": "0001-01-01T00:00:00",
      "local": "0001-01-01T00:00:00"
    },
    "latestRestockToPicklist": {
      "server": "2015-04-22T10:53:20.883",
      "local": "2015-04-22T10:53:17.617"
    },
    "offerSmsReceipts": 0
  }
]

Description

Retrieves a set of machines.

Filters Honored

Returns

On Success

The requested list of machines.

Get Machine Models

Request body

// N/A

Response body

[
    {
        "id": 1,
        "number": "VCController",
        "description": "VendNovation Controller",
        "supportsAlphaNumericMapping": false
    }
]

Description

Returns a list of machine models.

Filters Honored

None.

Returns

On Success

The list of machine models.

Model Definitions

Machine Definition

Attribute Type Read Only Description
id int true Machine ID.
assetId int false Link to Asset.
organizationId int true Link to Owner Organization.
siteId int false Link to Site (change this to move the machine).
typeId int false Link to MachineType.
machineMasterId int true Describes relationship to primary machine.
controllerFirmware FirmwareVersion false Describes the current firmware version of the controller board as well as the version of the pending update (if any).
pcFirmware FirmwareVersion false Describes the current firmware version of the PC as well as the version of the pending update (if any).
forceUpdate bool false Indicates if machine should download settings on next check in instead of it's normal update window.
prose string true The machine's PROSE.
name string false Location the physical machine is at, commonly used as a name field.
modelNumber string true Model Number of the machine -used for mapping of selections.
taxPercentage float false Tax percentage, only applied if UseMachineTaxRate is true.
commissionPercentage float false Commission percentage, only applied if UseMachineCommissionRate is true.
hasPlanogramChange bool false Indicates if the planogram has changed and the machine needs to download those changes.
callInCode string true Call in code for provisioning.
enableAccountSales bool false Indicates if machine should accept account sales.
enableCashSales bool false Indicates if machine should accept cash sales.
enableCreditSales bool false Indicates if machine should accept credit sales.
mode MachineMode false Specifies the machine sales mode. See the enum definition for accepted options
isVisible bool true Indicates if the machine is discoverable.
enableSlotCountTracking bool false If set to false inventory will not be debited when a vend occurs and inventory will not be tracked.
useInternetPricing bool false Indicates if the machine should use pricing from web-based configurations instead of the local controller. Further refined by usePlanogramPrice to indicate pricing source.
hardwareSettingsChanged bool false Indicates hardware settings have changed and will be downloaded by controller when it is next online.
creditProcessingFee decimal false Flat up-charge fee incurred with all credit sales (if enabled at the org level).
usePlanogramPrice bool false Indicates if planogram pricing should be used instead of machine pricing. Only in effect if UseInternetPricing is also true.
useMachineTaxRate bool false Indicates if the machine level tax rate should be used instead of the planogram's for tax calculations. Only in effect if UseInternetPricing is true, otherwise tax rate is not calculated.
useMachineCommissionRate bool false Indicates if the machine level commission rate should be used instead of the planogram's. Only in effect if UseInternetPricing is true, otherwise commission is not calculated.
externalAccountsTerminalId int false The ID that external orgs can use to map the machine to a meaningful value.
lastHeartBeat TimeStamp true A timestamp storing the time of the most recent heartbeat reported to the server.
lastCashSale TimeStamp true A timestamp storing the time of the most recent cash sale.
lastCreditSale TimeStamp true A timestamp storing the time of the most recent credit sale.
lastAccountSale TimeStamp true A timestamp storing the time of the most recent account sale.
latestRestockToPicklist TimeStamp true A timestamp storing the time of the most recent restock.
createdAt DateTime true The server time the machine was created at.
provisionedAt DateTime true The server time the machine was provisioned at.
offerSmsReceipts SmsReceiptMode false An enumeration of configuration options for SMS receipts for transactions. See the enum definition for accepted options.
canRollbackFirmware bool false Indicates if machine should allow downgrading of firmware versions. This will be true, the machine will rollback, then it will be false again.
ignoreDoorState bool false Indicates if a vend is considered completed before the door is closed.

Submodels

Here are the definitions of the sub-models used in the machine model.

TimeStamp

Name Readonly Meaning
local true The local time of the event.
server true The server time of the event.

FirmwareVersion

Name Readonly Meaning
current true The current version of firmware being run on the device.
pendingUpdate false The firmware version the machine will update to (if any). Once the update occurs the value will revert to null.

Enumerations

Here are the values and meanings of the various enumerations in the machine model.

MachineMode

Default value is purchase.

Name Setting Effect
dex Sets machine master sales calculations to DEX mode, which requires pulling DEX data to record sales in our system.
invoice Sets machine to invoiced sales mode where some or all of the cost is billed to the machine owner later.
metered Generates sales by taking difference between meter readings on pick ticket records.
purchase Realtime sales treated as master sales. Unless you have specific reason to, we recommend using this mode.
unknown Fallback option for invalid configurations in the database.

SmsReceiptMode

Default value is noReceipts.

Name Setting Effect
noReceipts SMS receipts will not be sent with any transaction type.
creditOrAccountSales An sms receipt will be sent for credit and account sales.
cashCreditOrAccountSales Cash, credit, and account sales will send SMS receipts.

Machine Model Definition

Name Type Definition
id int The machine model's unique identifier.
number string The model number.
description string A description of the model.
usesAlphaNumericMapping bool Indicates if a machine supports alpha numeric mappings such as A1 in addition to purely numeric mappings.

Selections

Get Selections

Request body

{
  "requestFilter": {
    "organizationIds": [],
    "accountIds": [],
    "siteIds": [],
    "machineIdentifiers": [],
    "selectionIds": [],
    "includeDeleted": false
  }
}

Response body

[
  {
    "id": 3345,
    "machineId": 418,
    "productId": 424,
    "price": 0.7,
    "invoicePrice": 0.0,
    "restockTo": 10,
    "depth": 10,
    "count": 7,
    "isActive": false,
    "alertLevel": null,
    "restockAt": null,
    "freeCount": 0,
    "tax": 0.0,
    "commission": 0.0,
    "selectionNumber": "1",
    "friendlyNumber": "1"
  }
]

Description

Return a list (or a subset) of Organizations the user has access to.

Filters Honored

Returns

On Success

The requested set of selections.

Model Definition

Selection Definition

Attribute Type Read Only Description
id int true Selection ID.
machineId int true Link to Machine.
productId int false Link to the Product in the selection.
price decimal false The price of the selection.
invoicePrice decimal false If invoicing is enabled, cost added per product in selection to the invoice.
restockTo int false The level to which a selection should be restocked to. Must be 0 <= restockTo <= depth.
depth int false The maximum quantity of product the selection can hold.
count int false The quantity of product currently in the selection.
isActive bool false Determines if the selection is active. Primarily indicates if we believe there may be a problem with the motor for this selection.
alertLevel int false Level at which an alert will be generated. Must be 0 <= alertLevel <= restockAt.
restockAt int false The level at which product should be restocked. Must be alertLevel <= criticalLevel <= restockTo.
freeCount int false The quantity of product available in selection to be dispensed for free.
tax decimal? false Tax percentage, only applied if machine.useMachineTaxRate is false and organization.ChargeTax is true.
commission decimal false Commission percentage, only applied if machine.useMachineCommissionRate is false.
selectionNumber string false Hardware based selection identifier.
friendlyNumber string true Custom mapping for selectionNumber (such as A1).

Alerts

Get Alerts

Request body

{
  "routeFilter": {
    "alertIds": [],
    "alertCodes": [],
    "isUserClearable": false,
    "raisedAtStart": "2010-11-12T13:14:15Z",
    "raisedAtEnd": "2010-11-12T13:14:15Z",
    "clearedAtStart": "2010-11-12T13:14:15Z",
    "clearedAtEnd": "2010-11-12T13:14:15Z"
  },
  "requestFilter": {
    "organizationIds": [],
    "accountIds": [],
    "siteIds": [],
    "machineIdentifiers": [],
    "includeDeleted": false
  }
}

Response body

[
  {
    "id": 36578,
    "accountId": 161,
    "siteId": 477,
    "machineLocation": "Lunchroom - Soda",
    "machineProse": null,
    "machineId": 1402,
    "code": "NS",
    "message": "No Sales have been reported by this machine for at least 3 day(s).",
    "isCleared": false,
    "clearedAt": null,
    "raisedAt": "2021-03-29T15:56:41.677"
  }
]

Description

Return a list (or a subset) of Alerts the user has access to.

Filters Honored

Returns

On Success

The requested set of alerts.

Clear Alerts

Request body

{
  "routeFilter": {
    "alertIds": []
  }
}

Response body

// No respose body

Description

Clear the specified alerts that the user has access to.

Filters Honored

Returns

On Error

HTTP Code Error Code Definition
400 ALREADY_CLEARED One or more of the alerts you wanted to clear are already cleared.
422 UNCLEARABLE You tried to clear one ore more unclearable alerts.

Model Definitions

Alert Filter

The alerts route takes in an optional object to provide further filtering. Fields and meanings are:

Name Type Meaning
alertIds List<int> Filter result set to only alerts whose IDs are in the list.
alertCodes List<string> Filter result set to only alerts whose code is in the list.
isUserClearable bool? Filter result set to only alerts who are/are not user clearable.
raisedAtStart DateTime? Filter result set to only alerts that were raised after the specified UTC DateTime.
raisedAtEnd DateTime? Filter result set to only alerts that were raised before the specified UTC DateTime.
clearedAtStart DateTime? Filter result set to only alerts that were cleared after the specified UTC DateTime.
clearedAtEnd DateTime? Filter result set to only alerts that were cleared before the specified UTC DateTime.

Alert Definition

Name Type Meaning
id int A unique identifying integer.
accountId int The unique ID of the account the alert belongs to.
siteId int The unique ID of the site the alert belongs to.
machineId int The unique ID of the machine the alert belongs to.
machineLocation string The name of the machine that raised the alert.
machineProse string The prose of the machine that raised the alert.
code string A shorthand identifier for the alerts message.
message string A user friendly description of the issue the alert represents.
isCleared bool Indicates if the alert has already been cleared.
clearedAt string A UTC date time string indicating when the alert was cleared.
raisedAt string A UTC date time string indicating when the alert was raised by our system.

Reports

Get Transactions

Request body

{
    "requestFilter": {
        "organizationIds": [1],
        "accountIds": [1],
        "siteIds": [1],
        "machineIdentifiers": ["1", "PROSE123456789"],
        "startDate": "2021-11-15T18:07:05.477",
        "endDate": "2021-11-15T18:07:05.477"
    },
    "routeFilter": {
        "transactionIdentifiers": ["B1488"]
    }
}

Response body

[
    {
        "id": "B1467",
        "recordedAtUtc": "2021-11-16T22:51:35.16",
        "siteId": 1658,
        "siteExternalId": "",
        "siteName": "Khadeer 1",
        "machineId": 11252,
        "machineExternalId": null,
        "machineName": "Khadeer Machine 1",
        "machineModel": "VCController_10_10_69",
        "totalPrice": 1.0000,
        "totalTax": 0.0,
        "lineItems": [
            {
                "id": 3527998,
                "selection": "10",
                "vendOrder": 1,
                "productId": 18333,
                "productName": "Chicken",
                "productUpc": "9046d33f79574eb9af9abf827e6c292d",
                "size": "1 fl. oz.",
                "taxRate": 0.0,
                "taxCharged": 0.0,
                "commission": 0.0,
                "quantity": 1,
                "unitPrice": 1.0000,
                "totalPrice": 1.0000,
                "vendWasSuccessful": true,
                "recordedAtUtc": "2021-11-16T22:51:35.193",
                "occurredAtUtc": "2021-11-16T22:51:31",
                "occurredAtLocalTime": "2021-11-16T10:51:31"
            }
        ],
        "paymentInformation": {
            "type": "A ",
            "creditInformation": {
                "gateway": "A",
                "invoiceNumber": 511005,
                "cardToken": null,
                "authorizationNumber": null,
                "referenceNumber1": "",
                "referenceNumber2": null,
                "paymentStatus": "charged"
            },
            "accountInformation": {
                "accountNumber": "1234",
                "nameOnAccount": "Bobbin Bob"
            }
        }
    }
]

Description

Retrieves a set of transactions.

Note that your datetime filters will be clamped to a maximum range of a month following the processes laid out in DateTime Handling. Page sizes larger than 100 will be clamped down for performance reasons.

Filters Honored

Returns

On Success

The requested list of transactions.

Get Transaction Metadata

Request body

{
    "requestFilter": {
        "organizationIds": [1],
        "accountIds": [1],
        "siteIds": [1],
        "machineIdentifiers": ["1", "PROSE123456789"],
        "startDate": "2021-11-15T18:07:05.477",
        "endDate": "2021-11-15T18:07:05.477"
    },
    "routeFilter": {
        "transactionIds": ["B1488"]
    }
}

Response body

[
    {
        "transactionId": "B1467",
        "recordedAtUtc": "2021-11-16T22:51:35.16",
        "tags": [],
        "files": [],
        "lineItems": [
            {
                "lineItemId": 3527998,
                "recordedAtUtc": "2021-11-16T22:51:35.193",
                "occurredAtUtc": "2021-11-16T22:51:31",
                "occurredAtLocal": "2021-11-16T10:51:31",
                "tags": [],
                "files": []
            }
        ]
    }
]

Description

Retrieves a set of transaction metadata.

Note that your datetime filters will be clamped to a maximum range of a month following the processes laid out in DateTime Handling. Page sizes larger than 100 will be clamped down for performance reasons.

Filters Honored

Returns

On Success

The requested list of transactions.

Get Inventory Adjustment Events

Request body

{
    "requestFilter": {
        "organizationIds": [1],
        "accountIds": [1],
        "siteIds": [1],
        "machineIdentifiers": ["1", "PROSE123456789"],
        "startDate": "2021-11-15T18:07:05.477",
        "endDate": "2021-11-15T18:07:05.477"
    },
    "routeFilter": {
        "transactionIds": ["B1488"]
    }
}

Response body

[
    {
        "id": "B1625",
        "adjustmentOccurredAt": "2021-12-15T01:11:24.36",
        "takeOccurredAt": "2021-12-15T01:11:24",
        "siteId": 567,
        "siteExternalId": "babc188c-a1e5-4ea2-9648-93dbd8c422dd",
        "machineId": "11398",
        "machineExternalId": null,
        "selection": "132",
        "productId": "49998",
        "userId": 0,
        "externalUserIdentifier": null,
        "adjustmentSize": 1,
        "newStockLevel": 83
    }
]

Description

Retrieves a set of inventory adjustment events.

Note that your datetime filters will be clamped to a maximum range of a month following the processes laid out in DateTime Handling.

Filters Honored

Returns

On Success

The requested list of inventory adjustment events.

Model Definitions

Transaction Definition

Unless otherwise stated. Data reflects values as of time of data retrieval, not at time of transaction.

Attribute Type Description
id string The transactions unique identifier.
recordedAtUtc DateTime The date time the server recorded the transaction.
siteId int The ID of the site the transaction occurred at.
siteExternalId string An identifier that you, the user, may give to the site.
siteName string The name of the site at the time the the transaction occurred. This is a historical value as sites can be renamed or machines can be moved. As a result, this may not reflect the machine's current assignment.
machineId int The ID of the machine that generated the transaction.
machineExternalId string An identifier that you, the user, may give to the machine.
machineName string The name of the machine at the time the the transaction occurred. This is a historical value as machines can be renamed. As a result, this may not reflect the machine's current name.
machineModel string The machine's model number as reported by the machine.
totalPrice decimal The sum price of the transaction. This includes tax charged.
totalTax decimal The sum of all tax charged for this transaction.
lineItems List<LineItem> A list of items selected by the user in this transaction. Identical products may or may not have individual line items depending on your machine configuration. To confirm how many items vended, check the line item's quantity field.
paymentInformation PaymentInformation An object containing all payment information recorded during the transaction.

Line Item Definition

Unless otherwise stated. Data reflects values as of time of data retrieval, not at time of transaction.

Attribute Type Description
id string The line item's unique identifier.
selection string The historical selection number of the vended product.
vendOrder int Indicates when during the transaction the product was vended (1st, 2nd, 3rd).
productId int The ID of the vended product.
productName string The name of the vended product.
productUpc string The UPC of the vended product.
size string User specified descriptive sizing information about the product, such as "six pack".
taxRate float The tax rate charged on the specified product. 9% would be represented as 9.
taxCharged decimal The amount of tax charged for this line item.
totalPrice decimal The amount charged for this line item. Note that this is a total based on the quantity vended in the line item, not the price per unit.
vendWasSuccessful bool Indicates if the line item successfully vended.
totalTax decimal The sum of all tax charged for this transaction.
recordedAtUtc DateTime The date and time that the server recorded the vending of the line items.
occurredAtUtc DateTime The date and time the machine vended the line item.
occurredAtLocal DateTime The local date and time the machine vended the line item.

Payment Information Definition

Attribute Type Description
type string A string indicating the type of payment processed. Possible values are Credit, Cash, Account, Unknown.
creditInformation CreditInformation? If the sale was a credit sale this will contain all of the relevant information.
accountInformation AccountInformation? If the sale was an account sale this will contain all of the relevant information.

Credit Information Definition

Attribute Type Description
gateway string The configured gateway for credit card information.
invoiceNumber string A unique identifier for this charge.
cardToken string Secure token that references the card used in the transaction.
authorizationNumber string An approval number generated by the gateway.
referenceNumber1 string Identifier generated by the gateway.
referenceNumber2 string Identifier generated by the gateway.
paymentStatus string Indicates the status of payment for this transaction. Valid values are authorized, charged, void, error, and unknown. Unknown will only be returned when a new type has been added to the database but is not yet supported by the api.

Account Information Definition

Attribute Type Description
accountNumber string The account number that was charged for the transaction.
nameOnAccount string The name of the payee as on the account.

Transaction Metadata

Attribute Type Description
transactionId int The id of the transaction the metadata is associated with.
recordedAtUtc DateTime The date time that the transaction was recorded by the server.
tags List<Tag> Metadata associated with the transaction.
files List<TransactionMetadataFile> A list of objects containing information about the files (if any) related to the transaction.
lineItems List<LineItemMetaData> A list of metadata information about the transaction's line items.

Tag Definition

Attribute Type Description
key string The name that describes the meaning of the value.
value string The value of the tag.

File Definition

Attribute Type Description
id int The ID of the file.
type string The files type.
description string A description of the file.
createdAtUtc DateTime The date time that the file was created.

LineItemMetadata Definition

Attribute Type Description
lineItemId int The id of the line item the metadata is associated with.
recordedAtUtc DateTime The date time that the line item's vend was recorded by the server.
occurredAtUtc DateTime The date time that the line item's vend was recorded by the machine.
occurredAtLocal DateTime The local date time that the line item's vend was recorded by the machine.
tags List<Tag> Metadata associated with the line item.
files List<TransactionMetadataFile> A list of objects containing information about the files (if any) related to the line item.

Transaction Filter

Field Name Type Description
transactionIdentifiers List<string> A list of transaction identifiers. The format of identifiers may vary.

Inventory Adjustment Event Definition

Field Name Type Description
id int Records unique identifier.
eventType string Indicates what type of event the adjustment represents. Possible values are adjustment, take, stock.
adjustmentOccurredAt DateTime The UTC date time when the inventory adjustment was recorded.
takeOccurredAt DateTime? The UTC date time when the item was taken from the machine.
siteId int The ID of the site the event occurred at.
siteExternalId string The customer defined ID of the site the event occurred at.
machineId int The ID of the machine the adjustment event occurred at.
machineExternalId string The customer defined ID of the machine the adjustment event occurred at.
selection string Friendly selection number where the inventory adjustment occured.
productId int Unique internal product ID.
userId int The ID of the user who made the adjustment.
externalUserIdentifier string Placeholder for future use.
adjustmentSize int The amount of the change in inventory levels.
newStockLevel int The inventory level after the adjustment.

Products

Get Products

Request body

{
  "requestFilter": {
    "organizationIds": [],
    "productIds": []
  }
}

Response body

[
    {
        "productId": 967,
        "manufacturer": "Dixie",
        "brand": "Dixie",
        "name": "\"5 7/8\" Plates\"",
        "customData": null,
        "size": 250.0,
        "unitsForSize": "cnt",
        "container": null,
        "upc": null,
        "productImage": null,
        "nutritionImage": null,
        "cost": 11.3500,
        "defaultPrice": 0.0,
        "isACommonProduct": true,
        "vendSize": null,
        "calories": 864,
        "productGroup": "Coffee - Allied"
    }
]

Description

Return a list (or a subset) of Products the user has access to.

Filters Honored

Returns

On Success

The requested set of products.

Model Definitions

Product Definition

Attribute Type Read Only Description
id int true Product ID.
manufacturer string false The name of the manufacturer.
brand string false The name of the brand.
name string false The name of the product.
customData string false Container for customer specified extra data.
size float false The size of the product.
unitsForSize string false The units for the size, such as oz or pack.
container string false An enum that describes the products container. See the enum definition for accepted options.
upc string false The product's UPC.
productImage string false A link to the uploaded product image.
nutritionImage string false A link to the uploaded image of the product's nutritional facts.
cost decimal false The product's cost to the vendor.
defaultPrice decimal false The customer's price for the product unless overridden elsewhere (such as selection).
isACommonProduct bool false Indicates if a product is commonly used. An additional method for filtering products.
calories int false The number of calories per serving.
vendSize string false An enum that indicates the products general size. See the enum definition for accepted options.
productGroup string false An additional label for groups of products, such as "soda".

Product Enumerations

Container

Default value is unknown.

Name Meaning
unknown Invalid data or unspecified.
all None (tells the machine to vend as both bottle and can).
can Product is canned.
bottle Product is bottled.

VendSize

Default value is unknown.

Name Meaning
unknown Invalid data or unspecified.
small Product size is small.
medium Product size is medium.
bottle Product size is large.

Templates

Get Templates

Request body

{
    "requestFilter": {
      "organizationsId": [1]
    },
    "routeFilter": {
      "templateIds": [1, 2, 3],
      "templateGroupIds": [1]
    }
}

Response body

[
    {
        "id": 391,
        "organizationId": 1,
        "name": "name",
        "comment": "desc",
        "count": 0,
        "machineId": null,
        "createdAt": "2021-08-13T14:11:39.41"
    }
]

Description

Get a list (or subset) of Templates belonging to an Organization.

Filters Honored

Returns

On Success

The requested set of templates.

Create Template

Request body

{
    "body": [
        {
            "organizationId": 1,
            "name": "create test",
            "comment": null,
            "count": 0,
            "machineId": null
        }
    ]
}

Response body

// list of ids for created templates
[
  6
]

Description

Creates the specified templates.

Filters Honored

None.

Returns

On Success

The ID of the created templates.

Update Templates

Request body

{
    "body": [
        {
            "id": 406,
            "name": "create test",
            "comment": "updated comment",
            "count": 0,
            "machineId": null
        }
    ]
}

Response body

// echo back of the models you sent
[
    {
        "id": 406,
        "name": "create test",
        "comment": "updated comment",
        "count": 0,
        "machineId": null
    }
]

Description

Updates the specified template(s).

Filters Honored

None.

Delete Template

Request body

{
    "routeFilter": {
        "templateIds": [4]
    }
}

Response body

// 204 - No Content

Description

Deletes the specified template(s).

Filters Honored

Apply Template to Machines

Request body

{
    "requestFilter":{
        "machineIdentifiers": ["3533", "PROSE0123456789"]
    },
    "routeFilter": {
        "templateIds": [412]
    }
}

Response body

// 204 - No Content

Description

Apply the specified template to the specified machines. You MUST specifiy at least one template and one machine, and the template and all the machines must belong to the same organizaiton.

Filters Honored

Returns

On Error

HTTP Code Error Code Definition
422 NO_SELECTIONS One or more of the machines you attempted to apply a template to had no selections.
422 MULTIPLE_TEMPLATES You specified more than one template when trying to apply a template to machines.

Model Definitions

Template Definition

Attribute Type Description
id int Record's primary ID.
prgId int ID of the organization that the template belongs to.
name string Name of the template.
comment string? User defined comment/note about the role.
count int The number of selections associated with the template.
createdAt DateTime When the template was created.

Template Groups

Get Template Groups

Request body

{
    "requestFilter": {
      "organizationsId": [1]
    },
    "routeFilter": {
      "templateGroupIds": [1]
    }
}

Response body

[
    {
        "id": 6,
        "name": "Standard",
        "description": "Default Template Group",
        "createdAt": "2021-09-09T15:02:37.403",
        "organizationId": 25
    }
]

Description

Get a list (or subset) of template groups.

Filters Honored

Returns

On Success

The requested set of template groups.

Create Template Groups

Request body

{
    "body": [
        {
            "name": "create",
            "description": null,
            "organizationId": 1
        }
    ]
}

Response body

// list of ids for created templates
[
  6
]

Description

Creates the specified template group(s).

Filters Honored

None.

Returns

On Success

A list of id(s) representing the created template group(s).

Update Template Groups

Request body

{
    "body": [
        {
        "id": 3,
        "name": "create",
        "description": "updated description",
        "organizationId": 1
        }
    ]
}

Response body

// echo back of the models you sent
[
    [
        {
        "id": 3,
        "name": "create",
        "description": "updated description",
        "organizationId": 1
        }
    ]
]

Description

Updates the specified template group(s).

Filters Honored

None.

Returns

On Success

The updated template group(s).

Delete Template Groups

Request body

{
    "routeFilter": {
        "templateGroupIds": [4]
    }
}

Response body

// 204 - No Content

Description

Deletes the specified template group(s).

Filters Honored

Assign Machines to Template Groups

Request body

{
    "requestFilter": {
        "machineIdentifiers": ["5590"]
    },
    "routeFilter": {
        "templateGroupIds": [7]
    }
}

Response body

// 204 - No Content

Description

Assign one or more machines to a template group. Note, you MUST supply one and ONLY one template group id.

Filters Honored

Remove Machines from Template Group

Request body

{
    "requestFilter": {
        "machineIdentifiers": ["5590"]
    },
    "routeFilter": {
        "templateGroupIds": [7]
    }
}

Response body

// 204 - No Content

Description

Remove one or more machines from a template group. Note, you MUST supply one and ONLY one template group id.

Filters Honored

Assign Templates to Template Group

Request body

{
    "routeFilter": {
        "templateIds": [7],
        "templateGroupIds": [1]
    }
}

Response body

// 204 - No Content

Description

Assign one or more templates to a template group. This is a many-to-many assignment with all templates being assigned to all specified template groups, however all specified templates and template groups must belong to the specified organization.

Filters Honored

Remove Templates from Template Group

Request body

{
    "routeFilter": {
        "templateIds": [1],
        "templateGroupIds": [7]
    }
}

Response body

// 204 - No Content

Description

Remove one or more templates from a template group. Note, you MUST supply one and ONLY one template group id.

Filters Honored

Request body

{
    "routeFilter": {
        "templateIds": [1],
        "templateGroupIds": [7]
    }
}

Response body

[
    {
        "roleId": 7,
        "machineId": 0,
        "createdAt": "2021-09-14T18:39:27.747"
    }
]

Description

Returns a list of links between template groups and templates.

Filters Honored

Returns

On Success

A list of TemplateGroupToTemplateLinks.

Model Definitions

Template Group Definition

Attribute Type Description
id int Record's primary ID.
orgId int ID of the organization that the template group belongs to.
name string Name of the template group.
description string? User defined description of the template group.
createdAt DateTime When the template group was created.
Attribute Type Description
templateId int The template's ID.
templateGroupId int The template group's ID.
createdAt DateTime? The DateTime the TemplateGroupToTemplateLink was created at.

Template Selections

Get Template Selections

Request body

{
    "requestFilter": {
      "organizationsId": [1]
    },
    "routeFilter": {
      "templateIds": [1, 2, 3],
      "templateSelectionIds": [1]
    }
}

Response body

[
    {
        "id": 0,
        "variantId": null,
        "templateId": 408,
        "selectionNumber": 1,
        "productId": 44787,
        "price": 0.1000,
        "invoicePrice": 0.0000,
        "par": 10,
        "depth": 0,
        "commission": 0.0,
        "tax": 0.0,
        "customData1": null,
        "customData2": null,
        "customData3": null,
        "customData4": null,
        "customData5": null
    }
]

Description

Retrieve a set template selections belonging to an Organization.

Filters Honored

Returns

On Success

The requested set of set template selections.

Create Template Selections

Request body

{
    "body": [
        {
            "templateId": 2,
            "selectionNumber": 0,
            "productId": 0,
            "price": 0.0,
            "invoicePrice": 0.0,
            "par": 0,
            "depth": 0,
            "comission": null,
            "tax": null,
            "customData1": null,
            "customData2": null,
            "customData3": null,
            "customData4": null,
            "customData5": null
        }
    ]
}

Response body

// list of ids for created template selections
[
  6
]

Description

Creates the specified template selection(s).

Filters Honored

None.

Returns

On Success

The IDs of the created template selection(s).

Update Template Selections

Request body

{
    "body": [
        {
            "id": 11242,
            "templateId": 2,
            "selectionNumber": 0,
            "productId": 0,
            "price": 6.9,
            "invoicePrice": 0.0,
            "par": 0,
            "depth": 0,
            "comission": null,
            "tax": null,
            "customData1": null,
            "customData2": null,
            "customData3": null,
            "customData4": null,
            "customData5": null
        }
    ]
}

Response body

// the updated template selections
[
    {
        "id": 11242,
        "templateId": 2,
        "selectionNumber": 0,
        "productId": 0,
        "price": 6.9,
        "invoicePrice": 0.0,
        "par": 0,
        "depth": 0,
        "comission": null,
        "tax": null,
        "customData1": null,
        "customData2": null,
        "customData3": null,
        "customData4": null,
        "customData5": null
    }
]

Description

Updates the specified template selection(s).

Filters Honored

None.

Returns

On Success

The updated template selections.

Delete Template Selections

Request body

{
    "routeFilter": {
        "templateSelectionIds": [4]
    }
}

Response body

// 204 - No Content

Description

Deletes the specified template selection(s).

Filters Honored

Model Definitions

Template Selection Definition

Attribute Type Description
id int Record's primary ID.
variantId int? The ID of the product variant associated with the selection.
templateId int The ID of the template the selection belongs to.
selectionNumber int The number of the selection like 1
productId int The ID of the product assigned to the selection.
price decimal The price of the product for the customer.
invoicePrice decimal Price to be charged to customer after the fact.
createdAt DateTime When the template was created.
par int The quantity the selection should be restocked to.
depth int The maximum quantity the selection can hold.
commission float? The percentage of commission associated with the selection. 9% should be represented as .09.
tax float? The tax rate being charged. 9% should be represented as .09.
customData1 string? Additional customer defined data. Max length of 50.
customData2 string? Additional customer defined data. Max length of 50.
customData3 string? Additional customer defined data. Max length of 50.
customData4 string? Additional customer defined data. Max length of 50.
customData5 string? Additional customer defined data. Max length of 50.

Roles

Get Roles

Request body

{
    "requestFilter": {
      "organizationsId": [2]
    },
    "routeFilter": {
      "roleIdentifiers": [1, "test-role"]
    }
}

Response body

[
  {
      "organizationId": 2,
      "id": 5,
      "name": "create test",
      "description": "create test description"
  }
]

Description

Retrieve a set of roles.

Filters Honored

Returns

On Success

The requested set of roles.

Create Roles

Request body

{
    "body": [
        {
            "organizationId": 2,
            "name": "create test",
            "description": "create test description"
        }
    ]
}

Response body

// list of ids for created roles
[
  6
]

Description

Creates the specified Roles.

Filters Honored

None.

Returns

On Success

The IDs of the created roles.

Update Roles

Request body

{
    "body": [
        {
            "roleId": 2,
            "name": "update test",
            "description": "update test description"
        }
    ]
}

Response body

// echo back of the models you sent
[
    {
        "roleId": 2,
        "name": "update test",
        "description": "update test description"
    }
]

Description

Updates the specified roles.

Filters Honored

None.

Delete Roles

Request body

{
    "routeFilter": {
        "roleIdentifiers": [4]
    }
}

Response body

// 204 - No Content

Description

Deletes the specified roles.

Filters Honored

Check Role's Machine Access

Request body

{
    "requestFilter": {
        "machineIdentifiers": ["3283"]
    },
    "routeFilter": {
        "roleIdentifiers": [4]
    }
}

Response body

[
    {
        "roleName": "name",
        "roleId": 0,
        "prose": "PROSE012346789", // will be null if you specified an id for this machine
        "machineId": 0, // will always be present
        "canAccess": false
    }
]

Description

Given a list of machine identifiers and a list of role names (or IDs), return a list of MachineAccessResponses (one per each unique role ID/name and machine combo) indicating if each role has access to each machine.

Filters Honored

Returns

On Success

A list of role to machine mappings with a boolean indicating if that role can access that machine.

Get Role's Rights at Machine

Request body

{
    "requestFilter": {
        "machineIdentifiers": ["3283"]
    },
    "routeFilter": {
        "roleIdentifiers": [4]
    }
}

Response body

{
  "1": [1, 2, 3]
}

Description

Given a list of machine identifiers and a list of role names (or IDs), returns the cumulative list of all rights granted by all the specified roles, at the specified machine.

Filters Honored

Returns

On Success

Return format is Dictionary<int, List<int>>, where the key is the machine ID and the list is the granted right IDs.

Assign Role To Machine

Request body

{
    "requestFilter": {
        "organizationIds": [],
        "machineIdentifiers": ["3283"]
    },
    "routeFilter": {
        "roleIdentifiers": [1, 2, 3]
    }
}

Response body

// 204

Description

Assign one or more roles to one or more machines. All roles and machines must belong to the same organization.

Filters Honored

Unassign Roles from Machines

Request body

{
    "requestFilter": {
        "machineIdentifiers": ["3283"]
    },
    "routeFilter": {
        "roleIdentifiers": [4]
    }
}

Response body

// No content

Description

Unassign one or more roles from one or more machines. All roles and machines must be in the same organization.

Filters Honored

Request body

{
    "requestFilter": {
        "machineIdentifiers": ["3283"]
    },
    "routeFilter": {
      "roleIdentifiers": [  1, 2, 3 ]
    }
}

Response body

[
    {
        "roleId": 3,
        "machineId": 3283,
        "createdAt": "2021-11-01T23:56:57.22"
    },
    {
        "roleId": 2,
        "machineId": 3283,
        "createdAt": "2021-11-01T23:56:57.22"
    },
    {
        "roleId": 1,
        "machineId": 3283,
        "createdAt": "2021-11-01T23:56:57.217"
    }
]

Description

Returns a list of links between machines and roles.

Filters Honored

Returns

On Success

A list of RoleToMachineLinks.

Model Definitions

Role Definition

Attribute Type Description
id int Record's primary ID.
orgId int ID of the organization that the role belongs to.
name string Name of the role.
description string User defined description of the role.
Attribute Type Description
roleId int The role's ID.
machineId int The machine's ID.
createdAt DateTime? The DateTime the RoleToMachineLink was created at.

Role Rights

Role rights link user defined roles to statically defined rights.

Get Role Rights

Request body

{
    "requestFilter": {
      "organizationsId": [2]
    },
    "routeFilter": {
      "roleRightIds": [1, 2]
    }
}

Response body

[
    {
        "id": 0,
        "roleId": 0,
        "rightId": 0,
        "canView": false,
        "canEdit": false,
        "canExecute": false
    }
]

Description

Retrieve a set of role rights.

Filters Honored

Returns

On Success

The requested set of role rights.

Create Role Rights

Request body

{
    "body": [
            {
                "roleId": 0,
                "rightId": 0,
                "canView": false,
                "canEdit": false,
                "canExecute": false
            }
    ]
}

Response body

// list of ids for created roles
[
  6
]

Description

Creates the specified role right(s).

Filters Honored

None.

Returns

On Success

Update Role Rights

Request body

{
    "body": [
          {
             "id": 0,
              "canView": false,
              "canEdit": false,
              "canExecute": false
          }
    ]
}

Response body

// echo back of the models you sent
[
    {
       "id": 0,
        "canView": false,
        "canEdit": false,
        "canExecute": false
    }
]

Description

Updates the specified Role Rights. Note that if you set all three permissions to false your role right will instead be deleted resulting in a smaller result set than you might expect.

Filters Honored

None.

Delete Role Rights

Request body

{
    "routeFilter": {
        "roleRightIds": [4]
    }
}

Response body

// 204 - No Content

Description

Deletes the specified Role Rights.

Filters Honored

Model Definitions

Role Right Definition

Attribute Type Description
id int Record's primary ID.
roleId int The role ID this right refers to.
rightId int The right being linked to the specified role.
canView bool Can view what the associated right is.
canEdit bool Can edit what the associated right is.
canExecute bool Can do what the associated right is.

Rights

Get Rights

Request body

{
    "routeFilter": {
      "roleIdentifiers": [1, "test-role"],
      "rightIds": [1]
    }
}

Response body

[
    {
        "id": 0,
        "name": null,
        "description": null
    }
]

Description

Retrieve a set of rights.

Filters Honored

Returns

On Success

The requested set of rights.

Model Definitions

Right Definition

Attribute Type Description
id int Record's primary ID.
name string Name of the right.
description string Description of the right.

Sessions

Get Sessions

Request body

{
    "requestFilter": {
        "organizationIds": [3],
        "startDate": "2022-08-31T20:04:33.623",
        "endDate": "2022-08-31T20:04:33.62"
    },
    "routeFilter": {
      "sessionIds": [1]
    }
}

Response body

[
    {
        "id": 16,
        "machineId": 0,
        "startedAt": "2022-08-31T20:04:33.623",
        "loginId": "troyc@vendnovation.com",
        "reason": null,
        "loginWasSuccessful": true,
        "endedAt": null,
        "wasForciblyClosed": true,
        "source": "Web",
        "organizationId": 1
    }
]

Description

Get a list (or subset) of Sessions belonging to an Organization.

Filters Honored

Returns

On Success

The requested set of Sessions.

Create Session

Request Body

{
    "body":
    [
        {
            "id": 0,
            "machineId": 0,
            "startedAt": "2022-08-31T20:04:33.623",
            "login": "example@example.com",
            "reason": null,
            "loginWasSuccessful": true,
            "endedAt": null,
            "wasForciblyClosed": false,
            "source": "Web",
            "organizationId": 1
        }
    ]
}

Response body

// This is a list of the created session's IDs
[
  1673
]

Description

Creates a new Session within a specified Organization.

Filters Honored

None.

Returns

On Success

The ids of the created Session.

On Error

HTTP Code Error Code Definition
403 UNAUTHORIZED_DATA_ACCESS You do not have access to one of the organizations you attempted to create a session in.

Update Session

Request body

{
    "body":
    [
        {
            "id": 0,
            "machineId": 0,
            "startedAt": "2022-08-31T20:04:33.623",
            "login": "example@example.com",
            "reason": null,
            "loginWasSuccessful": true,
            "endedAt": null,
            "wasForciblyClosed": false,
            "source": "Web",
            "organizationId": 1
        }
    ]
}

Response body

// 204 - No Content

Description

Updates the specified session(s). Note that changes to organizationId and startedAt will be ignored.

Filters Honored

None.

Session Events

Get SessionEvents

Request body

{
    "requestFilter": {
        "organizationIds": [3],
        "startDate": "2022-08-31T20:04:33.623",
        "endDate": "2022-08-31T20:04:33.62"
    },
    "routeFilter": {
      "sessionIds": [1],
      "sessionEventIds": [1]
    }
}

Response body

[
    {
        "id": 1,
        "sessionIdId": 1,
        "loggedAt": "2022-08-31T20:04:33.623",
        "eventType": "Login",
        "data": ""
    }
]

Description

Get a list (or subset) of session events belonging to a session.

Filters Honored

Returns

On Success

The requested set of session events.

On Error

HTTP Code Error Code Definition
403 UNAUTHORIZED_DATA_ACCESS You do not have access to one of the organizations you attempted to create a session in.

Model Definitions

Session Definition

Attribute Type Description
id int JSON block ID
machineId int? The ID of the Machine that the Session occurred at. Will be null for sessions originating from non-machine locations.
organizationId int Organization ID that the Session belongs to
startedAt DateTime The timestamp of when the session was started.
login string The login of the person who started the session.
reason string The user specified reason the session was started.
loginWasSuccessfull bool Indicates whether the users login was valid.
endedAt DateTime? The timestamp of when the session ended.
wasForciblyClosed bool? Indicates whether the session was forcibly closed.
source string The origin of the session.

SessionEvent Definition

Attribute Type Description
id int JSON block ID
sessionId int The ID of the Session that the SessionEvent belongs to.
eventType string The type of event this is.
startedAt DateTime The timestamp of when the session was started.
additionalData string Information associated with the event.
loggedAt DateTime The DateTime the event occurred at.

SessionFilter

Attribute Type Description
sessionIds int The IDs of the sessions that you want to retrive.
sessionId int The ID of the Session that the SessionEvent belongs to.

© 2020- VendNovation, LLC - Proprietary and confidential. Do not distribute without express permission.