# Send SMS — D7 SMS

> Sending sms via D7 networks! See the docs

- Key: `d7_networks-send-sms`
- Type: Action (Write)
- Version: 0.0.2
- App: D7 SMS (`d7_networks`) — https://pipedream.com/apps/d7-networks.md
- This page (HTML): https://pipedream.com/apps/d7-networks/actions/send-sms
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/d7_networks/actions/send-sms/send-sms.mjs

## Description

Sending sms via D7 networks! [See the docs](https://d7networks.com/docs/Messages/Send_Message/)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `originator` | `string` | Yes | The Sender/Header of a message. Brand name with a maximum character limit of 11 or your mobile number with country code. E.g. Pipedream |
| `recipients` | `string[]` | Yes | Mobile Numbers to send SMS. |
| `content` | `string` | Yes | Content of the message. |
| `channel` | `string` | No | Messaging Channel (SMS, WhatsApp, Viber, Telegram, etc) |
| `reportUrl` | `string` | No | Your call back server URL to recieve delivery status |
| `dataCoding` | `string` | No | Set as text for normal GSM 03.38 characters (English, normal characters). Set as unicode for non GSM 03.38 characters (Arabic, Chinese, Hebrew, Greek like regional languages and Unicode characters). Set as auto so we will find the data_coding based on your content. |
| `msgType` | `string` | No | Set as text for normal GSM 03.38 characters (English, normal characters). Set as unicode for non GSM 03.38 characters (Arabic, Chinese, Hebrew, Greek like regional languages and Unicode characters). Set as auto so we will find the data_coding based on your content. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "d7_networks",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "d7_networks-send-sms",
  arguments: {
    originator: "Originator",
    recipients: ["Recipients"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "d7_networks-send-sms",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    d7_networks: { authProvisionId: "apn_xxxxxxx" },
    originator: "Originator",
    recipients: ["Recipients"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "d7_networks-send-sms",
    "configured_props": {
      "d7_networks": { "authProvisionId": "apn_xxxxxxx" },
      "originator": "Originator",
      "recipients": ["Recipients"]
    }
  }'
```

---

- App: https://pipedream.com/apps/d7-networks.md · All apps: https://pipedream.com/apps
