Action Package Resource

An action_pkg resource describes a set of actions. action_pkg resources can be associated with stream events. If a steam event trigger expression returns "true" then all actions for the associated start_trigger_action_pkg and stop_trigger_action_pkg are taken.

Events, triggers and actions are built to be scalable. Each stream can have many events, each with many response packages.

Stream event triggers interrogate values as they are uploaded within the same transaction as the upload. If a trigger expression returns true then all event action processing is started within the same feed upload process but on a new thread so as to not slow down a feed's upload time but to also give a rapid event response time.

Action Delivery Types:
  • EMAIL
  • GS_NOTIFICATION
  • SMS
  • HTTP
HTTP Method Types:
  • PUT
  • POST
  • GET
  • DELETE

Action Properties:
  • name: The name of the Action
  • enabled: Whether the action is enabled.
  • deliveryType: see above
  • to: comma separated list. List is either phone numbers if SMS type, email addresses if EMAIL type, URLs if HTTP type. Not used if GS_NOTIFICATION.
  • toUserRefs: array of user descriptors. Users must be members of the organization (org_users) this action_pkg belongs to. Used by each delivery type except HTTP.  The "to" property and the toUserRefs property can both be used for the same action.
  • emailCc: comma separated list of user email addresses. Only used by EMAIL actions.
  • subjectBody: The subject line of an email or grovestreams' notification. Only used for EMAIL and GS_NOTIFICATION delivery types.
  • messageBody: Used by all action delivery types.

GET action_pkg



Returns a list of action_pkg 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/action_pkg

Parameters

none


Example Requests

/action_pkg

Response Body
{
  "message": "",
  "totalCount": 9,
  "action_pkg": [
    {
      "uid": "011cc19c-e220-3f46-9c77-c06891aa0204",
      "enabled": true,
      "description": "Description",
      "name": "n1805495575"
    },
    {
      "uid": "0c3331df-a531-3a0f-9b12-0bd68d21e9c1",
      "enabled": true,
      "description": "Description",
      "name": "ZZZZZZZZZ2"
    },
    {
      "uid": "2d68dc75-6d93-3a28-91b0-9240d71eb704",
      "enabled": true,
      "description": "Description",
      "name": "n105426237"
    },
    {
      "uid": "42b919d2-113d-3772-a0b9-56650707c275",
      "enabled": true,
      "description": "Description",
      "name": "AAAAAAAAAA"
    },
    {
      "uid": "9fa1e995-c275-32d6-873a-5754cc6ffe8a",
      "enabled": true,
      "description": "Description",
      "name": "AAAAAAAAA2"
    },
    {
      "uid": "a593df68-acc8-3408-b672-623ebb18926a",
      "enabled": true,
      "description": "Description",
      "name": "n1669314730"
    },
    {
      "uid": "ef084a68-dd91-34e3-8aac-b28eef269fb1",
      "enabled": true,
      "description": "Description",
      "name": "zzz"
    },
    {
      "uid": "fd3d594c-723f-31c8-9591-238c6e8ce281",
      "enabled": true,
      "description": "Description",
      "name": "n-1288949146"
    },
    {
      "uid": "fe0d4d47-b036-343b-a168-6b6b7effc21f",
      "enabled": true,
      "description": "Description",
      "name": "n389905560"
    }
  ],
  "success": true
}


GET action_pkg/{actionPkgUid}



Returns a action_pkg 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/action_pkg/{actionPkgUid}

Parameters

none


Example Requests

/action_pkg/ec78a962-8918-3c5d-92b0-d55534b5d028

Response Body
{
  "message": "",
  "action_pkg": {
    "uid": "ec78a962-8918-3c5d-92b0-d55534b5d028",
    "enabled": true,
    "description": "Description",
    "name": "An Event",
    "action": [
      {
        "uid": "576f3373-64e6-39b0-8f24-83b29941cec1",
        "to": "a@a.com, b@b.com",
        "messageBody": "Message as text",
        "messageBodyHtml": "Message as html",
        "enabled": true,
        "deliveryType": "EMAIL",
        "subjectBody": "subject line",
        "toUserRefs": [
          {
            "uid": "63c19948-eb8d-3452-b6e8-a7aa0d9b2baa",
            "name": "Fred Flintstone",
            "type": "user"
          }
        ],
        "httpMethodType": "PUT",
        "emailCc": "x@x.com",
        "name": "Send Emails"

      },
      {
        "uid": "11d1d445-8f35-3e24-a0c1-e4f9bccb8d67",
        "to": "555-1616, 555-1617",
        "messageBody": "Message as text",
        "messageBodyHtml": "Message as html",
        "enabled": true,
        "deliveryType": "SMS",
        "subjectBody": "",
        "toUserRefs": [
         
        ],
        "httpMethodType": "GET",
        "emailCc": "",
        "name": "Send SMS Text Messages"
      }
    ],
    "processActionsSequentially": true
  },
  "success": true
}


