# Conversational Intelligence - OperatorAttachments Subresource

The OperatorAttachments subresource represents the attached Pre-built or Custom Operators to a specific Intelligence Service.

## Operator Properties

```json
{"type":"object","refName":"intelligence.v2.operator_attachments","modelName":"intelligence_v2_operator_attachments","properties":{"service_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^GA[0-9a-fA-F]{32}$","nullable":true,"description":"The unique SID identifier of the Service."},"operator_sids":{"type":"array","nullable":true,"description":"List of Operator SIDs attached to the service. Includes both Custom and Pre-built Operators.","items":{"type":"string","minLength":34,"maxLength":34,"pattern":"^LY[0-9a-fA-F]{32}$"}},"url":{"type":"string","format":"uri","nullable":true,"description":"The URL of this resource."}}}
```

## List all Operator Attachments

`GET https://intelligence.twilio.com/v2/Services/{ServiceSid}/Operators`

This endpoint retrieves all Pre-Built and Custom Operators that are attached to a Service.

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The unique SID identifier of the Service.","schema":{"type":"string","minLength":34,"maxLength":34,"pattern":"^LY[0-9a-fA-F]{32}$"},"required":true}]
```

List multiple Operators

```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 fetchOperatorAttachments() {
  const operatorAttachment = await client.intelligence.v2
    .operatorAttachments("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    .fetch();

  console.log(operatorAttachment.serviceSid);
}

fetchOperatorAttachments();
```

```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)

operator_attachment = client.intelligence.v2.operator_attachments(
    "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
).fetch()

print(operator_attachment.service_sid)
```

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

using System;
using Twilio;
using Twilio.Rest.Intelligence.V2;
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 operatorAttachments = await OperatorAttachmentsResource.FetchAsync(
            pathServiceSid: "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

        Console.WriteLine(operatorAttachments.ServiceSid);
    }
}
```

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

import com.twilio.Twilio;
import com.twilio.rest.intelligence.v2.OperatorAttachments;

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);
        OperatorAttachments operatorAttachments =
            OperatorAttachments.fetcher("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa").fetch();

        System.out.println(operatorAttachments.getServiceSid());
    }
}
```

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

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"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()

	resp, err := client.IntelligenceV2.FetchOperatorAttachments("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		if resp.ServiceSid != nil {
			fmt.Println(*resp.ServiceSid)
		} else {
			fmt.Println(resp.ServiceSid)
		}
	}
}
```

```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);

$operator_attachment = $twilio->intelligence->v2
    ->operatorAttachments("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
    ->fetch();

print $operator_attachment->serviceSid;
```

```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)

operator_attachment = @client
                      .intelligence
                      .v2
                      .operator_attachments('LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
                      .fetch

puts operator_attachment.service_sid
```

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

twilio api:intelligence:v2:services:operators:fetch \
   --service-sid LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
```

```bash
curl -X GET "https://intelligence.twilio.com/v2/Services/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Operators" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "service_sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "operator_sids": [
    "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"
  ],
  "url": "https://intelligence.twilio.com/v2/Services/GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Operators"
}
```
