NAV
javascript

HotSchedules IoT Platform for Developers

Restaurant operators need access to data that helps them work more productively and efficiently. Your job is to deliver it. The HotSchedules IoT Platform for Developers can help you deliver work more productively and efficiently through a set of software modules that collect data from virtually any source in real-time and then deliver select data that is relevant, timely and actionable.

Whether you work for a restaurant, a software company or for yourself - wherever you are, whatever you do - IoT Platform gives you the power to innovate faster and cheaper than ever before.

Getting Started

This documentation is intended for the developer wanting to integrate into the HotSchedules IoT (Internet of Things) Platform by:

The IoT Platform calls accounts namespace. A namespace is your secured storage location of HotSchedules’ cloud solution for your business. Your namespace is uniquely named based on your organization name. When you sign up through the HotSchedules IoT Platform Developer Portal, you will be able to create both a namespace and users to access that namespace.

The HotSchedules IoT Platform Developer Portal has an easy sign up process to quickly get started developing your application for the IoT Platform. In just a few short clicks, your IoT platform application development can begin.

IoT Platform APIServer

Overview

The HotSchedules IoT Platform APIServer is a set of secure REST APIs that are used to store your data.

The foundation for this document is the Mongo DB reference located at http://docs.mongodb.org/manual/reference/operator/.

Users may be unfamiliar with the REST query syntax. Those familiar with SQL should note that the same types of SQL query operations are possible using the REST API. Users wishing to understand the mapping between SQL queries (SELECT statements) and the Query syntax - should refer to the following document: http://docs.mongodb.org/manual/reference/sql-comparison/.

Getting Started

To access the HotSchedules IoT Platform Cloud API, you need to login with you user and password which is provided by HotSchedules. The API docs are available at this location: https://api.bodhi.space/apidocs/index.html.

If you enter your credentials (username and password) and click Explore, you will see a list of APIs which you can access for your namespace. The Bodhi Cloud APIs are REST APIs which returns JSON for all responses.

Each API has examples and an opportunity to Try it out!. You can add data using our provided types or create your own type. NOTE: Should you create your own type, the new type will show up in the API Documentation for your namespace.

Logging In to APIDocs

Exploring the APIDocs

Once logged into the APIDocs you can both explore the provided types and their respective restful verbs: GET, PUT, DELETE, PATCH. The APIDocs are much more than API Documentation, it is a powerful interactive tool that allows the developer and/or administrator to create, update, delete data as well as manage the schema for their organization.

Getting started with the HotSchedules IoT Platform REST API

The HotSchedules IoT Platform (Bodhi) REST API allows you to query meta-data about your stores, labor, sales, and HotSchedules Agents running in your stores. You can also do some fancy things like get social information, upload files, send push notifications and emails, and even make payments.

Base URL

All URLs referenced in the documentation have the following base:

https://api.bodhi.space/<organization_name>

The Bodhi REST API is served over HTTPS. To ensure data privacy, unencrypted HTTP is not supported.

Authenticating to the API

HTTP requests to the REST API are protected with HTTP Basic and HTTP Cookie authentication. In short, you will use your HotSchedules IoT Platform account credentials (username and password) for HTTP Basic authentication. If you do not have credentials, you can signup at bodhi.space or directly here https://bodhi.space/signup/

Syntax: curl -ik -u username:password -X GET https://api.bodhi.space/me

For example: curl -ik -u platform:user -X GET https://api.bodhi.space/me

Your results will look like this:
HTTP/1.1 200 OK
Server: nginx/1.8.0
Date: Sat, 21 May 2016 15:22:26 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 456
Connection: keep-alive
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers:
Access-Control-Allow-Methods: *
Access-Control-Allow-Origin: Access-Control-Expose-Headers: WWW-Authenticate, Server-Authorization, Location
Request-Time: 383
Set-Cookie: RUSK=“8a6f98bb1033055fc04d644c0006789335f96c2b-username=platform”; Path=/; Domain=.bodhi.space; Secure; HTTPOnly

{"lastName":"User","sys_created_at":"2016-05-21T15:22:11.157Z","authorizations":[{"namespace":"bodhi-social","read":true}],"profiles":["bodhi-social.user"],"usertype":"person","firstName":"Platform","sys_id":"57407d23b3b82c51e5cb3afb","password":"$2a$12$C/ZJYSZ4qkR5pU5yHQEkLuvcOVjP4rqLdOHlPq4zcDZt9dcYpBeMC","sys_version":1,"email":"customercare@hotschedules.com","username":"platform","sys_type_version":12}

Next, read the Set-Cookie header to get your cookie string:
RUSK="8a6f98bb1033055fc04d644c0006789335f96c2b-username=platform" in the example

Now use the cookie auth to authenticate to the API
curl -ik --cookie "RUSK=8a6f98bb1033055fc04d644c0006789335f96c2b-username=platform" -X GET https://api.bodhi.space/me

Cookie authorization does not expire and can be used to authenticate moving forward.

