Skip to content

Channel preferences

Use this reference with the complete developer tour and Go types. The example at the end runs after the tour setup.

Read a Person’s versioned delivery defaults and Agent/Agent-role overrides.

func (c *Client) DeliveryPreferences(ctx context.Context, person string) (DeliveryPreferences, error)
Parameter Type and default Usage
ctx context.Context (required) Required Go context. Cancellation bounds this local call; it does not withdraw a durable request.
person string (required) Person identity projection; present only for a person caller.

Returns: DeliveryPreferences with person_id, version, default and ordered overrides.

Permissions, lifecycle and errors: Person self, administrator or authorized identity manager only. Reload after a stale-version conflict; preferences grant no contact authority.

Working Go example. Input/output fields are in the types reference.

Save a Person’s channel policy using its observed version.

func (c *Client) SaveDeliveryPreferences(ctx context.Context, person string, in DeliveryPreferences) (DeliveryPreferences, error)
Parameter Type and default Usage
ctx context.Context (required) Required Go context. Cancellation bounds this local call; it does not withdraw a durable request.
person string (required) Person identity projection; present only for a person caller.
in DeliveryPreferences (required) Typed operation input. Every field is listed in the language types reference.

Returns: DeliveryPreferences with the incremented version; pending external sends from the previous configuration stop.

Permissions, lifecycle and errors: Person self, administrator or authorized identity manager only. Reload after a stale-version conflict; preferences grant no contact authority.

Working Go example. Input/output fields are in the types reference.

Run this region after the shared setup. Assertions check the returned data; the full tour is a runnable program.

preferences := must(owner.DeliveryPreferences(ctx, me.Person.ID))
savedPreferences := must(owner.SaveDeliveryPreferences(ctx, me.Person.ID, beepgrid.DeliveryPreferences{Version: preferences.Version,
Default: &beepgrid.ChannelPolicy{Mode: "preferred", Destinations: []string{}, FollowupSeconds: 0}, Overrides: []beepgrid.ChannelOverride{}}))
check(savedPreferences.Version > preferences.Version)

Read this page as Markdown