POST /chan_name/v1/subscribe/dur_name

The web method POST chan_name/v1/subscribe/dur_name creates a durable subscription on a specific channel. The request body specifies the content matcher in JSON format.

  • chan_name in the URI is the channel name.
  • dur_name in the URI is the durable name for the subscription.

The channel definition must configure FTL or EMS persistence.

HTTP Parameters

Syntax Description
type=durable_type Optional.

This parameter selects for one of an FTL channel's dynamic durable templates.

You can specify a durable type, either shared or last-value.

When absent, the channel creates the new durable using its default durable template.
key=key_field_name Required when the type is last-value.

Specify the key field of a last value durable. The key field must be present in the subscription's content matcher.

Example Requests

curl POST http://host:port/chan_name/v1/subscribe/dur_name -d '{"color":"blue"}'
curl POST http://host:port/chan_name/v1/subscribe/dur_name?type=shared -d '{"db":"db4"}'
curl POST http://host:port/chan_name/v1/subscribe/dur_name?type=last-value&key=symbol -d '{"symbol":"amzn"}'

Example Response

{
  "error":{
    "code":0,
    "reason":""
  }
}