Twilio.Notify.V1.Service.NotificationService (twilio_elixir v0.1.1)

Copy Markdown View Source

Service for Notification API operations.

Operations: create

Summary

Functions

Operation: CreateNotification | Tags: NotifyV1Notification

Functions

create(client, service_sid, params \\ %{}, opts \\ [])

@spec create(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Notify.V1.Service.Notification.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Operation: CreateNotification | Tags: NotifyV1Notification

Optional Parameters

ParameterTypeDescription

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

ActionstringThe actions to display for the notification. For APNS, translates to the aps.category value. For GCM, translates to the data.twi_action value. For SMS, this parameter is not supported and is omitted from deliveries to those channels.
AlexastringDeprecated.

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Apn | string | The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS Payload item, therefore the aps key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the APNS documentation for more details. We reserve keys that start with twi_ for future use. Custom keys that start with twi_ are not allowed. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Body | string | The notification text. For FCM and GCM, translates to data.twi_body. For APNS, translates to aps.alert.body. For SMS, translates to body. SMS requires either this body value, or media_urls attribute defined in the sms parameter of the notification. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

DatastringThe custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to data in the FCM and GCM payloads. FCM and GCM reserve certain keys that cannot be used in those channels. For APNS, attributes of data are inserted into the APNS payload as custom properties outside of the aps dictionary. In all channels, we reserve keys that start with twi_ for future use. Custom keys that start with twi_ are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels.
DeliveryCallbackUrlstringURL to send webhooks.
FacebookMessengerstringDeprecated.

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Fcm | string | The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the FCM documentation for more details. Target parameters to, registration_ids, condition, and notification_key are not allowed in this parameter. We reserve keys that start with twi_ for future use. Custom keys that start with twi_ are not allowed. FCM also reserves certain keys, which cannot be used in that channel. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Gcm | string | The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the GCM documentation for more details. Target parameters to, registration_ids, and notification_key are not allowed. We reserve keys that start with twi_ for future use. Custom keys that start with twi_ are not allowed. GCM also reserves certain keys. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

IdentityarrayThe identity value that uniquely identifies the new resource's User within the Service. Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list.
PrioritystringValues: high, low
SegmentarrayThe Segment resource is deprecated. Use the tag parameter, instead.

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Sms | string | The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding form parameter of the Twilio Message resource. These parameters of the Message resource are supported in snake case format: body, media_urls, status_callback, and max_price. The status_callback parameter overrides the corresponding parameter in the messaging service, if configured. The media_urls property expects a JSON array. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Sound | string | The name of the sound to be played for the notification. For FCM and GCM, this Translates to data.twi_sound. For APNS, this translates to aps.sound. SMS does not support this property. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Tag | array | A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag all is available to notify all Bindings in a Service instance. Similarly, the implicit tags apn, fcm, gcm, sms and facebook-messenger are available to notify all Bindings in a specific channel. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Title | string | The notification title. For FCM and GCM, this translates to the data.twi_title value. For APNS, this translates to the aps.alert.title value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| ToBinding | array | The destination address specified as a JSON string. Multiple to_binding parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. |

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

| Ttl | integer | How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. |