/keywords/{id}/commands

Use this resource to view or create new commands, which are always associated with a keyword.

Secured By: Authentication Token
Description:

List commands associated with a keyword.

Responses with more than 50 records will be paginated to 50 records per response, unless otherwise specified.

Headers

Name Required Type Description
X-AUTH-TOKEN * string

An authentication token provided to you by GovDelivery.

Status

Headers

Name Type Description
Link string

Appropriate pagination link relations. Can include “first”, “last”, “prev”, and “next” relations.

Example

< /keywords/{id}/commands?page=1>; rel="first",
< /keywords/{id}/commands?page=2>; rel="prev",
< /keywords/{id}/commands?page=4>; rel="next",
< /keywords/{id}/commands?page=5>; rel="last"

Body

Format: application/json

Example
[
  {
    "command_type": "dcm_subscribe",
    "name": "Subscribe to news topics",
    "updated_at": "2013-01-14T19:54:11Z",
    "params": {
      "dcm_account_code": "ACCOUNT_CODE",
      "dcm_topic_codes": ["TOPIC_CODE_23", "TOPIC_CODE_90"]
    },
    "_links": {
      "self": "/keywords/1/commands/1"
    },
    "created_at": "2013-01-14T19:54:11Z"
  },
  {
    "command_type": "forward",
    "name": "Forward to localhost",
    "updated_at": "2013-01-14T16:16:27Z",
    "params": {
      "encrypted_password": "DUcHK915xSpHANiK8KvMug==\n",
      "url": "http://localhost/forward",
      "http_method": "POST",
      "username": "example@evotest.govdelivery.com"
    },
    "_links": {
      "self": "/keywords/1/commands/2"
    },
    "created_at": "2013-01-14T15:26:48Z"
  }
]
Schema
Object that may include:
Name Type Description
name string

Name of the command for later reference.

Example

OpenWeatherMap Forwarder
command_type string

Specifies what type of command this is.

Valid Values:

  • dcm_subscribe
  • dcm_unsubscribe
  • forward

Example

forward
params string

The parameters to be associated with this command. The list of parameters for each command type can be found by querying the Command Type relation.

Example

{
  "dcm_account_code": "ACCOUNT_CODE",
  "dcm_topic_codes": ["TOPIC_CODE_23", "TOPIC_CODE_90"]
}
created_at string

The date and time when the command was created.

Example

2013-01-30T17:45:27Z
updated_at string

The date and time when the command was last updated.

Example

2013-01-30T17:45:27Z
_links object

An object that defines links to related objects.

Properties

{
  "self": {
    "description": "Relative URI of the object",
    "type": "string",
    "example": "/keywords/1/commands/1"
  },
  "keyword": {
    "description": "Relative URI to the keyword associated with this command",
    "type": "string",
    "example": "/keywords/1"
  },
  "command_actions": {
    "description": "Relative URI to the actions associated with this command",
    "type": "string",
    "example": "/keywords/1/commands/1/actions"
  }
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Command",
  "description": "List of commands associated with a keyword",
  "type": "object",
  "properties": {
    "name": {
      "description": "Name of the command for later reference.",
      "type": "string",
      "example": "OpenWeatherMap Forwarder"
    },
    "command_type": {
      "description": "Specifies what type of command this is.",
      "type": "string",
      "enum": [
        "dcm_subscribe",
        "dcm_unsubscribe",
        "forward"
      ],
      "example": "forward"
    },
    "params": {
      "description": "The parameters to be associated with this command. The list of  parameters for each command type can be found by querying the  Command Type relation.",
      "type": "string",
      "example": "{\n  \"dcm_account_code\": \"ACCOUNT_CODE\",\n  \"dcm_topic_codes\": [\"TOPIC_CODE_23\", \"TOPIC_CODE_90\"]\n}\n"
    },
    "created_at": {
      "description": "The date and time when the command was created.",
      "type": "string",
      "example": "2013-01-30T17:45:27Z"
    },
    "updated_at": {
      "description": "The date and time when the command was last updated.",
      "type": "string",
      "example": "2013-01-30T17:45:27Z"
    },
    "_links": {
      "title": "Relational Links",
      "description": "An object that defines links to related objects.",
      "type": "object",
      "properties": {
        "self": {
          "description": "Relative URI of the object",
          "type": "string",
          "example": "/keywords/1/commands/1"
        },
        "keyword": {
          "description": "Relative URI to the keyword associated with this command",
          "type": "string",
          "example": "/keywords/1"
        },
        "command_actions": {
          "description": "Relative URI to the actions associated with this command",
          "type": "string",
          "example": "/keywords/1/commands/1/actions"
        }
      }
    }
  }
}

Body

Format: application/json

Example
{
  "error": "Invalid authentication token"
}
Secured By: Authentication Token
Description:

Create a command.

Headers

