> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://es.megaport.ferndocs.com/es/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://es.megaport.ferndocs.com/es/_mcp/server.

# Obtener lista de prefijos MCR

GET https://api.megaport.com/v2/product/mcr2/{productUid}/prefixList/{prefixListId}

Devuelve los detalles de la lista de filtros de prefijos para el MCR y la lista de prefijos especificados por el `productUid` y `prefixListId`.

Utilice el punto de enlace `/v2/product/mcr2/{productUid}/prefixLists` para obtener el `prefixListId`.

Esto le permite validar que se ha configurado una lista de filtros de prefijos específica para un MCR.

Para obtener más información sobre las listas de filtros de prefijos, consulte [Crear un VXC de MCR con la API](https://docs.megaport.com/api/api-mcr-vxc-csp/) y [Filtrado de rutas de MCR](https://docs.megaport.com/mcr/route-filtering/).

Reference: https://es.megaport.ferndocs.com/es/api-reference/megaport-cloud-router-mcr/get-mcr-prefix-list

## Servers

- `https://api.megaport.com` (Entorno de producción, default)
- `https://api-staging.megaport.com` (Entorno de pruebas (solo pruebas, se restablece cada 24 horas))

## Request

### Path parameters

- `productUid` (string, required)
- `prefixListId` (string, required)

## Response

### 200

Obtener Lista de Prefijos MCR - Lista Sin Entradas / Obtener Lista de Prefijos MCR - Lista Con Entradas / Obtener Lista de Prefijos MCR - Lista Sin Entradas / Obtener Lista de Prefijos MCR - Lista Con Entradas

- `data` (V2ProductMcr2ProductUidPrefixListPrefixListIdGetResponsesContentApplicationJsonSchemaData, optional)
- `message` (string, optional)
- `terms` (string, optional)

## Types

### V2ProductMcr2ProductUidPrefixListPrefixListIdGetResponsesContentApplicationJsonSchemaData

- `addressFamily` (string, optional)
- `description` (string, optional)
- `entries` (list of any, optional)
- `id` (double, optional)

## Examples

### Get MCR Prefix List - List With Entries

**Response**

```json
{
  "data": {
    "addressFamily": "IPv4",
    "description": "Lista de filtros de GB",
    "entries": [
      {
        "action": "permit",
        "prefix": "192.0.0.0/24"
      },
      {
        "action": "permit",
        "prefix": "192.0.2.0/24"
      },
      {
        "action": "permit",
        "prefix": "192.168.0.0/16"
      },
      {
        "action": "permit",
        "prefix": "198.51.100.0/24"
      }
    ],
    "id": 4011
  },
  "message": "Lista de prefijos para MCR",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Get MCR Prefix List - List With Entries
import requests

url = "https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId"

response = requests.get(url)

print(response.json())
```

```javascript Get MCR Prefix List - List With Entries
const url = 'https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Get MCR Prefix List - List With Entries
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Get MCR Prefix List - List With Entries
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java Get MCR Prefix List - List With Entries
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId")
  .asString();
```

```php Get MCR Prefix List - List With Entries
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId');

echo $response->getBody();
```

```csharp Get MCR Prefix List - List With Entries
using RestSharp;

var client = new RestClient("https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Get MCR Prefix List - List With Entries
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Get MCR Prefix List - List Without Entries

**Response**

```json
{
  "data": {
    "addressFamily": "IPv4",
    "description": "Lista de pruebas - DH",
    "entries": [],
    "id": 4002
  },
  "message": "Lista de prefijos para MCR",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python Get MCR Prefix List - List Without Entries
import requests

url = "https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId"

response = requests.get(url)

print(response.json())
```

```javascript Get MCR Prefix List - List Without Entries
const url = 'https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Get MCR Prefix List - List Without Entries
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Get MCR Prefix List - List Without Entries
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java Get MCR Prefix List - List Without Entries
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId")
  .asString();
```

```php Get MCR Prefix List - List Without Entries
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId');

echo $response->getBody();
```

```csharp Get MCR Prefix List - List Without Entries
using RestSharp;

var client = new RestClient("https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift Get MCR Prefix List - List Without Entries
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v2/product/mcr2/productUid/prefixList/prefixListId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```