Once your Organization is setup in the platform (you can signup for free at https://developer.bodhi.space) you can access your data at https://api.bodhi.space/ .

So for example, if your organization name is my-deli, your URL would be https://api.bodhi.space/my-deli

Now that you’ve authenticated to the API, it’s time to look at some data.

Making a call

The HotSchedules REST API supports all the standard REST verbs
GET
POST
PUT
PATCH
DELETE

You can access these verbs for each of the types in the HotSchedules system. When an organization is created in the HotSchedules Platform, the organization automatically gets 32 ‘types’ that will store standard information and data about your organization. Those 'types’ can be viewed and reviewed at https://api.bodhi.space/apidocs/index.html

GET

As an example, let’s do a GET on a store via CURL curl -ik --cookie "RUSK=8a6f98bb1033055fc04d644c0006789335f96c2b-username=platform" -X GET https://api.bodhi.space/bodhi-social/resources/Store

This call will return the information about a store that’s been created for the bodhi-social organization

[{"sys_version":1,"image_url":"https://upload.wikimedia.org/wikipedia/commons/5/54/Golden_Gate_Bridge_0002.jpg","sys_type_version":12,"address":{"street_address":"555 Mission","extended_address":"","locality":"San Francisco","region":"CA","postal_code":"94111","country":"US"},"store_hours":[{"days":[7,1],"start":"0500","end":"0000"},{"days":[1,2],"start":"1200","end":"0200"},{"days":[2,3],"start":"1200","end":"0200"},{"days":[3,4],"start":"1200","end":"0200"},{"days":[4,5],"start":"1200","end":"0200"},{"days":[5,6],"start":"1200","end":"0200"},{"days":[6,7],"start":"0500","end":"0000"}],"sys_created_by":"admin__bodhi-social","sys_created_at":"2016-05-21T15:37:15.560Z","name":"platformstore","store_number":"1","display_name":"Platform Store","sys_id":"574080abb9a19e2dadee775b"}]

You can also get the JSON payload by navigating directly to this URL https://api.bodhi.space/bodhi-social/resources/Store

You can create your own store for your organization either by executing a POST command (see below) to https://api.bodhi.space/<organization_name>/resources/Store or using our free store manager tool at https://bodhi.space/store-manager . Either way, a store is a critical anchor for information in the Platform.

Next let’s look up a sale for our store in bodhi-social

curl -ik --cookie "RUSK=8a6f98bb1033055fc04d644c0006789335f96c2b-username=platform" -X GET https://api.bodhi.space/bodhi-social/resources/SalesTransaction

RESULT:

[{"order_number":10184,"item_count":1,"store_id":"574080abb9a19e2dadee775b","employee":{"id":"5151","name":"Ted Morrison"},"business_day":"2016-05-20","revenue_center":{"id":"2","name":"Restaraunt"},"type":{"id":"4","name":"1"},"timestamp":"2016-05-21T03:34:00.000Z","transaction_id":"557605fc4c32e071180a46042016-05-2010184","net_total":{"value":325,"code":"USD","scale":2},"discount_total":{"value":0,"code":"USD","scale":2},"tax_total":{"value":23,"code":"USD","scale":2},"gross_total":{"value":348,"code":"USD","scale":2},"tender_total":{"value":348,"code":"USD","scale":2},"order_opened_at":"2016-05-21T03:33:00.000Z","order_closed_at":"2016-05-21T03:34:00.000Z","guest_count":1,"sys_version":1,"sys_created_at":"2016-05-21T16:02:30.800Z","sys_created_by":"admin__bodhi-social","sys_type_version":12,"sys_id":"574086965eacd06aa3db036b"}]

We can also look up our Store using query parameters in our URL

curl --cookie "RUSK=8a6f98bb1033055fc04d644c0006789335f96c2b-username=platform" 'https://api.bodhi.space.io/bodhi-social/resources/SalesTransaction?where=%7Bbusiness_day:"2016-05-20"%7D&fields=business_day'

OR alternatively:

curl -g --cookie "RUSK=8a6f98bb1033055fc04d644c0006789335f96c2b-username=platform" 'https://api.bodhi.space/bodhi-social/resources/SalesTransaction?where={business_day:"2016-05-20"}&fields=business_day'

RESULT:
[{"order_number":10184,"item_count":1,"store_id":"574080abb9a19e2dadee775b","employee":{"id":"5151","name":"Ted Morrison"},"business_day":"2016-05-20","revenue_center":{"id":"2","name":"Restaraunt"},"type":{"id":"4","name":"1"},"timestamp":"2016-05-21T03:34:00.000Z","transaction_id":"557605fc4c32e071180a46042016-05-2010184","net_total":{"value":325,"code":"USD","scale":2},"discount_total":{"value":0,"code":"USD","scale":2},"tax_total":{"value":23,"code":"USD","scale":2},"gross_total":{"value":348,"code":"USD","scale":2},"tender_total":{"value":348,"code":"USD","scale":2},"order_opened_at":"2016-05-21T03:33:00.000Z","order_closed_at":"2016-05-21T03:34:00.000Z","guest_count":1,"sys_version":1,"sys_created_at":"2016-05-21T16:02:30.800Z","sys_created_by":"admin__bodhi-social","sys_type_version":12,"sys_id":"574086965eacd06aa3db036b"}]

So https://api.bodhi.space/bodhi-social/resources/SalesTransaction?where={%27business_day%27:%272016-05-20%27} would return all SalesTransaction’s for the business day of 2016-05-20. The URL https://api.bodhi.space/bodhi-social/resources/SalesTransaction?where={%27store_id%27:%27574080abb9a19e2dadee775b%27} would return all SalesTransaction’s for the store 574080abb9a19e2dadee775b (our Platform test store).

All Types can be queried by any parameter within the type using a ?where={} clause. It’s EXTREMELY important for efficiency and performance to query using indexes on your types. You can review the Types for your organization as well as the Indexes and Parameters by using our free Type Tool located at https://tools.bodhi.space/types or by inspecting https://api.bodhi.space/<organization_name>/resources/BodhiType

POST

To POST to a type you need to add the the header: 'Content-Type: application/json’ to your cURL Command

curl -ik -H 'Content-Type: application/json' --cookie "RUSK=8a6f98bb1033055fc04d644c0006789335f96c2b-username=foo" -X POST -d '{ "store_id": "l8zeL", "business_day": "2016-05-13", "timestamp": "2016-05-12T05:58:31.296Z", "transaction_id": "FGHG012", "tender_total": { "code": "USD", "scale": 2, "value": 620 } }' https://api.bodhi.space/<organization_name>/resources/SalesTransaction

That command will post the json object to the SalesTransaction type. You can now GET on this type either using cURL or the free query tools available at https://tools.bodhi.space/query

Bulk Post

All bulk operations are accessible through https://api.bodhi.space
The size limitation for the body is 17MB

Syntax:

POST /<organization_name>/bulk with json body
{ "config": { "op": "insert" or "update" or "upsert" or "invite", * see below "report": true, <- optional, need a report? (default false) "target": "target_name” <- the name of the type (not for invite) }, "payload": [{ "the_field": "my first thing to insert or upsert or invite", "other_field": "the_other_field" }, { "the_field": "my second thing to insert or upsert", "other_field": "the_other_field2" }] }

The payload varies depending on the type of operation and Returns 202 with header bulk_id:<the bulk id>

The result of a report, if requested, is accessible as soon as the processing is done on:

GET /<organization_name>/bulk/<bulk_id>

RESPONSE:
returns 200 with a json array body where the order of the cells matches the order of the payload. The report can be accessed only once.
returns 204 if the report is not ready yet
returns 404 if no report was found with that id

Example:

{ "config": { "op": "insert", "report": true, "target": "BulkTest" }, "payload": [{ "name": "leo", "other_field": "mauris non" }, { "name": "orci", "other_field": "sit amet justo" }, { "name": "nulla", "other_field": "pulvinar sed nisl nunc rhoncus" }, { "name": "nulla", "other_field": "diam cras" }, { "name": "est", "other_field": "dui nec nisi volutpat" }, { "name": "lorem", "other_field": "cursus id" }, { "name": "molestie", "other_field": "potenti nullam porttitor lacus at" }, { "name": "sapien", "other_field": "ultrices aliquet maecenas leo" }, { "name": "nibh", "other_field": "consectetuer eget rutrum at" }, { "name": "luctus", "other_field": "nisl nunc" }] }

PUT

The HTTP verb PUT can be used on any type as long as there’s a unique index on the field or fields. You can always PUT on sys_id

As an example, in the above SalesTransaction example, the sys_id is 574086965eacd06aa3db036b, a PUT to the SalesTransaction based on sys_id would be as follows:

curl -ik -H 'Content-Type: application/json' --cookie "RUSK=8a6f98bb1033055fc04d644c0006789335f96c2b-username=foo" -X PUT -d '{ "store_id": "l8zeL", "business_day": "2016-05-13", "timestamp": "2016-05-12T05:58:31.296Z", "transaction_id": "FGHG012", "tender_total": { "code": "USD", "scale": 2, "value": 620 } }' https://api.bodhi.space/tutorial/resources/SalesTransaction/574086965eacd06aa3db036b

PUT Upsert

Upsert is a safe way to replace an existing record, or POST a record if the entry does not currently exist.

You can upsert by appending your URL with ?upsert=true

As an example, the above PUT example can be changed to a replace by appending the ?upsert=true to the cURL command:

curl -ik -H 'Content-Type: application/json' --cookie "RUSK=8a6f98bb1033055fc04d644c0006789335f96c2b-username=foo" -X PUT -d '{ "store_id": "l8zeL", "business_day": "2016-05-13", "timestamp": "2016-05-12T05:58:31.296Z", "transaction_id": "FGHG012", "tender_total": { "code": "USD", "scale": 2, "value": 620 } }' https://api.bodhi.space/tutorial/resources/SalesTransaction/574086965eacd06aa3db036b?upsert=true

PATCH

the HTTP verb PATCH will allow you to alter single parameters or fields within a record in your type. Patch commands follow the following sytax: [ { “op”: “replace”, “path”: “/baz”, “value”: “boo” }, { “op”: “add”, “path”: “/hello”, “value”: [“world”] }, { “op”: “remove”, “path”: “/foo”} ]

The HTTP verb PATCH can be used on any type as long as there’s a unique index on the field or fields. You can always PATCH on sys_id

DELETE

the HTTP verb DELETE will allow you to remove a record in your type. DELETE commands follow the following sytax:

To delete multiple records, include a ?where={} in your URL to narrow or expand then number of records removed.

File Upload

The Platform BodhiFileUpload endpoints are special types that allow a user to upload and download any file (like a dbf file from your store’s POS).

Metadata of your file is posted to type BodhiFileUpload on successful upload

BodhiFileUpload example record:
{ "namespace": "bodhi", "original_name": "profile_pic5.jpg", "sys_version": 1, "location": "bodhi/profile_pic5.jpg", "uploaded_at": "2015-09-10T19:42:48+0000", "sys_created_by": "admin__bodhi", "sys_created_at": "2015-09-10T19:42:49+0000", "name": "profile_pic5.jpg", "media_type": "image/jpeg", "sys_id": "55f1dd39b9b5904f64c8212f" }

Examples:
The following are curl examples of how to specify file location in your upload/download/delete commands. Everything after “upload/” or “download/” in the url is used as the destination. Note that filename is always specified in the url.

curl -X POST -u <username>:<password> https://api.bodhi.space/<organization_name>/controllers/vertx/upload/recipes/food/BurritoRecipe.txt -F "upload1=@THE_FILE"

curl -X PUT -u <username>:<password> https://api.bodhi.space/<organization_name>/controllers/vertx/upload/recipes/food/BurritoRecipe.txt -F "upload1=@THE_FILE"

Download by path:
curl -X GET -u <username>:<password> https://api.bodhi.space/<organization_name>/controllers/vertx/download/recipes/food/BurritoRecipe.txt

Download by sys_id:
curl -X GET -u <username>:<password> https://api.bodhi.space/<organization_name>/controllers/vertx/download/56f9c2b4fa92ec27934a76ae

Delete a file:
curl -X DELETE -u <username>:<password> https://api.bodhi.space/<organization_name>/controllers/vertx/upload/recipes/food/BurritoRecipe.txt

Working with HotSchedules data

The HotSchedules REST API provides a user-friendly way to obtain HS Data.

Please ensure that API access has been enabled for your HotSchedules account. Contact customer service 1-866-753-3853 for access or questions.

The url path can look like any of the following, depending on which type is being queried:
../hotschedules/<concept_id>/<store_id>/<type_method>?
../hotschedules/<concept_id>/<type_method>?
../hotschedules/<type_method>?

Note: Results are currently cached with a TTL of 60 minutes.

getConcepts

This method returns a list of concepts for a company.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/getConcepts"

Sample JSON response:

  [
    {
      "name": "HotSchedules",
      "extId": 13
    }
  ]
Key Type Description
name String Concept Name
extId Number Concept external ID

getDriversByInterval

This method will take a concept ID, store number, start and end dates, volume type, and data type and return a list of total driver amount for each interval in the date range requested for that concept, store and labor type.

Intervals are configured during initial setup for the customer and are typically 30 minutes or 15 minutes.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept
startDate hsSimpleDate Start date for the range of data requested
endDate hsSimpleDate End date for the range of data requested
volumeType driverClass Classification of driver requested. Allowed types would be all of the classifications supported from API, HSC, or FTP integration. “Guests”, “Tables”, “Entrees”, “Deliveries”, “Transactions” and “Products”
dataType driverType Type of driver requested. Allowed types are “ACTUAL”, “ADJ_FORECASTED”, and “PRE_ADJ_FORECASTED”

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getDriversByInterval?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016&volume_type=TABLE&data_type=ACTUAL"

Sample JSON response:

  [
    {
      "driverAmount": 0,
      "driverClass": "TABLE",
      "intervalStartTime": {
        "hours": 0,
        "seconds": 0,
        "militaryTime": true,
        "minutes": 0
      },
      "intervalEndDate": {
        "month": 4,
        "year": 2016,
        "day": 30
      },
      "intervalEndTime": {
        "hours": 0,
        "seconds": 0,
        "militaryTime": true,
        "minutes": 15
      },
      "conceptExtRef": 1,
      "storeExtRef": 3,
      "companyExtRef": 234542,
      "driverType": "ACTUAL",
      "intervalStartDate": {
        "month": 4,
        "year": 2016,
        "day": 30
      }
    }
  ]
Key Type Description
driverAmount Number Quantity of driver for interval expressed in the record
driverClass String Description of driver type supplied for the interval expressed in the record
intervalStartTime Object The hour, minutes, and seconds corresponding to the start of the interval expressed in the record. Interval times are local to the store’s time zone
intervalEndTime Object The hour, minutes, and seconds corresponding to the end of the interval expressed in the record. Interval times are local to the store’s time zone
intervalStartDate Object The date corresponding to the start of the interval expressed in the record
intervalEndDate Object The date corresponding to the end of the interval expressed in the record
conceptExtRef Number The concept ID configured by HotSchedules for the concept of the store owning the data of the record., contact HotSchedules if Concept IDs need to be defined or configured
storeExtRef Number The store ID configured within HotSchedules for the store owning the data of the record., contact HotSchedules if Store IDs need to be defined or configured
companyExtRef Number The company ID defined by HotSchedules for the store owning the data of the record., contact HotSchedules if the Company ID needs to be defined. This ID cannot be customized or configured
driverType String Type of driver requested. Allowed types are: “ACTUAL” - Corresponds to the actual values produced by the store. “ADJ_FORECASTED”- Corresponds to the final forecasted driver amount that the schedules were based off from for the driver. “PRE_ADJ_FORECASTED”- Corresponds to the original forecasted driver amount previous to any forecast adjustments

getEmpAvailability

This method takes in a concept ID and a store ID and returns an array of wsEmpAvailability objects. It is meant to get a list of all employee availability for that store.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept
active_only Boolean Boolean that defines whether or not to include terminated employees in response

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getEmpAvailability?active_only=true"

Sample JSON response:

[
  {
    "empNum": 2013,
    "availabilities": [
      {
        "parHoursMax": -1,
        "parShiftsMax": -1,
        "shiftId": 781691610,
        "shiftName": "PM",
        "parHoursMin": -1,
        "parShiftsMin": -1,
        "dayName": "Friday",
        "partialBeforeAfter": "",
        "statusName": "Not Available",
        "dayNum": 6,
        "partialTime": "",
        "statusNum": 3
      }
    ],
    "empHrId": -1
  }
]
Key Type Description
empNum Number Employee POS ID
availabilities Array Returns an array of availability for an employee
empHrId Number Employee HR ID

getEmpInfo

This method takes in a concept ID and a store ID and returns an array of wsEmpInfo objects. It is meant to get a list of all employees for that store.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
active_only Boolean Boolean that defines whether or not to include terminated employees in response.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getEmpInfo?active_only=true"

Sample JSON response:

  [
    {
      "lastUpdated": "2015-07-10T17:32:55.753-05:00",
      "accountCreated": "2012-12-28T13:31:25.913-06:00",
      "permissionSetName": "Employee",
      "empNum": 2001,
      "assignedSchedules": [
        {
          "hsId": 781691496,
          "name": "Bartender",
          "extId": 0
        },
        {
          "hsId": 781691492,
          "name": "Server",
          "extId": 0
        }
      ],
      "empHrId": -1
    }
  ]
Key Type Description
lastUpdated String Last time the employee record was updated
accountCreated String Date/time the account was created
permissionSetName String Permission set name assigned to the employee
empNum Number Employee POS ID
assignedSchedules Array The schedule in which the employee is assigned. Array contains extId, hsId and name
empHrId Number Employees HR ID

getEmpJobs

This method takes in a concept ID and a store ID and returns an array of wsEmpJob objects. It is meant to get a list of all jobs assigned to all employees for that store.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getEmpJobs?active_only=true"

Sample JSON response:

[ 
  {
    "hsJobId": 11878523,
    "clientId": 14935376,
    "regWage": 1,
    "posEmpId": 2069,
    "hsEmpId": 4177214,
    "storeNum": 3,
    "ovtWage": 1.5,
    "posJobId": 18,
    "primary": true
  }
]
Key Type Description
hsJobId Number HotSchedules internal job code ID
clientId Number Unique identifier for client provided via HotSchedules
regWage Number Regular hourly wage rate for employee
posEmpId Number POS numeric ID for employee
hsEmpId Number HotSchedules internal employee account ID
storeNum Number Unique numeric store ID within HotSchedules, generally set up to mirror the client internal store IDs
ovtWage Number Overtime hourly wage rate for employee
posJobId Number POS numeric ID for the job code
primary Boolean Boolean flag to designate if the job code is the primary job for the employee

getGroups

This method takes in a concept ID and returns group information for the concept.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/getGroups"

Sample JSON response:

  [
    {
      "name": "HotSchedules",
      "extId": 0,
      "conceptExtId": 1
    }
  ]
Key Type Description
name String Group name
extId Number Group external ID
conceptExtId Number Concept external ID

getGuestCounts

This method will take a concept ID, store number, start and end dates and return a list of guest counts for the date range requested.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
start dateTime Start date for the range of data requested. This is a basic dateTime object.
end dateTime End date for the range of data requested. This is a basic dateTime object.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getGuestCounts?start_date=2016-04-30T00:00:00&end_date=2016-05-03T00:00:00"

Sample JSON response:

  [
    {
      "dateTime": "2016-04-30T11:00:00-05:00",
      "businessDate": "2016-04-30T00:00:00-05:00",
      "rvcExtId": 1,
      "guestCount": 2
    }
  ]
Key Type Description
dateTime String Date time of the transaction
businessDate String Business date of transaction
rvcExtId Number Represents the numeric revenue center ID associated with the guest
guestCount Number Number of guests for the transaction

getLaborByBusDay

This method will take a concept ID, store number, start and end dates and a labor type and return a list of total labor by job code for each interval in the date range requested for that concept, store and labor type.

Intervals are configured during initial setup for the customer and are typically 30 minutes.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept
start hsSimpleDate Start date for the range of data requested
end hsSimpleDate End date for the range of data requested
laborType laborType Type of labor requested. Allowed types are “optimal”, “forecasted” and “scheduled”.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getLaborByBusDay?start_day=30&start_month=1&start_year=2016&end_day=5&end_month=5&end_year=2016&labor_type=optimal"

Sample JSON response:

[
  {
    "interval": {
      "intervalDate": {
        "day": 1,
        "month": 2,
        "year": 2016
      },
      "intervalTime": {
        "hours": 0,
        "militaryTime": true,
        "minutes": 0,
        "seconds": 0
      },
      "laborType": "forecasted",
      "volume": 0
    }
  }
]  
Key Type Description
intervalDate Object Date expressed in the record
intervalTime Object The hour, minutes, and seconds expressed in record
laborType String Type of labor requested. Allowed types are “optimal”, “forecasted” and “scheduled”.
volume String Number of employees based on demand at that interval

getLaborByJobAndInterval

This method will take a concept ID, store number, start and end dates and a labor type and return a list of total labor by job code for each interval in the date range requested for that concept, store and labor type.

Intervals are configured during initial setup for the customer and are typically 30 minutes.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
start hsSimpleDate Start date for the range of data requested
end hsSimpleDate End date for the range of data requested
laborType laborType Type of labor requested. Allowed types are “optimal”, “forecasted” and “scheduled”.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getLaborByJobAndInterval?start_day=30&start_month=1&start_year=2016&end_day=5&end_month=5&end_year=2016&labor_type=optimal"

Sample JSON response:

[
  {
    "interval": {
      "intervalDate": {
        "day": 1,
        "month": 2,
        "year": 2016
      },
      "intervalTime": {
        "hours": 12,
        "militaryTime": true,
        "minutes": 0,
        "seconds": 0
      },
      "laborType": "scheduled",
      "volume": 0
    }
  }
]
Key Type Description
intervalDate Object Date expressed in the record
intervalTime Object The hour, minutes, and seconds expressed in record
laborType String Type of labor requested. Allowed types are “optimal”, “forecasted” and “scheduled”.
volume String Number of employees based on demand at that interval

getSalesItemsV3

This method takes in a concept ID, store ID, start and end dates.It returns an array of sales for that store.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
start hsSimpleDate First day of projected sales requested. This is an hsSimpleDate object.
end hsSimpleDate Last day of projected sales requested. This is an hsSimpleDate object.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getSalesItemsV3?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016"

Sample JSON response:

[
  {
    "clientId": 1234567,
    "empId": 7,
    "extId": -3,
    "rvc": 1,
    "rvcName": "TAKE OUT",
    "salesCat": 1,
    "storeNum": 13,
    "ttl": 7.99,
    "businessDate": {
      "day": 30,
      "month": 4,
      "year": 2016
    },
    "transDate": {
      "day": 30,
      "month": 4,
      "year": 2016
    },
    "transTime": {
      "hours": 7,
      "militaryTime": true,
      "minutes": 33,
      "seconds": 0
    }
  }
]
Key Type Description
clientId Object Business Date information, Day, Months and Year
empId Array Array of the day part total. Start Time and End Time
extId Number Total projected sales for the day part
rvc Number Revenue center
rvcName String Name for the revenue center associated with the location within the restaurant
salesCat Number Sales category
storeNum Number Store number
ttl Number Total sales for the sales category
businessDate Object Business Date information, Day, Months and Year
transDate Object Transaction data
transTime Object Transaction time

getProjectedSalesV3

This method will take a concept ID, store number, start and end dates. This method uses hsSimpleDate objects for dates and hsSimpleTime objects for times.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
start hsSimpleDate First day of projected sales requested. This is an hsSimpleDate object.
end hsSimpleDate Last day of projected sales requested. This is an hsSimpleDate object.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getProjectedSalesV3?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016"

Sample JSON response:

  [
    {
      "businessDate": {
        "month": 4,
        "year": 2016,
        "day": 30
      },
      "dayPartTotals": [
        {
          "summaryItemTotals": {
            "summaryItemTotal": 5246.26,
            "summaryItemName": "Take out Drive through"
          },
          "dayPartEndTime": {
            "hours": 4,
            "seconds": 0,
            "amPm": "pm",
            "militaryTime": true,
            "minutes": 0
          },
          "dayPartName": "Evening",
          "dayPartTotal": 5246.26,
          "dayPartStartTime": {
            "hours": 18,
            "seconds": 0,
            "amPm": "am",
            "militaryTime": true,
            "minutes": 0
          }
        }
      ],
      "dateTotal": 9934.779
    }
  ]
Key Type Description
businessDate Object Business Date information, Day, Months and Year
dayPartTotals Array Array of the day part total. Start Time and End Time
dateTotal Number Total projected sales for the day part

getRCVs

Revenue center information defined for a group.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getRCVs"

Sample JSON response:

  [
    {
      "revenueCenterName": "Take Out",
      "extId": 0,
      "groupLevel": true
    },
    {
      "revenueCenterName": "Drive Thru",
      "extId": 1,
      "groupLevel": true
    },
    {
      "revenueCenterName": "Beverage",
      "extId": 2,
      "groupLevel": true
    }
  ]
Key Type Description
revenueCenterName String Revenue center name
extId Number Revenue center ID
groupLevel Boolean Indicates if the revenue center was created at a group level

getSalesCats

This method takes in a concept ID and a store ID and returns an array of sales categories for that store. Sales categories will typically establish what kind of item was sold: Food, Beverage, Alcohol, Merchandise.Sales categories can be local to a particular store, or defined in HotSchedules as belonging to an entire group (called group-level sales categories).

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getSalesCats"

Sample JSON response:

  [
    {
      "salesCategoryName": "Beverages",
      "extId": 1,
      "groupLevel": true
    }
  ]
Key Type Description
salesCategoryName String Name of the sales category
extId Number External ID associated with the category
groupLevel Boolean Indicates if the revenue center was created at a group level

getScheduleV3

This method takes in a concept ID, store ID, start and end dates. It returns an array of WSScheduleItem3 objects, which represent one scheduled shift each, for import into the POS. This method returns the same data as getSchedule, plus extended scheduled shift data, including location ID, regular pay rate, OT pay rate, scheduled regular minutes, scheduled OT minutes (if any), scheduled special pay (if any) and the unique schedule ID, internal to HS.This method uses hsSimpleDate objects for dates.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
start hsSimpleDate First day of scheduled shifts you are requesting. This method uses hsSimpleDate objects for dates.
end hsSimpleDate Last day of scheduled shifts you are requesting. This method uses hsSimpleDate objects for dates.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getScheduleV3?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016"

Sample JSON response:

  [
    {
    "outDate": {  
      "month": 5,  
      "year": 2016,  
      "day": 2  
    },  
    "jobHsId": 1111111,  
    "payRate": 1,  
    "inDate": {  
      "month": 5,  
      "year": 2016,  
      "day": 2  
    },  
    "specialPay": 0,  
    "empHSId": 222222,  
    "ovtMinutes": 0,  
    "inTime": {  
      "hours": 9,  
      "seconds": 0,  
      "militaryTime": true,  
      "minutes": 0  
    }  
  ]
Key Type Description
outDate Object Schedules out date
jobHsId Number HotSchedules internal job code ID
payRate Number Regular hourly pay rate for employee
inDate Object Scheduled in date
specialPay Number Special Pay amounts
empHsId Number HotSchedules internal employee account ID
ovtMinutes Number Total Overtime Minutes for employee
inTime Object Scheduled in time

getShiftsV3

This method takes in a concept ID, store ID, start and end dates and three flags (isHouse, isScheduled and isPosted). It returns an array of WSScheduleItem3 objects, which represent one scheduled shift each. What shifts are returned depends on the flags set:

isHouse - includes scheduled or posted shifts that are not assigned to an employee (called ‘house shifts’ in HotSchedules). isScheduled - includes shifts that are in schedules that have been saved in HotSchedules, but might not have been posted isPosted - includes shifts that are in schedules that have been set to the 'posted’ status within HotSchedules.

This method returns extended scheduled shift data, including location ID, regular pay rate, OT pay rate, scheduled regular minutes, scheduled OT minutes (if any), scheduled special pay (if any) and the unique schedule ID, internal to HS.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy
isHouse Boolean Include house shifts? These are shifts which were never assigned to someone on a schedule, or were once assigned but removed from an employee when their status, job, etc. changed.
isScheduled Boolean Include scheduled shifts? These are shifts which are on a schedule that has been saved in HotSchedules, but might not have been posted
isPosted Boolean These are shifts that are in schedules that have been set to the 'posted’ status within HotSchedules.
jobCodes IntArray Integer array of job codes to be included in this method’s return. if this parameter is null or empty, all jobs will be included.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi-dev.io/chewy/controllers/vertx/hotschedules/<concept>/<storeNum>/getShiftsV3?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016&is_house=true&is_scheduled=true&is_posted=true"

Sample JSON response:

  [
    {
      "hsJobId": 11878523,
      "clientId": 14935376,
      "regWage": 1,
      "posEmpId": 2069,
      "hsEmpId": 4177214,
      "storeNum": 3,
      "ovtWage": 1.5,
      "posJobId": 18,
      "primary": true
    }
  ]
Key Type Description
hsJobId Number HotSchedules internal job code ID
clientId Number Unique identifier for client provided via HotSchedules.
regWage Number Regular hourly wage rate for employee
posEmpId Number POS numeric ID for employee
hsEmpId Number HotSchedules internal employee account ID
storeNum Number Unique numeric store ID within HotSchedules. Generally set up to mirror the client internal store IDs.
ovtWage Number Overtime hourly wage rate for employee
posJobId Number POS numeric ID for the job code
primary Boolean Boolean flag to designate if the job code is the primary job for the employee

getStoreEmployees

This method takes in a concept ID, store ID, a flag to determine if only active employees are returned, and returns an array of WSEmployee objects.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
active_only Boolean Boolean that defines whether or not to include terminated employees in response.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getStoreEmployees?active_only=true"

Sample JSON response:

[
    {
      "zipCode": 12345,
      "hireDate": "2016-11-03T10:16:38.533-05:00",
      "address": "111 Addy Way",
      "clientId": 87654321,
      "LName": "Lockman",
      "address2": "Unit 3",
      "city": "Austin",
      "mobile": "(222) 222-2222",
      "NName": "Jay",
      "altId": -1,
      "FName": "Harrison",
      "empNum": -1,
      "phone": "(333) 333-3333",
      "hsId": 987654321,
      "dob": "1981-09-16T00:00:00-05:00",
      "state": "TX",
      "storeNum": 3,
      "email": "harrison.lockman@email.com",
      "status": 1
    }
]
Key Type Description
zipCode Number Zip Code
hireDate String Employee Hire Date
address String Employee Address line 1
clientId Number Unique identifier for client provided via HotSchedules
LName String Employee Last Name
address2 String Employee Address line 2
city String City field for Address
mobile String Employees Mobile Phone
NName String Employee Nickname
altId Number Employee HR ID. This must be a unique value across the company. It is used for HotSchedules Shared Employees.
FName String Employee First Name
empNum Number Employee POS ID
phone String Phone Number
hsId Number Optional HotSchedule Unique employee account ID
dob String Date of birth
state String State
storeNum Number Unique numeric store ID within HotSchedules. Generally set up to mirror the client internal store IDs.
email String Employee’s email address
status Number Active = 1, Inactive = 0, Terminated = -1

getStoreJobs

This method takes in a concept ID and a store ID, and returns an array of all jobs currently defined in HotSchedules for the given concept/store.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getStoreJobs"

Sample JSON response:

  [
    {
      "jobName": "Manager",
      "posId": 11,
      "clientId": 14935376,
      "hsId": 786323133,
      "defRate": 0,
      "storeNum": 3
    }
  ]
Key Type Description
jobName String Name for Job Code
posId Number Numeric POS ID for Job Code
clientId Number Unique identifier for client provided via HotSchedules
hsId Number Optional HotSchedule Unique employee account ID
defRate Number Default Pay Rate for a Job Code

getStoresV2

Returns information about the stores within a group.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
group_id Number Group in which the store is assigned

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/getStoresV2?group_id=0"

Sample JSON response:

  [
    {
      "groupName": "HS Grill",
      "active": true,
      "groupExtId": 1,
      "storeName": "Sales Demo - Bug Test",
      "storeNum": -1,
      "city": "Fremont",
      "postalCode": "94555",
      "stateProvince": "CA",
      "streetAddress1": "1 st. address",
      "streetAddress2": "Unit 3",
      "timeZone": "US/Central"
    }
  ]
Key Type Description
groupName String Name of the group
active Boolean Indicates if the store is active
groupExtId Number The external ID for the store
storeName String The name of the store
storeNum Number Unique numeric store ID within HotSchedules. Generally set up to mirror the client internal store IDs.
city String City
postalCode Number Zip code / postal code
stateProvince String State province
streetAddress1 String Main street adress
streetAddress2 String Apartment number, Suite, Unit, etc..
timeZone String Store timezone

getTimeCards

This method takes in a concept ID, store ID, start and end dates. It returns an array of wsTimeCard3 objects, which represent one employee time card each. Each time card has information for one employee punch record, including business date, regular and OT minutes and wages, clock in and clock out times. If this store is using HotSchedules’ web-based timeclock for employee clock-in, any open punches in the date range are also included in the response.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getTimeCards?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016"

Sample JSON response

[
    {
      "jobName": "Bartender",
      "ovtTtl": 0,
      "ovtHrs": 0,
      "clockOut": "2016-05-01T23:48:00-05:00",
      "regWage": 0,
      "clockIn": "2016-05-01T16:36:00-05:00",
      "ovtWage": 7.5,
      "breakMinutes": 0,
      "jobExtId": 18,
      "jobId": -1,
      "businessDate": {
        "month": 5,
        "year": 2016,
        "day": 1
      },
      "regHrs": 7.2,
      "spcTtl": 7.25,
      "hsId": 929931332168,
      "spcHrs": 0,
      "ovtMins": 0,
      "extId": -2005922,
      "storeNum": 3,
      "empPosId": 2068,
      "regTtl": 0
    }
]
Key Type Description
jobName String POS job code name
ovtTtl Number Optional-Overtime total pay amount
ovtHrs Number Optional-Overtime hours in shift
clockOut String Clock out timestamp for the shift
regWage Number Regular hourly pay rate
clockIn String Clock in timestamp for the shift
ovtWage Number Optional-Overtime hourly pay rate
breakMinutes Number Number of non-paid break minutes in shift
JobId Number POS numeric identifier for the job
jobExtId Number POS numeric Job Code ID
businessDate Array Business Date information, Day, Months and Year
regHours Number Regular hours represented in shift
spcTtl Number Optional-Special Pay total pay amount
hsId Number Optional-Internal HotSchedules employee Account ID. Not required, will be set by the service.
spcHrs Number Optional-Special Pay Hours
ovtMins Number Optional-Overtime minutes in shift
storeNum Number Unique numeric store identifier. Generally set up to mirror the client internal store ID.
empPosId Number POS numeric Employee ID
regTtl Number Regular total pay amount
extId Number Optional-Unique transaction ID for the time card record

getTimeCardsDeclaredTips

This method takes in a concept ID, store ID, start and end dates. It returns an array of wsTimeCard3 objects, which represent one employee time card each. Each time card has information for one employee punch record, including business date, regular and OT minutes and wages, clock in, clock out times and declared tips. If this store is using HotSchedules’ web-based timeclock for employee clock-in, any open punches in the date range are also included in the response.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getTimeCardsDeclaredTips?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016"

Sample JSON object

  [
    {
      "jobName": "Bartender",
      "ovtTtl": 0,
      "ovtHrs": 0,
      "clockOut": "2016-05-01T23:48:00-05:00",
      "regWage": 0,
      "clockIn": "2016-05-01T16:36:00-05:00",
      "ovtWage": 7.5,
      "breakMinutes": 0,
      "jobExtId": 18,
      "jobId": -1,
      "businessDate": {
        "month": 5,
        "year": 2016,
        "day": 1
      },
      "regHrs": 7.2,
      "spcTtl": 7.25,
      "hsId": 929931332168,
      "spcHrs": 0,
      "ovtMins": 0,
      "extId": -2005922,
      "storeNum": 3,
      "empPosId": 2068,
      "regTtl": 0
    }
  ]
Key Type Description
jobName String POS job code name
ovtTtl Number Optional-Overtime total pay amount
ovtHrs Number Optional-Overtime hours in shift
clockOut String Clock out timestamp for the shift
regWage Number Regular hourly pay rate
clockIn String Clock in timestamp for the shift
ovtWage Number Optional-Overtime hourly pay rate
breakMinutes Number Number of non-paid break minutes in shift
JobId Number POS numeric identifier for the job
jobExtId Number POS numeric Job Code ID
businessDate Array Business Date information, Day, Months and Year
regHours Number Regular hours represented in shift
spcTtl Number Optional-Special Pay total pay amount
hsId Number Optional-Internal HotSchedules employee Account ID. Not required, will be set by the service.
spcHrs Number Optional-Special Pay Hours
ovtMins Number Optional-Overtime minutes in shift
storeNum Number Unique numeric store identifier. Generally set up to mirror the client internal store ID.
empPosId Number POS numeric Employee ID
regTtl Number Regular total pay amount
extId Number Optional-Unique transaction ID for the time card record

getVolumeCounts

This method will take a concept ID, store number, start and end dates and a volume type and return a list of volume counts for the date range requested. Supported Volume Types are: “TABLES”, “ENTRÉE”, “GUESTS”, “DELIVERIES”, “PRODUCTS”, and “TRANSACTIONS”.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
volumeType volumeType Classification of driver requested. Allowed types would be all of the classifications supported from API, HSC, or FTP integration. “Guests”, “Tables”, “Entrees”, “Deliveries”, “Transactions” and “Products”.
start hsSimpleDate Start date for the range of data requested
end hsSimpleDate End date for the range of data requested

curl -X GET -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/getVolumeCounts?start_date=2015-04-30T00:00:00&end_date=2016-05-03T00:00:00&volume_type=TABLE"

Sample JSON response:

  [
    {
      "dateTime": "2016-05-03T23:30:00-05:00",
      "volumeAmount": 5,
      "businessDate": "2016-05-03T00:00:00-05:00",
      "volumeType": "Guests",
      "rvcExtId": 0
    }
  ]
Key Type Description
dateTime String Date of business
volumeAmount Number Value of the volume count for the transaction
businessDate String Business Date information, Day, Months and Year
volumeType String Classification of driver requested. Allowed types would be all of the classifications supported from API, HSC, or FTP integration. “Guests”, “Tables”, “Entrees”, “Deliveries”, “Transactions” and “Products”.
rvcExtId Number Represents the numeric revenue center ID associated with the volume count

setTimeCardsV3

Extends dataTimeCard (includes business date and clock in and clockout date/times).

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/1/1/setTimeCardsV3?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016" -d "[{ \"jobName\": \"Cook\", \"ovtTtl\": 0, \"ovtHrs\": 0, \"clockOut\": \"2016-07-31T22:05:00-05:00\", \"regWage\": 9, \"clockIn\": \"2016-07-30T15:56:00-05:00\", \"ovtWage\": 13.5, \"breakMinutes\": 0, \"jobId\": 16921407, \"businessDate\": { \"month\": 7, \"year\": 2016, \"day\": 31 }, \"regHrs\": 6.15, \"spcTtl\": 0, \"hsId\": 929931334634, \"spcHrs\": 0, \"ovtMins\": 0, \"storeNum\": 1, \"empPosId\": 1052, \"regTtl\": 55.35 }]"

Sample JSON object

  [
    {
      "jobName": "Cook",
      "ovtTtl": 0,
      "ovtHrs": 0,
      "clockOut": "2016-07-31T22:05:00-05:00",
      "regWage": 9,
      "clockIn": "2016-07-30T15:56:00-05:00",
      "ovtWage": 13.5,
      "breakMinutes": 0,
      "JobId": 16921407,
      "businessDate": {
        "month": 7,
        "year": 2016,
        "day": 31,
      },
      "regHours": 6.15,
      "spcTtl": 0,
      "hsId": 929931334634,
      "spcHrs": 0,
      "ovtMins": 0,
      "storeNum": 1,
      "empPosId": 1052,
      "regTtl": 55.35
    }
  ]
Key Type Description
jobName String POS job code name
ovtTtl Number Optional-Overtime total pay amount
ovtHrs Number Optional-Overtime hours in shift
clockOut String Clock out timestamp for the shift
regWage Number Regular hourly pay rate
clockIn String Clock in timestamp for the shift
ovtWage Number Optional-Overtime hourly pay rate
breakMinutes Number Number of non-paid break minutes in shift
JobId Number POS numeric identifier for the job
jobExtId Number POS numeric Job Code ID
businessDate Array Business Date information, Day, Months and Year
regHours Number Regular hours represented in shift
spcTtl Number Optional-Special Pay total pay amount
hsId Number Optional-Internal HotSchedules employee Account ID. Not required, will be set by the service.
spcHrs Number Optional-Special Pay Hours
ovtMins Number Optional-Overtime minutes in shift
storeNum Number Unique numeric store identifier. Generally set up to mirror the client internal store ID.
empPosId Number POS numeric Employee ID
regTtl Number Regular total pay amount
extId Number Optional-Unique transaction ID for the time card record

setEmpJobs

This method takes in a concept ID, store ID, and an array of WSEmpJob objects to assign jobs to individual employees. This method returns a WSReturn object.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/setEmpJobs?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016" -d "[{json_object_1}, {json_object_2}, {json_object_3}...]"

Sample JSON object

  [
    {
      "hsJobId": 11878523,
      "clientId": 14935376,
      "regWage": 1,
      "posEmpId": 2069,
      "hsEmpId": 4177214,
      "storeNum": 3,
      "ovtWage": 1.5,
      "posJobId": 18,
      "primary": true
    }
  ]
Key Type Description
hsJobId Number HotSchedules internal job code ID
clientId Number Unique identifier for client provided via HotSchedules
regWage Number Regular hourly wage rate for employee
posEmpId Number POS numeric ID for employee
hsEmpId Number HotSchedules internal employee account ID
storeNum Number Unique numeric store ID within HotSchedules. Generally set up to mirror the client internal store IDs.
ovtWage Number Overtime hourly wage rate for employee
posJobId Number POS numeric ID for the job code
primary Boolean Boolean flag to designate if the job code is the primary job for the employee

setEmps

This method takes in a concept ID, store ID and an array of WSEmployee objects. Using the authentication from the username token and the conecpt and store IDs, the server will resolve which HotSchedules client this sync is for. The array of employees will be parsed on the server side to employees who need to be inserted or updated in the HS database. This method returns a WSReturn object.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
emps wsEmployeeArray Array of WSEmployee objects. Each object represents an employee at this store.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/setEmps?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016" -d "[{json_object_1}, {json_object_2}, {json_object_3}...]"

Sample JSON object

  [
    {
      "zipCode": 12345,
      "hireDate": "2016-11-03T10:16:38.533-05:00",
      "address": "111 Addy Way",
      "clientId": 87654321,
      "LName": "Lockman",
      "address2": "Unit 3",
      "city": "Austin",
      "mobile": "(222) 222-2222",
      "NName": "Jay",
      "altId": -1,
      "FName": "Harrison",
      "empNum": -1,
      "phone": "(333) 333-3333",
      "hsId": 987654321,
      "dob": "1981-09-16T00:00:00-05:00",
      "state": "TX",
      "storeNum": 3,
      "email": "harrison.lockman@email.com",
      "status": 1
    }
  ]
Key Type Description
zipCode Number Zip Code
hireDate String Employee Hire Date
address String Employee Address line 1
clientId Number Unique identifier for client provided via HotSchedules
LName String Employee Last Name
address2 String Employee Address line 2
city String City field for Address
mobile String Employees Mobile Phone
NName String Employee Nickname
altId Number Employee HR ID. This must be a unique value across the company. It is used for HotSchedules Shared Employees.
FName String Employee First Name
empNum Number Employee POS ID
phone String Phone Number
hsId Number Optional HotSchedule Unique employee account ID
dob String Date of birth
state String State
storeNum Number Unique numeric store ID within HotSchedules. Generally set up to mirror the client internal store IDs.
email String Employee’s email address
status Number Active = 1, Inactive = 0, Terminated = -1

setForecastDriversV2

This method takes in a concept ID, store ID, workweek, startdate, enddate, starttime, endtime, volume amount, volume type, and a revenue center for the purpose of submitting forecasted volume drivers to HotSchedules from a third party system or point of sale. Using the authentication from the username token and the concept and store IDs, the server will resolve which HotSchedules client this sync is for. The array contains volume driver counts for a range of dates, corresponding to the start and end dates. The server side logic can handle overlapping data (i.e. if you sync 7 days worth of time cards, every day, 6 days of it will be “overlapping” data) and will insert and update data as needed. If the guest are already in the HS database and do not need to be updated, then nothing will change.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/setForecastDriversV2?start_day=30&start_month=4&start_year=2016" -d "[{json_object_1}, {json_object_2}, {json_object_3}...]"

Sample JSON object

  [
    {
      "concept": 1,
      "storeNum": 1,
      "workweekStartDate": {
        "day": 11,
        "month": 10,
        "year": 2016
      },
      "driverAmount": 10,
      "intervalStartDate" : {
        "day": 1,
        "month": 5,
        "year": 2016
      },
      "intervalEndDate": {
        "day": 11,
        "month": 10,
        "year": 2016
      },
      "intervalStartTime": {
        "amPm": "am",
        "hours": 0,
        "seconds": 0,
        "militaryTime": true,
        "minutes": 0
      },
      "intervalEndTime": {
        "amPm": "am",
        "hours": 0,
        "seconds": 0,
        "militaryTime": true,
        "minutes": 15
      },
      "rvcId": 1,
      "volumeType": "Guests"
    }
  ]
Key Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
workweekStartDate Object Start date of the work week
driverAmount Number Quantity of driver for interval expressed in the record
intervalStartTime Object The hour, minutes, and seconds corresponding to the start of the interval expressed in the record. Interval times are local to the store’s time zone.
intervalEndTime Object The hour, minutes, and seconds corresponding to the end of the interval expressed in the record. Interval times are local to the store’s time zone.
intervalStartDate Object The date corresponding to the start of the interval expressed in the record
intervalEndDate Object The date corresponding to the end of the interval expressed in the record
rvcId Number Numeric ID for the revenue center associated with the location within the restaurant
volumeType String Classification of driver requested. Allowed types would be all of the classifications supported from API, HSC, or FTP integration. “Guests”, “Tables”, “Entrees”, “Deliveries”, “Transactions” and “Products”.

setGuestCounts

This method takes in a concept ID, store ID, business date, date time, guest count and a revenue center for the purpose of submitting actual guest count drivers to HotSchedules from a third party system or point of sale. Using the authentication from the username token and the concept and store IDs, the server will resolve which HotSchedules client this sync is for. The array contains guest counts for a range of dates, corresponding to the start and end dates. The server-side logic can handle overlapping data (i.e. if you sync 7 days worth of time cards, every day, 6 days of it will be “overlapping” data) and will insert and update data as needed. If the guest are already in the HS database and do not need to be updated, then nothing will change. This method returns a WSReturn object.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/setGuestCounts?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016" -d "[{json_object_1}, {json_object_2}, {json_object_3}...]"

Sample JSON object

  [
    {
      "dateTime": "2016-05-03T23:30:00-05:00",
      "businessDate": "2016-05-03T00:00:00-05:00",
      "guestCount": 113,
      "rvcExtID": 123
    }
  ]
Key Type Description
businessDate String Business date of transaction
dateTime String Date Time of the transaction
guestCount Number Number of guests for the transaction
rvcExtID Number Numeric ID for the revenue center associated with the transaction

setRVC

This method takes in a concept ID and a store ID and returns an array of revenue centers for that store.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept
group Number Numeric ID group in which the store is assigned
rvcId Number Numeric ID for the revenue center associated with the location within the restaurant
rvcName String Name for the revenue center associated with the location within the restaurant.
i.e. Bar, Togo etc…
isGroupLevel Boolean Indicates if the revenue center is assigned at the group level.
i.e. Bar used across all locations

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/setRVC?group=1&rvcId=1&rvcName=1&isGroupLevel=true" -d "[{json_object_1}, {json_object_2}, {json_object_3}...]"

Sample JSON object

[
    {
      "concept": 1,
      "group": 1,
      "isGroupLevel": true,
      "store": 13,
      "rvcId": 11,
      "rvcName": "Bar"
    }
]
Key Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
group Number Numeric ID group in which the store is assigned
rvcId Number Numeric ID for the revenue center associated with the location within the restaurant
rvcName String Name for the revenue center associated with the location within the restaurant.
i.e. Bar, Togo etc…
isGroupLevel Boolean Indicates if the revenue center is assigned at the group level.
i.e. Bar used across all locations

setSalesCat

This method allows you to add the sales category associated with menu items. Sales categories will typically establish what kind of item was sold: Food, Beverage, Alcohol, Merchandise. Sales categories can be local to a particular store.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
group Number Numeric ID group in which the store is assigned
salesCatId Number Numeric ID for the sales category associated with the location within the restaurant
salesCatName String Name for the sales category associated with the item sold within the restaurant.
i.e. Liquor, Beer, etc..
isGroupLevel Boolean Indicates if the sales category is assigned at the group level.
i.e. Liquor ID 2 used across all locations

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/setSalesCat?group=1&salesCatId=1&salesCatName=1&isGroupLevel=true" -d "[{json_object_1}, {json_object_2}, {json_object_3}...]"

Sample JSON object

[
  {
    "concept": 1,
    "group": 1,
    "isGroupLevel": true,
    "store": 13,
    "salesCatId": 9,
    "salesCatName": "Liquor"
  }
]

Key Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
group Number Numeric ID group in which the store is assigned
salesCatId Number Numeric ID for the sales category associated with the location within the restaurant
salesCatName String Name for the sales category associated with the item sold within the restaurant.
i.e. Liquor, Beer, etc..
isGroupLevel Boolean Indicates if the sales category is assigned at the group level.
i.e. Liquor ID 2 used across all locations

setSalesItemsV4

This method takes in a concept ID, store ID, a start and end date and an array of WSSalesItem objects. Using the authentication from the username token and the concept and store IDs, the server will resolve which HotSchedules client this sync is for. The array contains sales items for a range of dates, corresponding to the start and end dates. The server-side logic can handle overlapping data (i.e. if you sync 7 days worth of sales, every day, 6 days of it will be “overlapping” data) and will insert and update data as needed. If the sales items are already in the HS database and do not need to be updated, then nothing will change. The method returns a WSReturn object. This method uses hsSimpleDate objects for dates.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/setSalesItemsV4?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016" -d "[{json_object_1}, {json_object_2}, {json_object_3}...]"

Sample JSON object [ "concept": 1, "storeNum": 1, "sales": { "catName": "Beer", "clientId": 3, "empId": 123, "extId": 333, "rvc": "Revenue", "rvcName": "Bar", "salesCat": "Beer", "storeNum": 3, "ttl": 0, "businessDate": { "day": 1, "month": 7, "year": 2016 }, "transDate": { "day": 1, "month": 7, "year": 2015 }, "transTime": { "amPm": "am", "hours": 1, "militaryTime": true, "minutes": 15, "seconds": 0 } }, "start": { "day": 1, "month": 7, "year": 2016 }, "end": { "day": 1, "month": 8, "year": 2016 } ]

Key Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept
catName String Category name
clientId Number Unique identifier for client provided via HotSchedules
empId Number Employee ID
extId Number External ID
rvc String Revenue Center
rvcName String Name for the revenue center associated with the location within the restaurant
salesCat String Sales category
ttl String Total sales for the sales category
businessDate Object Business Date information, Day, Months and Year
transDate Object Transaction date
transTime Object Transaction time
start Object Start date for the range of data requested
end Object End date for the range of data requested

setTimeCardsDeclaredTips

This method takes in a concept ID, store ID, a start and end date and an array of WSTimeCardsDeclaredTips objects. Using the authentication from the username token and the concept and store IDs, the server will resolve which HotSchedules client this sync is for. The array contains time cards for a range of dates, corresponding to the start and end dates. The server-side logic can handle overlapping data (i.e. if you sync 7 days worth of time cards, every day, 6 days of it will be “overlapping” data) and will insert and update data as needed. If the time cards are already in the HS database and do not need to be updated, then nothing will change. This method returns a WSReturn object.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.
Day Number Day formatted dd
Month Number Month formatted mm
Year Number Year formated yyyy

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/setTimeCardsDeclaredTips?start_day=30&start_month=4&start_year=2016&end_day=5&end_month=5&end_year=2016" -d "[{json_object_1}, {json_object_2}, {json_object_3}...]"

Sample JSON object

  [
    {
      "jobName": "Bartender",
      "ovtTtl": 0,
      "ovtHrs": 0,
      "clockOut": "2016-05-01T23:48:00-05:00",
      "regWage": 0,
      "clockIn": "2016-05-01T16:36:00-05:00",
      "ovtWage": 7.5,
      "breakMinutes": 0,
      "jobExtId": 18,
      "jobId": -1,
      "businessDate": {
        "month": 5,
        "year": 2016,
        "day": 1
      },
      "regHrs": 7.2,
      "spcTtl": 7.25,
      "hsId": 929931332168,
      "spcHrs": 0,
      "ovtMins": 0,
      "extId": -2005922,
      "storeNum": 3,
      "empPosId": 2068,
      "regTtl": 0
    }
  ]
Key Type Description
jobName String POS job code name
ovtTtl Number Optional-Overtime total pay amount
ovtHrs Number Optional-Overtime hours in shift
clockOut String Clock out timestamp for the shift
regWage Number Regular hourly pay rate
clockIn String Clock in timestamp for the shift
ovtWage Number Optional-Overtime hourly pay rate
breakMinutes Number Number of non-paid break minutes in shift
JobId Number POS numeric identifier for the job
jobExtId Number POS numeric Job Code ID
businessDate Array Business Date information, Day, Months and Year
regHours Number Regular hours represented in shift
spcTtl Number Optional-Special Pay total pay amount
hsId Number Optional-Internal HotSchedules employee Account ID. Not required, will be set by the service.
spcHrs Number Optional-Special Pay Hours
ovtMins Number Optional-Overtime minutes in shift
storeNum Number Unique numeric store identifier. Generally set up to mirror the client internal store ID.
empPosId Number POS numeric Employee ID
regTtl Number Regular total pay amount
extId Number Optional-Unique transaction ID for the time card record

setVolumeCountsV2

This method takes in a concept ID, store ID, business date, date time, volume amount, volume type, and a revenue center for the purpose of submitting actual volume drivers to HotSchedules from a third party system or point of sale. Using the authentication from the username token and the concept and store IDs, the server will resolve which HotSchedules client this sync is for. The array contains volume driver counts for a range of dates, corresponding to the start and end dates. The server-side logic can handle overlapping data (i.e. if you sync 7 days worth of time cards, every day, 6 days of it will be “overlapping” data) and will insert and update data as needed. If the guest are already in the HS database and do not need to be updated, then nothing will change. This method returns a WSReturn object.

Query parameter Type Description
concept Number The identifier for the location’s concept. Must be unique within the company, contact HotSchedules if you’re not sure about this value.
storeNum Number Numeric (integer) identifier for the store. Must be unique within the concept.

curl -X PUT -H "Content-Type:application/json" -u <username>:<password> "https://api.bodhi.space/<namespace>/controllers/vertx/hotschedules/<concept>/<storeNum>/setVolumeCountsV2" -d "[{json_object_1}, {json_object_2}, {json_object_3}...]"

Sample JSON object

  [
    {
      "businessDate": "2014-10-05T00:00:00",
      "dateTime": "2014-10-05T06:41:00-05:00",
      "rvcExtId": 4,
      "volumeAmount": 1,
      "volumeType": "GUESTS"
    }
  ]
Key Type Description
businessDate String Business date of transaction
dateTime String Date time of transaction
rvcExtId Number Represents the numeric revenue center ID associated with the guest
volumeAmount Number Value of the volume count for the transaction
volumeType String Classification of driver requested. Allowed types would be all of the classifications supported from API, HSC, or FTP integration. “Guests”, “Tables”, “Entrees”, “Deliveries”, “Transactions” and “Products”.

Agent

Overview

The Agent provides a single integration point that enables in-store and near-store data collection.

The Platform provides real time bi-directional connections between the cloud and POS via existing Macromatix Livelink and HotSchedules Connect integrations, as well as an an in-store appliance and software agent.

The IoT Platform is built on open standards and integrates with:

Getting Started

HotSchedule IoT Platform Agent provides a single integration point that enables in-store and near-store data collection. HotSchedules IoT Platform Agent is allowed you to integrate with in store data above store data and near store data.

alt text
figure 2

Environment Setup

Installation

The agent cli is installed via a platform specific installer or via node package manager (NPM). The cli prefers to be installed globally.

$> npm install -g agent-cli

General Usage

The general structure of the a command is as follows:

$> npm install agent-cli [options] <action> [arguments]

Options

Options are prefixed with - or -- to separate them from arguments. Each action defines the options it uses, but the options are consistent in naming and usage across the commands.

Common Options

long short arg description
–help none none print help about the command
–verbose -v none print more detailed output
–quiet -q none print essential output
–config -f path specifies the agent’s configuration file
–home -h path specifies the agent’s working directory
–force -F none directive to override safety logic

Arguments

The cli interprets the first argument (non-option) as the action. All subseuqent arguements are command specific.

Each action is described below

Informational Commands

help

The command line provides built in helper functions.

For a descriptive list of the commands

$> npm install agent-cli --help

Action Specific Help

Action specific help can be requested using the following structure.

$> npm install agent-cli <action> --help

version

Print version information.

$> agent-cli --version 
$> agent-cli -V

The output is a simple version identifier following the semantic versioning rules of major, minor, and build.

vM.m.b

info

CLI splash screen for the agent.

$> agent-cli info

Lifecycle Commands

Lifecycle commands allow an administrator to change and check the run state of an agent.

start

Attempts to start an agent.

$> agent-cli start [options] 

Options

long short arg deacription
–verbose -v none print more detailed output
–quiet -q none print essential output
–config -f path specifies the agent’s configuration file
–home -h path specifies the agent’s working directory

status

Provides status about a running agent.

$> agent-cli status [options] 

Options

long short arg deacription
–verbose -v none print more detailed output
–quiet -q none print essential output
–config -f path specifies the agent’s configuration file

stop

Gracefully shutdown the agent.

$> agent-cli stop [options] 

Options

long short arg deacription
–verbose -v none print more detailed output
–quiet -q none print essential output
–config -f path specifies the agent’s configuration file

Diagnostic Commands

Diagnostic commands are used by an admin to troubleshoot an agent having trouble entering a running state or to test environmental specific details uniformly across platforms.

check-core

Used to check the version of agent-core being used and where that file is located on the file system.

$> agent-cli check-core [options]

Options

long short arg deacription
–config -f path specifies the agent’s configuration file

check-config

Used to check for configuration problems in the agent. The agent will load and process all configuration files, but will not enter into a ready state. This command is safe to run even if there is a currently running agent.

$> agent-cli check-cofig [options]

Options

long short arg deacription
–config -f path specifies the agent’s configuration file

check-connection

Used to check for configuration problems in the agent.

$> agent-cli check-connection [options]

Options

long short arg deacription
–config -f path specifies the agent’s configuration file

The provided URL will go through the following checks:

  1. Check the URL format
  2. Check the DNS resolution from the agent’s host
  3. Check the TCP port is reachable by opening up a connection on host:port
  4. Issue a HTTP GET against the ping endpoint of the system

check-route

Used to check for network problems (firewalls & proxy rules) from the perspective of the agent runtime.

$> agent-cli check-route <scheme://host:port/path>

The provided URL will go through the following checks:

  1. Parse
  2. DNS resolve of host/IP
  3. TCP port reachable by opening up a connection on host:port
  4. If scheme is http of https then issue a HTTP GET against the specified URL

Installing Bodhi Agent

Agent Installer and Registration User Guide

Welcome to the User Guide for Installing and registering the Bodhi agent

System Requirements for computer OS: Windows XP SP3, Windows 7, Windows 8.1
Memory: 2GB or more
Disk Space: 10 GB

System requirements for Mobile iOS 7.x, 8.x
Android 4.x
Windows Phone

Step 1: Download Bodhi Installer and the Bodhi Mobile Application

Go developer.bodhi.space to get the correct installer for your system

alt text

NOTE: if the system you are using to download the installer is not a Windows system you will get the Not Supported.

Just select the Windows system that matches the system you will be installer the Bodhi Agent on.

For the mobile applications here is where you can download them to your device.

Bodhi Mobile - iOS Apple Apps Store
Bodhi Mobile - Android Google Play Store

Step 2: Run the installer

alt text

Step 3: Select the Next button to move to the next Button

alt text

Step 4: License agreement screen

alt text

NOTE: the Next Button will be greyed out, until the, I accept the agreement radio button is selected.

Step 5: Select the I accept the agreement Radio Button

alt text

Step 6: Select the Next Button

alt text

Step 7: Selecting the Destination location for the Agent

alt text

NOTE: If this destination location is OK, then select the Next Button.

alt text

Go to Step 8

Step 7a: If you wish to change the location of the destination location
7a. Select the Browse Button

alt text

7b. Select the folder you wish to install the Bodhi Agent into or you can open a different folder.

alt text

7c. After you have selected the folder

alt text

7d. Select the OK Button

alt text

The New destination location should be displayed

alt text

7e. Select the Next Button to continue

alt text

Step 8: Review of Destination location.

alt text

Step 9: Select the Install Button

alt text

9a. A Progress bar will be displayed

alt text

Step 10: Installing Nodejs page

alt text

Step 11: Selecting the Next Button

alt text

Step 12: License agreement screen

alt text

NOTE: the Next Button will be greyed out, until the, I accept the agreement checkbox is selected.

Step 13: Select the I accept the agreement Radio Button

alt text

Step 14: Select the Next Button

alt text

Step 15: Selecting the Destination location for Nodejs

alt text

NOTE: If this destination location is OK, then select the Next Button.

alt text

Go to Step 16

Step 15a: If you wish to change the location of the destination location, Select the change Button

alt text

Step 15b. Select the folder you wish to install nodejs into or you can open a different folder

alt text

Step 15c. After you have selected the new folder

alt text

Step 15d. After you have selected the folder in the new selected folder

alt text

Step 15e. Select the OK Button

alt text

Step 15f. Review the Destination location

alt text

Step 16: Review of the Custom Setup.

alt text

Step 17: Select the Install Button

alt text

15h. A Progress bar will be displayed

alt text

alt text

alt text
figure 19

10b. Command Line Interface is opened

alt text
figure 20

10c. The command line window should close and you will be at the Desktop.

alt text
figure 21

Step 1: Register the Agent with a Mobile Device

Note: If your agent is not registered, it will be unable to send any data to the cloud

alt text
figure 22

Note: If the registration dialog is dismissed before registration * Select the Registration Code Menu item on the left to redisplay it

alt text
figure 23

Step 2: Start the Bodhi Mobile App

alt text
figure 24

Step 3: Enter the a Mobile Device

alt text
figure 25

Step 4: Select the POS Manager

alt text
figure 26

Step 5: Select the the Plus Sign to add a POS to the Manager

alt text
figure 27

Step 6: Select a store to associate the POS with.

Flowers figure 28

Step 7: Enter the Activation code that is displayed in the Browser.

alt text
figure 29

Step 8: Select the Request Button.

alt text
figure 30

Step 9: Verify that POS agent with the selected store and is displayed

alt text
figure 31

Step 20: The Browser will display the console dashboard

alt text
figure 32

Console Dashboard Legend

  1. This is the status of the agent (e.g. Online, Offline)
  2. This changes the Left Menu from Icon Only to Icons and Text

Congratulations on your successful installation of Bodhi Agent

Creating an Agent Application

Configuring Agent Application

Parameters

Mutable environmental variables that can be modified in Agent Manager. Values can overwrite default settings.

Property Type Description
description String Description in Agent manager application
type String Expected data type of parameter value
setting String Assigned variable name to this parameter
required Boolean True or False
default String The default value of the parameter if not set

Parameters example

parameters : {
        master_id: {
            description : 'System ID of Master Agent',
            setting     : 'master_id',
            type        : 'string',
            required    : true
        },
        role: {
            description : 'Role of Master Agent for Slave to assume',
            type        : 'string',
            setting     : 'role',
            required    : true
        }
}

Extensions

Extensions are injected dependencies that your application can refer to. Your application may use one or more extensions. Extensions can provide potential configuration components or actual runtime components. Extensions are a good way to design resuable components that can be shared and reused across projects. Extensions are loaded in the order in which they are specified.

Property Type Required Description
module String Yes By default searches node_modules folder. Relative path also accepted.

Extensions example

extensions  : [
        { module: './lib/plugin.js' },
        { module: 'agent-ext-timers' }
]

Settings

A Setting is an Object that represents static configuration data. Parameters can overwrite a setting if the property matches a parameter key. These values will take the highest precedence in the processing of settings. The precedence rules are:

  1. Agent.json settings object (highest precedence)
  2. Any settings within the js/json files in the settings folder
  3. Any settings added by an extension (lowest precedence)
Property Type Required Description
property String Yes Name of your property
value String, Function, Boolean, Number, Object Yes The value of your setting

Settings example

settings: [
        {
            property: 'master_id',
            value: '588f9fc508a94349cc1ad3b8'
        },
        {
            property: 'role',
            value   : 'pos-monitor'
        }
]

Counters

Tracks the number of times specific application events occur and are logged found in the Agent heartbeat. Each counter can subscribe to an array of application events.

Counters example

 counters: {
        activations : ['app:monitor'],
        success     : ['app:success'],
        stopped     : ['app:stopped'],
        failed      : ['app:failed' ]
}

Sources

An object that sources external events. Sources bind events to listeners and emits application level events. Any counters, handlers and pipelines subscribed to source events are initiated.

Property Type Required Description
name String Yes Unique identifier (within the context’s handler)
provider String or Function Yes A function or reference to a plugin that creates an object
args Array of Strings, Functions, Objects, Booleans Optional A list of dependencies used by the source
bindings Object Optional A Map that routes external events to internal topics
factory String Optional An enumeration that describes alternate instantiation behavior for the service constructor, function, literal

Sources example

sources: [ 
        {
           name: 'sampleSource',
           provider: 'compris:dir',
           args: ['$settings:rootPath'],
           bindings: { 'created' : 'read' }
        } 
]

Services

A Service is an Object that represents a concrete extension of the API. Services are singletons.

Property Type Required Description
name String Yes Unique identifier (within the context’s handler)
provider String or Function Yes A function or reference to a plugin that creates an object
args Array of Strings, Functions, Objects, Booleans Optional A list of the dependencies used by the service
factory String (Constructor, Function, Literal) Optional An enumeration that describes alternate instantiation behavior for the service

Services example

services: [
        {
            name: 'cloud',
            provider: 'connection:resources'
        }
]

Handlers

A Handler is a Function that responds to events within an application.

Property Type Required Description
name String Yes Unique identifier (within the context’s handler)
subscriptions Array Yes String of application level events that will initiate this handler
fn String or Function Yes A function or reference to a plugin will handle the events
props Object Optional A list of properties available to the instance

Handlers example

handlers: [
        {
            name            : 'Monitor Master Agent',
            subscriptions   : ['app:monitor'],
            fn              : '$plugins:handler:monitor',
            props           : {
                master_role : '$setting:role',
                conn        : '$service:cloud',
                master_id   : '$setting:master_id',
                getInfo     : '$plugins:core:info',
                identity    : '$plugins:core:identity',
            }
        },
        {
            name            : 'Update Agent Role',
            subscriptions   : ['app:update'],
            fn              : '$plugins:handler:update',
            props           : {
                conn        : '$service:cloud',
            }
        }
]

Pipelines

Similar to handlers, pipeline(s) are subscribed to event(s). The difference being that pipelines execute a series of steps rather than just one function. Each pipeline step should follow the single responsiblity principle. Each step is given two arguments - input and a callback.

Property Type Required Description
name String Yes Unique identifier
subscriptions Array Yes String of application level events that will initiate this pipeline
steps Array Yes Takes an array of objects described below
failed String Optional Emits mapped event based on the state of the pipeline
success String Optional Emits mapped event based on the state of the pipeline
done String Optional Emits mapped event based on the state of the pipeline

Pipeline.steps

pipeline | Object

Property Description
fn Functional plugin reference. See pipeline and fn description below
props Optional dependencies to be injected in the pipeline function context

Pipeline.fn(input, callback)

input | Object
Initially an empty object. Later becomes whatever the result of the previous pipeline step is.

callback | Function
Needs to be invoked with a possible error arguement and an optional result to be passed in to the next step. If an error is passed in, it will stop the pipeline and the failed event will be emitted.

Context of this callback includes core methods described below as well as Pipeline.props injected during configuration.

Property Description
logger Logs viewable in Agent Manager
publish EventEmitter that takes in a event and message
name Pipeline.name
event Name of event that triggered the pipeline

Pipelines example

// pipeline breakdown of handlers

    pipelines: [
        {
            name: 'Monitor Master Agent',
            subscriptions: ['app:monitor'],
            steps: [
                { fn: '$plugins:core:identity:addAgentInfo'     },
                { fn: '$plugins:main:checkMasterAgentStatus'    },
                { fn: '$plugins:main:processAgentStatus'        }
            ],
            stopped : 'app:stopped',
            failed  : 'app:failed'
        },
        {
            name: 'Update Status',
            subscriptions: ['app:update'],
            steps: [
                { fn: '$plugins:main:patchAgentRole'    },
                { fn: '$plugins:main:syncAgent'         }
            ],
            stopped : 'app:stopped',
            failed  : 'app:failed'
        }
]

Init

Init is a function that is given a callback as its only argument. This callback must be invoked in order to intialize the application. The keyword “this” refers to the application’s reactive context

Init example

init: function(done){

        this.publish('app:initialized');

        console.log('###################################');
        console.log('## ' + pkg.name.toUpperCase());
        console.log('## v' + pkg.version);
        console.log('###################################');

        done();
}

Creating an Agent Source

Returns a function that instantiates an Agent source. See sample code that watches for any directory changes using npm watch.

Sample Code:

var fs      = require('fs-extra');
var watch   = require('watch');

module.exports = function dirSrc() {
    var path        = arguments[0];
    var source      = {};
    source.routers  = {};

    var bind = function bindDir(bindings, emitter, done) {
        var logger = this.logger;

        logger.info('Ensuring ', path, 'exists...');

        if (!path) return done('Expected path to exist. Please ensure args array is properly configured.');

        fs.ensureDir(path, function (err) {
            if (err) return done(err);

            logger.info(path, 'ensured.');
            /*
                bindings = { 'created' : 'read' }
                emitter = fn()  { context.emit.apply(context, arguments); }
                done = fn()      { return exit(done, source); }

                YOU HAVE TO CALL DONE OR ELSE THE REST OF THE APP WILL NOT LOAD
                KICK LISTEN OR IT WILL NOT HEAR
            */

            // routes = ['created']
            var routes = Object.keys(bindings);

            /*
                routers = {

                        emitter(event, arguments);
                    }
                }
            */
            routes.forEach(function (event) {
                source.routers[event] = function () {
                    emitter(bindings[event], { path: arguments[0], detail: arguments[1] });
                }
            });

            done();
        });
    };

    /*
        SOURCES GET LOADED BEFORE INIT
            ENSURE DIR BEFORE SETTING MONITORS
    */
    var listen = function listenDir(cb) {
        watch.createMonitor(path, function (monitor) {
            source.monitor = monitor;
            ['created', 'changed', 'removed'].forEach(function (e) {
                if (source.routers[e]) {
                    source.monitor.on(e, function (file, detail) {
                        source.routers[e](file, detail);
                    });
                }
            });
        });
    };

    var close = function closeDir() {
        source.monitor.stop();
    };

    return function (cb) {
        cb(null, { bind: bind, listen: listen, close: close})
    }
};
Property Type Description
bind Function Responsible for binding application level events when a source level event occurs
listen Function Creates EventEmitter that emit application level events based on bind
close Function Destroy existing EventEmitter for the source

Creating an Agent Extension

Returns an Agent extension object.

Property Type Description
name String Name of extension used primarily for debugging purposes
attach Function Attach the specified extension to this instance, extending the ReactiveContext with new functionality with the implicit registerPlugin method

Sample Code:

module.exports = {
    name        : 'plugin',

    attach      : function (overloads, done) {

        /** LOAD HANDLERS **/
        this.registerPlugin(['handler', 'monitor'   ], require('./handlers/monitor.js'  ));
        this.registerPlugin(['handler', 'update'    ], require('./handlers/update.js'   ));

        done();
    }
};

Agent Path Resolution

Every extension, service and setting can be injected through namespacing

Type Reference Sample
extension “$plugins” “$plugins:myFunction”
service “$service” “$service:cloud”
setting “$setting” “$setting:jobInterval”

Job Engine

Creating a job engine application

Introduction
Bodhi Job Engine is a job scheduler running on node.js and MongoDB. The engine is designed to run scheduled cloud-to-cloud data transactions, e.g. requesting data from web APIs, pushing data to the Bodhi cloud, etc.

Work Functions
Jobs must be built in a specific format in order for Bodhi Job Engine to recognize and run them properly. The job should contain an index.js file that follows this structure:

index.js

module.exports = function work(context, done){
    //the work of your job
    done(errThatOccurred, messageToReport, stateToSave);
};

Context Object

Key Type Description
connection bodhi-js-client https://www.npmjs.com/package/bodhi-driver-superagent
settings Object immutable configuration options associated with this job
state Object mutable persistent state from previous runs
meta Object immutable metadata about the job

meta

{

}

Job Metadata

Key Type Description
name String name of the job
package String package name
version String semantic package version
namespace String namespace of the job
lastRun Data last time the job ran

Callback
A job must be completed by calling the callback

arg type required description
err Error optional if err != null then the job did not process properly
message String optional a string to be recorded in the message
state Object optional the state to persist for the next run

Example Job: Hello World

This is a very basic Hello World job.

module.exports = function(options, done){
  console.log('HELLO WORLD!');

  if(err){
    done(err);
  }
  else{
    done();
  }
};

Example Job: Get and Use Some Data

Get and use data

module.exports = function(options, done){

  var client = options.connection;
  var data   = options.state;
  data.storestuff = [];

  client.get(['resources', 'Store'].join('/'), function(err, data, ctx){
    if(err){
      done(err);
    }
    else{
      data.forEach(function(store){
        data.storestuff.push(store.store_name + ' is an awesome store!');
      });
    }
  });

  var json = {

    "data1": "some data you need to post",
    "data2": "also data you need to post"
  };

  client.post(['resources', 'aCustomType'].join('/'), json, function(err, data, ctx){

    if(err){
      done(err);
    }
    else{
      console.log('Server says: ', ctx);
      done();
    }
  });
};

This is a less basic example job that uses HTTP requests and stores data in the “state” property of the options object. Data stored in the state property persists between jobs and is available in the next execution of the job.

Publishing Applications

Overview

To publish application for the IoT Platform, you need to follow a few simple steps to describe your application.

Configuring package.json

To publish your application, add the following directory structure for your application:

    /<app-name>/
            /public/

To publish an app into the IoT Platform you have to zip up the following:
index.js
LICENSE
package.json

    folder=<public>
      app_icon.png
      NewType1.json file (optional)
      NewType2.json file (optional)
      NewType3.json file (optional)
      ...

Example package.json for Mobile Applications

By Clicking on HS Template you get a package.zip file that is downloaded to your desktop that contains the following:

package.json that gets includes with HS Template's zip file:

{
    "name": "HSappTemplate",
    "version": "0.0.0",
    "title": "HSappTemplate",
    "description": "New application Hello, World!",
    "profile": {
        "name": "HSappTemplate",
        "dml": {
            "BodhiApplication": {
                "select": {}
            }
        }
    },
    "settings": {
        "publisher": "",
        "categories": [""],
        "offline": false,
        "navigationBar": "auto",
        "location": "S3",
        "storage": "s3",
        "type":"mobile"
    },
    "dependencies": {
        "bodhi-mobile":"*" 
        },
    "autoUpdateVersion": true
}

Example of Package.json for agent or job Applications

Example of package.json for agent or job applications:
#!javascript

{
  "name": "app-package-name",
  "version": "0.0.1",
  "title": "Application Title",
  "description": "Short Application Description.",
  "profile": {
    "name": "app-package-name",
    "dml": {
      “BodhiApplication": {
       "select": {},
       "update":{},
       "delete":{},
       "insert":{}
      },
      "NewType1": {
        "select": {}
      },
      "NewType2": {
        "select": {}
      }
    }
  },
  "settings": {
    "categories": [
      "Aloha",
      "POS"
    ],
    "publisher": "your company",
    "npm_package_name": "app-package-name",


if you have any related apps you want to install together::
"related-apps": [
      "bodhi.aloha-app-transactions",
      "bodhi.aloha-app-store"
    ],
    "public_path": "public",
    "global_store_icon": "public/icon.png",
   "location": "S3",
   "storage": "s3",
   "type": "agent",    
(type can be “job”, “agent”, “mobile”, “web” )   
 "new_type_required": true,
  "install": {
"new": {
"model": [
{
"type": "enumeration",
"name": "TypeName",
"object": "Enumerations/TypeName.json"
},
{
"type": "embedded_type",
"name": "InventoryPurchaseOrder",
"object": "Types/InventoryPurchaseOrder.json"
},
{ "type": "custom_type",
"name": "TypeName2",
"object": "Types/TypeName2.json"
}
],
"post-type-install": [
{"action": "POST",
"object": "Data/DataFile.json",
"path": "/resources/DataFile"
}
]
if you have any parameters required to be used with the app we add this section:: 
 "agent_parameters": {
      "interval": {
        "description": "How often to execute a grind",
        "required": true,
        "type": "string",
        "default": "every 15 minutes",
        "position": 1
      }
    }
  },
  "autoUpdateVersion": false
}

Description of package.json contents

name=“HSappTemplate” required

The name of your application must match the name of the profile

“version”: “0.0.1” required

Ideally this is the version of your application that gets posted as versions show for Agent Application in the Agent Event Logs so keeping this version the same as your Agent Application that is published is highly recommended.

“title”: “Application Title” required

This is the title that will show on the HotSchedules Store once you publish your application to the HotSchedules Store.

“description”: “Short Application Description.” required

The description is the application description that will be displayed with the title for your application when displayed in the HotSchedules Store. Description will be part of “Learn More” button.

“profile”: {} required

The profile section contains the following required sections:

“settings”:{} required

The settings is the main section of package.json contains the following sections:

agent_parameters/job_parameters

Depending on your application needs, you may want to have parameters setup for your applications. Both Agent and Job applications can take parameters. The agent/job_parameters contain information about any parameters that the agent or job requires to run. They contain data_dir formatted information containing description, a required flag, type string and an optional position which is set will position the parameter in the order set 0, 1, 2, etc if not set then the parameter will be displayed in the order it’s defined. Application parameters will be saved under settings so the application should use parameters from settings.

NOTE: The hidden parameter option will not be visible to the user in the installation process but will be written under the application settings.

The following are examples of parameters that can be set for agent or the job applications respectively:

Agent Parameters example:

Example of agent parameters that can be defined for an agent application:

    "agent_parameters": {
      "config_file_path": {
        "description": "Config file location",
        "required": true,
        "type": "string",
        "default": "",
        "setting": "config_file_path"
      },
      "data_dir": {
        "description": "Folder location to save database files for the agent app",
        "required": true,
        "type": "string",
        "default": "C:/bodhiAgent/node_modules/merit-agent-labor/_xmloutput/",
        "setting": "data_dir"
      },
      "number_of_days_to_query": {
        "description": "Limit query to this number of days",
        "required": true,
        "type": "integer",
        "default": 60,
        "setting": "number_of_days_to_query"
      },
      "interval": {
        "description": "How often to execute a grind",
        "required": true,
        "type": "string",
        "default": "every 12 hours",
        "setting": "interval"
      },
      "local_storage_ignore_flag": {
        "description": "Ignore local storage and write all data",
        "required": true,
        "type": "boolean",
        "default": false,
        "setting": "local_storage_ignore_flag"
      }
    }
Job Parameters example:
    "job_parameters": {
      "timing_expression": {
        "description": "How often to execute a job",
        "repeat": true,
        "type": "string",
        "default": "60 minutes"
      },
      "brink_location": {
        "description": "The alpha numeric string provided by the Brink POS API to identify the store location, e.g. tSm8y1TMSk7J4ZMyQBpeTg==",
        "type": "string",
        "required": true,
        "setting": "brink_location"
      },
      "accessToken": {
        "description": "The alpha numeric string provided by the Brink POS API to authenticate the user",
        "type": "string",
        "required": true,
        "setting": "accessToken"
      },
      "uri": {
        "description": "The url for the Brink POS API service e.g. https://api2.brinkpos.net/",
        "type": "string",
        "required": true,
        "setting": "uri"
      }
    }

offline=true/false

Offline controls whether the container will cache application information for offline use. If offline=true and the user launches the application, any data that was previously loaded will be available when the device is offline. This will also enable queuing of data to write to the IoT Platform if the application has write permissions.

single_container_app=true/false

single_container_app tells the container know whether the app should be displayed with a menu (a collection of apps) or as a standalone single app. Bodhi Mobile has single_container_app = false. Bodhi Reveal has single_container_app = true

hide_from_global_store=true/false

hide_from_global_store controls whether the app is available to the general public to see in the global app store. Apps like Settings which cannot be removed should have hide_from_global_store=true

new_type_required=true/false

new_type_required tells the installer of the app in the global app store if the app will run 'out of the box’ or if new custom types need to be installed on the namespace. NOTE:: if new_type_required=true, troubleshooting_url should be required

screenshots{}

The screenshots array contains relative paths to screenshots which the Global App Store will use for display purposes. These files should be included in the app folder that is published and the path should be relative to the public_path.

data_dir:{}

The data_dir formatted information contains a description, a required flag, type string and an optional position which is set will position the parameter in the order set 0, 1, 2, etc if not set then the parameter will be displayed in the order it’s defined.

“autoUpdateVersion”: “false”

This flag prevents autoUpdate version of the app each time you publish. If you mark this false, you need to manually bump the version of the app each time you update it.

Example Type Definition

This is an example of an enumeration, embedded_type and custom_type.

NOTE: All enumerations must be declared first, embedded_type must be after enumerations and custom_types have to be defined after enumerations and embedded_types: This example shows the objects as folders under the application’s root directory. This is where you define your json for each type. There is a one to one correspondence of the type declared in package.json to the json defining that type in the folder under the application.

Defining your custom schema/types example:
"install": {
"new": {
"model": [
{
"type": "enumeration",
"name": "TypeName",
"object": "Enumerations/TypeName.json"
},
{
"type": "embedded_type",
"name": "InventoryPurchaseOrder",
"object": "Types/InventoryPurchaseOrder.json"
},
{ "type": "custom_type",
"name": "TypeName2",
"object": "Types/TypeName2.json"
}
],
"post-type-install": [
{"action": "POST",
"object": "Data/DataFile.json",
"path": "/resources/DataFile"
}
]

Adding Scripts and Versioning: “versions”: [..]

To make an application script available set the following in the settings section of your package.json:

Template for adding scripts/versions to package.json
versions:[
{
    "version": "<script_version>",
    "bundle": "<jar_name>",
    "pre-type-install": {
      "main": "<main_class_name>"
    },
    "post-type-install": {
      "main": "<main_class_name>"
    }
]
Example of versions/scripts using seed-data:
    "versions": [
      {
        "bundle": "installer.jar", 
        "post-type-install": {}, 
        "pre-type-install": {}, 
        "seed-data": [
          {
            "action": "POST", 
            "object": "Data/measurements.json", 
            "path": "/resources/InventoryUnitOfMeasure"
          }, 
          {
            "action": "POST", 
            "object": "Data/conversions.json", 
            "path": "/resources/InventoryUomConversion"
          }
        ], 
        "version": "new"
      }, 
      {
        "bundle": "upgrade-3.0.0.jar", 
        "post-type-install": {
          "main": "com.bodhi.vertx.appinstaller.script.DeveloperScript"
        }, 
        "version": "2.7.19"
      }
    ]

Publishing to shop

1 - Ensure that you have your package.json, LICENSE and index.html in the root folder of your application. Note that index.html can be an empty file.

2 - Zip/compress your files. Note that the files we are compressing are the files itself not the project folder.

3 - Login to Bodhi Shop: https://tools.bodhi.space/shop/#/my

alt text

4 - Click Publish App.

alt text

5 - Upload zip file.

alt text

6 - Verify fields are correct then publish.

alt text

7a - Verify that your application is successfully published.

alt text

7b - Make sure your file is found in https://tools.bodhi.space/file-upload/#/files. If it doesn’t exist refer back to configuring your package.json file

alt text

Monitoring Application

Logs can be found here: https://tools.bodhi.space/job-engine-manager/#/jobs?filters=all,all

alt text

HotSchedules IoT Platform Mobile API

Overview

The HotSchedules IoT Platform Mobile API provides application developers access to native device features for use in web applications. These features are typically unavailable in the HTML5 specification, not uniformly supported across all mobile browsers or improve on the orginal HTML5 spec. In some cases new features have been added that combine several device characteristics into one, for example bar code scanning uses camera storage and image recognition.

There is only one API required to deliver applications on Android IOS mobile devices.

The Bodhi Mobile API provides interface to the native features of a mobile device across iOS and Android.

See descriptions and info below:: (For full implementation details, see our detailed docs on

Bodhi Mobile API

Getting Started

HotSchedules Passbook is a mobile application than allows users to access their data on any mobile device.

With HotSchedules Passbook for IOS and Android you can access and publish applications accessing sales, labor and metrics data. HotSchedules Passbook allows hybrid applications to be deployed and immediately live in HotSchedules Passbook.

Building Your Mobile Application

With HotSchedules Passbook you can build Native, HTML5 or Hybrid applications.

The easiest way to get your app out to customers