# Twilio Conversations (classic)

## Twilio Conversations (classic)

Twilio Conversations (classic) is an omni-channel messaging platform that allows you to build engaging conversational messaging experiences across many channels. Find the documentation, sample code, and developer tools you need to build exactly what you want.

[Get started now](/docs/conversations-classic/overview)

## Tutorial

```js !sample
import {Client} from "@twilio/conversations";

const client = new Client(accessToken);
const conversation = await client.createConversation();
await conversation.add('cedric');
conversation.sendMessage('Hello World!');
```

1. Twilio handles authentication, scoping, and eventing
2. The SDK provides a collection of objects, methods, and events that helps you connect your client-side application to Conversations (classic)
3. Twilio receives actions from your SDK and notifies others

Tutorial code output: "Create an engaging conversation!"

## Launch a Demo App

Deploy your first Twilio Conversations (classic) application in minutes. Try the full-featured demo applications below and enjoy the wide variety of Twilio Conversations (classic) functionalities.

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createConversation() {
  const conversation = await client.conversations.v1.conversations.create({
    friendlyName: "Friendly Conversation",
  });

  console.log(conversation.sid);
}

createConversation();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

conversation = client.conversations.v1.conversations.create(
    friendly_name="Friendly Conversation"
)

print(conversation.sid)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Conversations.V1;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var conversation =
            await ConversationResource.CreateAsync(friendlyName: "Friendly Conversation");

        Console.WriteLine(conversation.Sid);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.conversations.v1.Conversation;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Conversation conversation = Conversation.creator().setFriendlyName("Friendly Conversation").create();

        System.out.println(conversation.getSid());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	conversations "github.com/twilio/twilio-go/rest/conversations/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &conversations.CreateConversationParams{}
	params.SetFriendlyName("Friendly Conversation")

	resp, err := client.ConversationsV1.CreateConversation(params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.Sid != nil {
			fmt.Println(*resp.Sid)
		} else {
			fmt.Println(resp.Sid)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$conversation = $twilio->conversations->v1->conversations->create([
    "friendlyName" => "Friendly Conversation",
]);

print $conversation->sid;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

conversation = @client
               .conversations
               .v1
               .conversations
               .create(friendly_name: 'Friendly Conversation')

puts conversation.sid
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:conversations:v1:conversations:create \
   --friendly-name "Friendly Conversation"
```

```bash
curl -X POST "https://conversations.twilio.com/v1/Conversations" \
--data-urlencode "FriendlyName=Friendly Conversation" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

### Ahoy, World

* [React Demo App](https://github.com/twilio/twilio-conversations-demo-react)
* [Android Demo App](https://github.com/twilio/twilio-conversations-demo-android-kotlin)
* [iOS Demo App](https://github.com/twilio/twilio-conversations-demo-ios-swift)

## Learn More

You've got an idea in mind. Let's get it to production.

Select the docs that are right for you. These guides, sample app tutorials, and API reference docs will get you across the deploy line, straight to HTTP 200 ok.

### Core Concepts

* [Overview](/docs/conversations-classic/overview)
* [Conversations (classic) Fundamentals](/docs/conversations-classic/fundamentals)
* [Conversations (classic) Webhooks](/docs/conversations-classic/conversations-webhooks)
* [Inbound Message Handling and Autocreation](/docs/conversations-classic/inbound-autocreation)

### API Reference

* [Conversation](/docs/conversations-classic/api/conversation-resource)
* [Message](/docs/conversations-classic/api/conversation-message-resource)
* [Media](/docs/conversations-classic/api/media-resource)
* [Participant](/docs/conversations-classic/api/conversation-participant-resource)

### Conversations (classic) SDK Guides

* [Conversations (classic) SDK Overview](/docs/conversations-classic/sdk-overview)
* [Event Handling](/docs/conversations-classic/event-handling)
* [Working with Conversations (classic)](/docs/conversations-classic/working-with-conversations)
* [Sending Messages and Media](/docs/conversations-classic/sending-messages-and-media)

## Explore More Features

Grow your app and explore the set of tools Twilio Conversations (classic) provides.

Learn the best practices for using the SDK. Dive into our tutorials and learn how to migrate from Programmable Chat to Conversations (classic) with our migration guides.

### More SDK resources

* [Typing Indicator](/docs/conversations-classic/typing-indicator)
* [Read Horizon and Read Status Overview](/docs/conversations-classic/read-horizon-overview)
* [Best Practices using the Conversations (classic) SDK](/docs/conversations-classic/best-practices-sdk-clients)
* [Troubleshooting your Conversations (classic) Application](/docs/conversations-classic/error-handling-diagnostics)

### Tutorials

* [Connecting Twilio Studio to Conversations (classic)](/docs/conversations-classic/connect-to-studio)
* [Using Facebook Messenger with Conversations (classic)](/docs/conversations-classic/facebook-messenger)
* [Trying Out WhatsApp with Conversations (classic)](/docs/conversations-classic/use-twilio-sandbox-for-whatsapp)
* [Using Google Dialogflow with Conversations (classic)](/docs/conversations-classic/connect-to-dialogflow)

### Migration Guides

* [Migrating from Programmable Chat](/docs/conversations-classic/migrating-chat-conversations)
* [Migrating your Chat Android SDK to Conversations (classic)](/docs/conversations-classic/android/migrate-your-chat-android-sdk-conversations)
* [Migrating your Chat iOS SDK to Conversations (classic)](/docs/conversations-classic/ios/migrate-your-chat-ios-sdk-conversations)

## Related Products

Twilio offers other tools to enhance your Conversations (classic) applications. Use a visual low-code/no-code tool to create your own chatbot,\
synchronize your application's state across devices and send messages programmatically.

### Twilio Studio

Don't want to code? Create your Conversations (classic) app with our visual builder.

[Product Docs](/docs/studio)

### Sync

Synchronize state across web and mobile applications.

[Product Docs](/docs/sync)

### SMS

Add robust messaging capabilities to your applications.

[Product Docs](/docs/sms)