GET action_pkg/new



Returns a default action_pkg with a unique UID. Does not persist the new action_pkg in the store. It's the callers responsibility to PUT the new event 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/action_pkg/new

Parameters

none

Example Requests

/action_pkg/new

Response Body
{
  "message": "",
  "action_pkg": {
    "uid": "8732e07d-12c3-30b5-ba4e-9036196ed85d",
    "enabled": true,
    "description": "",
    "name": "",
    "action": [
     
    ],
    "processActionsSequentially": false
  },
  "success": true
}

GET action/new



Returns a default action with a unique UID. Does not persist the new event in the store. Also populates fields with defaults depending on the deliveryType arguments.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

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

Parameters

deliveryType required
See the top of this page for possible values.

Example Requests

/action/new

Response Body
{
  "message": "",
  "action": {
    "uid": "f72713d1-67b5-35a4-adba-f961cff2c96c",
    "to": "",
    "messageBody": "",
    "messageBodyHtml": "",
    "enabled": true,
    "deliveryType": "GS_NOTIFICATION",
    "subjectBody": "",
    "toUserRefs": [
     
    ],
    "httpMethodType": "GET",
    "emailCc": "",
    "name": ""
  },
  "success": true
}

PUT action_pkg



Inserts a new action_pkg.

The uid of the action_pkg can be blank. If it is blank a uid will be created on the server and the response body will contain the new uid. If Action UIDs are blank, new ones will be assigned during the put and returned.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible
Yes

Resource URL

http://grovestreams.com/api/action_pkg

Parameters

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

Example Requests

/action_pkg

Request
Body
{
  "action_pkg": {
    "uid": "f8a0c6ae-131e-3735-82f0-ddb4e57fda24",
    "enabled": true,
    "description": "Description",
    "name": "An Event",
    "action": [
      {
        "uid": "0e81d1e2-99e1-3599-860c-8df7c4dcdad4",
        "to": "a@a.com, b@b.com",
        "messageBody": "Message as Text",
        "messageBodyHtml": "Message as Html",
        "enabled": true,
        "deliveryType": "EMAIL",
        "subjectBody": "subject line",
        "toUserRefs": [
          {
            "uid": "0227e233-2684-35ee-afe0-c651805e9379",
            "type": "user"
          }
        ],
        "httpMethodType": "PUT",
        "emailCc": "x@x.com",
        "name": "Send Emails"
      },
      {
        "uid": "a864e4af-d90a-31dc-9d79-c87f8eaef209",
        "to": "555-1616, 555-1617",
        "messageBody": "Message as Text 2",
        "messageBodyHtml": "Message as Html 2",
        "enabled": true,
        "subjectBody": "",
        "toUserRefs": [
         
        ],
        "httpMethodType": "GET",
        "emailCc": "",
        "name": "Send SMS Text Messages"
      }
    ],
    "processActionsSequentially": true
  },
}

POST action_pkg



Used to update an existing action_pkg. If Action UIDs are blank, new ones will be assigned during the put and returned. Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key token compatible Yes

Resource URL

http://grovestreams.com/api/action_pkg

Parameters

none

Example Requests

/action_pkg

Request
Body
{
  "action_pkg": {
    "uid": "f8a0c6ae-131e-3735-82f0-ddb4e57fda24",
    "enabled": true,
    "description": "Description",
    "name": "An Event",
    "action": [
      {
        "uid": "0e81d1e2-99e1-3599-860c-8df7c4dcdad4",
        "to": "a@a.com, b@b.com",
        "messageBody": "Message as Text",
        "messageBodyHtml": "Message as Html",
        "enabled": true,
        "deliveryType": "EMAIL",
        "subjectBody": "subject line",
        "toUserRefs": [
          {
            "uid": "0227e233-2684-35ee-afe0-c651805e9379",
            "type": "user"
          }
        ],
        "httpMethodType": "PUT",
        "emailCc": "x@x.com",
        "name": "Send Emails"
      },
      {
        "uid": "a864e4af-d90a-31dc-9d79-c87f8eaef209",
        "to": "555-1616, 555-1617",
        "messageBody": "Message as Text",
        "messageBodyHtml": "Message as Html",
        "enabled": true,
        "deliveryType": "SMS",
        "subjectBody": "",
        "toUserRefs": [
         
        ],
        "httpMethodType": "GET",
        "emailCc": "",
        "name": "Send SMS Text Messages"
      }
    ],
    "processActionsSequentially": true
  },
}

DELETE action_pkg/{actionPkgUid}



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

Resource URL

http://grovestreams.com/api/action_pkg/{actionPkgUid}

Parameters

none

Example Requests

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

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