Unit Resource

A unit resource can be associated with streams. It allows a user to associate a symbol and formatting to streams data points.

Symbol Location Types:
  • BEFORE
  • AFTER

Boolean Style Types:
  • TRUE_FALSE
  • ONE_ZERO
  • ON_OFF
  • YES_NO
  • CLOSE_OPEN
  • OPEN_CLOSE
  • HIGH_LOW
  • LOW_HIGH

GET unit



Returns a list of unit resources.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token token compatible? Yes

Resource URL

http://grovestreams.com/api/unit

Parameters

none


Example Requests

/unit

Response Body
{
  "message": "",
  "unit": [
    {
      "uid": "0419e300-c04f-4fac-9764-10b611ced91e",
      "symbol": " lbs",
      "numberFormat": "0,000.00",
      "name": "Pounds",
      "booleanStyle": "ON_OFF",
      "symbolLocation": "AFTER"
    },
    {
      "uid": "0f30fb84-edc6-46e7-8003-f1192663a5f2",
      "symbol": "C",
      "numberFormat": "0,000.00",
      "name": "Celsius",
      "booleanStyle": "ON_OFF",
      "symbolLocation": "AFTER"
    },
    {
      "uid": "23870361-ae59-4622-9938-2df3da07b06c",
      "symbol": "",
      "numberFormat": "0,000.00",
      "name": "No Symbol",
      "booleanStyle": "ON_OFF",
      "symbolLocation": "AFTER"
    }
  ],
  "totalCount": 3,
  "success": true
}


GET unit/{unitUid}



Returns a unit with the specified uid.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible? Yes

Resource URL

http://grovestreams.com/api/unit/{unitUid}

Parameters

none


Example Requests

/unit/57b08e18-df08-415e-b663-94db1d53bd20

Response Body
{
  "message": "",
  "unit": {
    "uid": "57b08e18-df08-415e-b663-94db1d53bd20",
    "symbol": "$",
    "numberFormat": "0,000.00",
    "name": "Dollars",
    "symbolLocation": "BEFORE",
    "booleanStyle": TRUE_FALSE,
  },
  "success": true
}


GET unit/new



Returns a default unit with a unique UID. Does not persist the new unit in the store. It's the callers responsibility to PUT the new unit and register it.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

http://grovestreams.com/api/unit/new

Parameters

none

Example Requests

/unit/new

Response Body
{
  "message": "",
  "unit": {
    "uid": "57b08e18-df08-415e-b663-94db1d53bd20",
    "symbol": "",
    "numberFormat": "",
    "name": "",
    "symbolLocation": "AFTER",
    "booleanStyle": TRUE_FALSE,
  },
  "success": true
}




PUT unit



Inserts a new unit.

The uid of the unit can be blank. If it is blank a uid will be created on the server and the response body will contain the new uid.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

http://grovestreams.com/api/unit

Parameters

parentFolderUid optional
The UID of the tools content repository folder to place this new unit into. The new unit will be placed into the root folder if this parameter is missing.

Example Requests

/unit

Request Body
{
  "unit": {
    "uid": "57b08e18-df08-415e-b663-94db1d53bd20",
    "symbol": "$",
    "numberFormat": "0,000.00",
    "name": "Dollars",
    "symbolLocation": "BEFORE",
    "booleanStyle": TRUE_FALSE,
  }
}


POST unit



Used to update an existing unit.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

http://grovestreams.com/api/unit

Parameters

none

Example Requests

/unit

Request Body

{
  "unit": {
    "uid": "57b08e18-df08-415e-b663-94db1d53bd20",
    "symbol": "$",
    "numberFormat": "0,000.00",
    "name": "Dollars",
    "symbolLocation": "BEFORE",
    "booleanStyle": TRUE_FALSE,
  }
}


DELETE unit/{unitUid}



Deletes a unit. Any streams that are referencing this unit will no longer reference a unit.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

http://grovestreams.com/api/unit/{unitUid}

Parameters

none

Example Requests

/unit/d251a8f2-f7b9-4df7-886d-b24c7f4929d4

Response Body
{
    "message" : "Deleted Unit with uid 'd251a8f2-f7b9-4df7-886d-b24c7f4929d4'",
    "success" : true
}