# `Twilio.Wireless.V1.CommandService`
[🔗](https://github.com/jeffhuen/twilio_elixir/blob/main/lib/twilio/wireless/v1/command_service.ex#L2)

Machine-to-machine commands sent to/from devices

Operations: `list`, `create`, `fetch`, `delete`

# `create`

```elixir
@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

| Parameter | Type | Description |
|-----------|------|-------------|
# 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

| Parameter | Type | Description |
|-----------|------|-------------|
# 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
| `CallbackUrl` | string (uri) | The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. |
| `CommandMode` | string |  Values: `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](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to send the Command to. |

# `delete`

```elixir
@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`

```elixir
@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`

```elixir
@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

| Parameter | Type | Description |
|-----------|------|-------------|
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Sim` | string | The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/iot/wireless/api/sim-resource) to read. |
# credo:disable-for-next-line Credo.Check.Readability.MaxLineLength
| `Status` | string | The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. |
| `Direction` | string | Only return Commands with this direction value. |
| `Transport` | string | Only return Commands with this transport value. Can be: `sms` or `ip`. |

# `stream`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