Name Required Type Description
X-AUTH-TOKEN * string

An authentication token provided to you by GovDelivery.

Body

Format: application/json

Example
{
 "name": "Subscribe to news topics",
 "command_type": "dcm_subscribe",
 "params": {
 "dcm_account_code": "ACCOUNT_CODE",
 "dcm_topic_codes": ["TOPIC_CODE_23", "TOPIC_CODE_90"]
 }
}
Schema
Object that may include:
Name Required Type Description
name * string

Name of the command for later reference.

Example

OpenWeatherMap Forwarder
command_type * string

Specifies what type of command this is.

Valid Values:

  • dcm_subscribe
  • dcm_unsubscribe
  • forward

Example

forward
params string

The parameters to be associated with this command.

Possible parameters are:

  • name
    • Command Type: All
    • Required: Yes
    • Name of the command.
  • dcm_account_code
    • Command Type: dcm_subscribe
    • Required: Yes
    • The DCM account codes are provisioned by GovDelivery staff.

      This is the DCM account code that is used for subscribe and unsubscribe command types.

  • dcm_topic_codes
    • Command Type: dcm_subscribe
    • Required: Yes
    • The DCM topic codes that you want the phone number subscribed to.
  • dcm_account_codes
    • Command Type: dcm_unsubscribe
    • Required: Yes
    • The DCM account codes are provisioned by GovDelivery staff.

      This is the DCM account code that is used for subscribe and unsubscribe command types.

  • url
    • Command Type: forward
    • Required: Yes
    • The URL used in the forward command.
  • http_method
    • Command Type: forward
    • Required: Yes
    • The HTTP method to use for the forward action. Acceptabel values are:
      • GET
      • POST
  • username
    • Command Type: forward
    • Required: No
    • Username used for HTTP access is authentication is required for access to the configured URL.

      HTTP basic authentication is used.

  • password
    • Command Type: forward
    • Required: No
    • Password used for HTTP access is authentication is required for access to the configured URL.

      HTTP basic authentication is used.

Example

{
  "dcm_account_code": "ACCOUNT_CODE",
  "dcm_topic_codes": ["TOPIC_CODE_23", "TOPIC_CODE_90"]
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "/keywords/{id}/commands",
  "description": "Create a command.",
  "type": "object",
  "properties": {
    "name": {
      "description": "Name of the command for later reference.",
      "type": "string",
      "example": "OpenWeatherMap Forwarder"
    },
    "command_type": {
      "description": "Specifies what type of command this is.",
      "type": "string",
      "enum": [
        "dcm_subscribe",
        "dcm_unsubscribe",
        "forward"
      ],
      "example": "forward"
    },
    "params": {
      "description": "The parameters to be associated with this command. \n\nPossible parameters are:\n\n- name\n  - Command Type: All\n  - Required: Yes\n  - Name of the command.\n- dcm_account_code\n  - Command Type: dcm_subscribe\n  - Required: Yes\n  - The DCM account codes are provisioned by GovDelivery staff.\n    \n    This is the DCM account code that is used for subscribe and\n    unsubscribe command types. \n- dcm_topic_codes\n  - Command Type: dcm_subscribe\n  - Required: Yes\n  - The DCM topic codes that you want the phone number \n    subscribed to.\n- dcm_account_codes\n  - Command Type: dcm_unsubscribe\n  - Required: Yes\n  - The DCM account codes are provisioned by GovDelivery staff.\n\n    This is the DCM account code that is used for subscribe and \n    unsubscribe command types. \n- url\n  - Command Type: forward\n  - Required: Yes\n  - The URL used in the forward command.\n- http_method\n  - Command Type: forward\n  - Required: Yes\n  - The HTTP method to use for the forward action. Acceptabel values are:\n      - GET\n      - POST\n- username\n  - Command Type: forward\n  - Required: No\n  - Username used for HTTP access is authentication is required for \n    access to the configured URL.\n\n    HTTP basic authentication is used. \n- password\n  - Command Type: forward\n  - Required: No\n  - Password used for HTTP access is authentication is required for \n    access to the configured URL.\n\n    HTTP basic authentication is used.\n",
      "type": "string",
      "example": "{\n  \"dcm_account_code\": \"ACCOUNT_CODE\",\n  \"dcm_topic_codes\": [\"TOPIC_CODE_23\", \"TOPIC_CODE_90\"]\n}\n"
    }
  },
  "required": [
    "name",
    "command_type"
  ]
}
Form Parameters
Name Required Type Description
name * string

Name of the command for later reference.

Example

OpenWeatherMap Forwarder
command_type * string

Specifies what type of command this is.

Valid Values:

  • dcm_subscribe
  • dcm_unsubscribe
  • forward

Example

forward
params string

The parameters to be associated with this command.

