Twilio.Wireless.V1.CommandService (twilio_elixir v0.1.1)

Copy Markdown View Source

Machine-to-machine commands sent to/from devices

Operations: list, create, fetch, delete

Summary

Functions

Delete a Command instance from your account.

Fetch a Command instance from your account.

Retrieve a list of Commands from your account.

Stream: Retrieve a list of Commands from your account. (lazy auto-pagination).

Functions

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

@spec create(Twilio.Client.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Wireless.V1.Command.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Send a Command to a Sim.

Operation: CreateCommand | Tags: WirelessV1Command

Required Parameters

ParameterTypeDescription

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

| Command | string | The message body of the Command. Can be plain text in text mode or a Base64 encoded byte string in binary mode. |

Optional Parameters

ParameterTypeDescription

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

| CallbackMethod | string (http-method) | The HTTP method we use to call callback_url. Can be: POST or GET, and the default is POST. Values: GET, POST |

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

CallbackUrlstring (uri)The URL we call using the callback_url when the Command has finished sending, whether the command was delivered or it failed.
CommandModestringValues: text, binary

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

| DeliveryReceiptRequested | boolean | Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is true. |

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

| IncludeSid | string | Whether to include the SID of the command in the message body. Can be: none, start, or end, and the default behavior is none. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of start will prepend the message with the Command SID, and end will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. |

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

| Sim | string | The sid or unique_name of the SIM to send the Command to. |

delete(client, sid, opts \\ [])

@spec delete(Twilio.Client.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}

Delete a Command instance from your account.

Operation: DeleteCommand | Tags: WirelessV1Command

fetch(client, sid, opts \\ [])

@spec fetch(Twilio.Client.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Wireless.V1.Command.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Fetch a Command instance from your account.

Operation: FetchCommand | Tags: WirelessV1Command

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

@spec list(Twilio.Client.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Retrieve a list of Commands from your account.

Operation: ListCommand | Tags: WirelessV1Command

Query Parameters

ParameterTypeDescription

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

| Sim | string | The sid or unique_name of the Sim resources to read. |

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

StatusstringThe status of the resources to read. Can be: queued, sent, delivered, received, or failed.
DirectionstringOnly return Commands with this direction value.
TransportstringOnly return Commands with this transport value. Can be: sms or ip.

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

@spec stream(Twilio.Client.t(), map(), keyword()) :: Enumerable.t()

Stream: Retrieve a list of Commands from your account. (lazy auto-pagination).