/keywords/{id}/commands
Use this resource to view or create new commands, which are always associated with a keyword.
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. |
Headers
Name | Type | Description |
---|---|---|
Link | string |
Appropriate pagination link relations. Can include “first”, “last”, “prev”, and “next” relations. Example
|
Body
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
Name | Type | Description |
---|---|---|
name | string |
Name of the command for later reference. Example
|
command_type | string |
Specifies what type of command this is. Valid Values:
Example
|
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
|
created_at | string |
The date and time when the command was created. Example
|
updated_at | string |
The date and time when the command was last updated. Example
|
_links | object |
An object that defines links to related objects. Properties
|
{
"$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
Example
{
"error": "Invalid authentication token"
}
Create a command.
Headers
Name | Required | Type | Description |
---|---|---|---|
X-AUTH-TOKEN | * | string |
An authentication token provided to you by GovDelivery. |
Body
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
Name | Required | Type | Description |
---|---|---|---|
name | * | string |
Name of the command for later reference. Example
|
command_type | * | string |
Specifies what type of command this is. Valid Values:
Example
|
params | string |
The parameters to be associated with this command. Possible parameters are:
Example
|
{
"$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
|
command_type | * | string |
Specifies what type of command this is. Valid Values:
Example
|
params | string |
The parameters to be associated with this command. Possible parameters are:
Example
|
Body
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
Name | Type | Description |
---|---|---|
name | string |
Name of the command for later reference. Example
|
command_type | string |
Specifies what type of command this is. Valid Values:
Example
|
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
|
created_at | string |
The date and time when the command was created. Example
|
updated_at | string |
The date and time when the command was last updated. Example
|
_links | object |
An object that defines links to related objects. Properties
|
{
"$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
Example
{
"error": "Invalid authentication token"
}