Possible parameters are:

  • name
    • Command Type: All
    • Required: Yes
    • Name of the command.
  • dcm_account_code
    • Command Type: dcm_subscribe
    • Required: Yes
    • The DCM account codes are provisioned by GovDelivery staff.

      This is the DCM account code that is used for subscribe and unsubscribe command types.

  • dcm_topic_codes
    • Command Type: dcm_subscribe
    • Required: Yes
    • The DCM topic codes that you want the phone number subscribed to.
  • dcm_account_codes
    • Command Type: dcm_unsubscribe
    • Required: Yes
    • The DCM account codes are provisioned by GovDelivery staff.

      This is the DCM account code that is used for subscribe and unsubscribe command types.

  • url
    • Command Type: forward
    • Required: Yes
    • The URL used in the forward command.
  • http_method
    • Command Type: forward
    • Required: Yes
    • The HTTP method to use for the forward action. Acceptabel values are:
      • GET
      • POST
  • username
    • Command Type: forward
    • Required: No
    • Username used for HTTP access is authentication is required for access to the configured URL.

      HTTP basic authentication is used.

  • password
    • Command Type: forward
    • Required: No
    • Password used for HTTP access is authentication is required for access to the configured URL.

      HTTP basic authentication is used.

Example

{
  "dcm_account_code": "ACCOUNT_CODE",
  "dcm_topic_codes": ["TOPIC_CODE_23", "TOPIC_CODE_90"]
}

Status

Body

Format: application/json

Example
{
  "command_type": "dcm_subscribe",
  "name": "Subscribe to news topics",
  "updated_at": "2013-01-14T19:54:11Z",
  "params": {
    "dcm_account_code": "ACCOUNT_CODE",
    "dcm_topic_codes": ["TOPIC_CODE_23", "TOPIC_CODE_90"]
  },
  "_links": {
    "self": "/keywords/1/commands/1",
    "keyword": "/keywords/1":
  },
  "created_at": "2013-01-14T19:54:11Z"
}
Schema
Object that may include:
Name Type Description
name string

Name of the command for later reference.

Example

OpenWeatherMap Forwarder
command_type string

Specifies what type of command this is.

Valid Values:

  • dcm_subscribe
  • dcm_unsubscribe
  • forward

Example

forward
params string

The parameters to be associated with this command. The list of parameters for each command type can be found by querying the Command Type relation.

Example

{
  "dcm_account_code": "ACCOUNT_CODE",
  "dcm_topic_codes": ["TOPIC_CODE_23", "TOPIC_CODE_90"]
}
created_at string

The date and time when the command was created.

Example

2013-01-30T17:45:27Z
updated_at string

The date and time when the command was last updated.

Example

2013-01-30T17:45:27Z
_links object

An object that defines links to related objects.

Properties

{
  "self": {
    "description": "Relative URI of the object",
    "type": "string",
    "example": "/keywords/1/commands/1"
  },
  "keyword": {
    "description": "Relative URI to the keyword associated with this command",
    "type": "string",
    "example": "/keywords/1"
  },
  "command_actions": {
    "description": "Relative URI to the actions associated with this command",
    "type": "string",
    "example": "/keywords/1/commands/1/actions"
  }
}
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Command",
  "type": "object",
  "properties": {
    "name": {
      "description": "Name of the command for later reference.",
      "type": "string",
      "example": "OpenWeatherMap Forwarder"
    },
    "command_type": {
      "description": "Specifies what type of command this is.",
      "type": "string",
      "enum": [
        "dcm_subscribe",
        "dcm_unsubscribe",
        "forward"
      ],
      "example": "forward"
    },
    "params": {
      "description": "The parameters to be associated with this command. The list of  parameters for each command type can be found by querying the  Command Type relation.",
      "type": "string",
      "example": "{\n  \"dcm_account_code\": \"ACCOUNT_CODE\",\n  \"dcm_topic_codes\": [\"TOPIC_CODE_23\", \"TOPIC_CODE_90\"]\n}\n"
    },
    "created_at": {
      "description": "The date and time when the command was created.",
      "type": "string",
      "example": "2013-01-30T17:45:27Z"
    },
    "updated_at": {
      "description": "The date and time when the command was last updated.",
      "type": "string",
      "example": "2013-01-30T17:45:27Z"
    },
    "_links": {
      "title": "Relational Links",
      "description": "An object that defines links to related objects.",
      "type": "object",
      "properties": {
        "self": {
          "description": "Relative URI of the object",
          "type": "string",
          "example": "/keywords/1/commands/1"
        },
        "keyword": {
          "description": "Relative URI to the keyword associated with this command",
          "type": "string",
          "example": "/keywords/1"
        },
        "command_actions": {
          "description": "Relative URI to the actions associated with this command",
          "type": "string",
          "example": "/keywords/1/commands/1/actions"
        }
      }
    }
  }
}

Body

Format: application/json

Example
{
  "error": "Invalid authentication token"
}