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

# MCR IP / BGP / BGP Neighbor Routes in Asynchronous Mode

GET https://api.megaport.com/v2/product/mcr2/{productUid}/diagnostics/routes/operation

Returns the MCR IP / BGP / BGP Neighbor routes in Asynchronous mode.

This endpoint is used in conjunction with the following endpoints:

- GET List IP Routes
- GET List BGP Routes
- GET List BGP Neighbor Routes
    

First, run one of these route listing endpoints with the `async` parameter set to `True`. The response should be returned in a matter of milliseconds with no actual results, and a status of _Pending_.

Then run this endpoint using the MCR `productUid` and the `operationId` returned in the response to retrieve the routes.

Several example responses are included. The first example shows a successful response, while the remaining examples show where an error has occurred. The **Service Type Not Supported** example can be caused by any of these issues:

- OperationId is not provided
- Both getIpRoutes and getBgpRoutes are empty (at least one must be provided)
- Not supported service type
- Network API error

Reference: https://en.megaport.ferndocs.com/api-reference/mcr-looking-glass/mcr-ip-bgp-bgp-neighbor-routes-in-asynchronous-mode

## Servers

- `https://api.megaport.com` (Production environment, default)
- `https://api-staging.megaport.com` (Staging environment (test only, reset every 24 hours))

## Request

### Path parameters

- `productUid` (string, required)

### Query parameters

- `operationId` (string, optional) — UUID returned from the previous List Routes call to get MCR IP/BGP/BGP Neighbor routes in Asynchronous mode

## Response

### 200

Get MCR IP / BGP / BGP Neighbor Routes in Async Mode - Success / Get MCR IP / BGP / BGP Neighbor Routes in Async Mode - Success

- `data` (list of V2ProductMcr2ProductUidDiagnosticsRoutesOperationGetResponsesContentApplicationJsonSchemaDataItems, optional)
- `message` (string, optional)
- `terms` (string, optional)

### 202

Data Result Not Ready Yet / Data Result Not Ready Yet

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

## Errors

### 400 Bad Request Error

Service Type Not Supported / Service Type Not Supported

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

### 401 Unauthorized Error

Bad Session Token / Bad Session Token

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

### 403 Forbidden Error

Incorrect Permission for the Operation / Incorrect Permission for the Operation

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

### 404 Not Found Error

Network Service Not Found / Network Service Not Found

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

## Types

### V2ProductMcr2ProductUidDiagnosticsRoutesOperationGetResponsesContentApplicationJsonSchemaDataItems

- `distance` (double, optional)
- `metric` (double, optional)
- `nextHop` (V2ProductMcr2ProductUidDiagnosticsRoutesOperationGetResponsesContentApplicationJsonSchemaDataItemsNextHop, optional)
- `prefix` (string, optional)
- `protocol` (string, optional)

### V2ProductMcr2ProductUidDiagnosticsRoutesOperationGetResponsesContentApplicationJsonSchemaDataItemsNextHop

- `ip` (string, optional)
- `vxc` (V2ProductMcr2ProductUidDiagnosticsRoutesOperationGetResponsesContentApplicationJsonSchemaDataItemsNextHopVxc, optional)

### V2ProductMcr2ProductUidDiagnosticsRoutesOperationGetResponsesContentApplicationJsonSchemaDataItemsNextHopVxc

- `id` (string, optional)
- `name` (string, optional)

## Examples

### Example 1

**Response**

```json
{
  "data": [
    {
      "distance": 20,
      "metric": 0,
      "nextHop": {
        "ip": "169.254.0.1",
        "vxc": {
          "id": "5d4bba15-db2a-4adc-935d-525558692601",
          "name": "AFBS-to-MCR"
        }
      },
      "prefix": "10.0.1.0/24",
      "protocol": "BGP"
    },
    {
      "distance": 20,
      "metric": 0,
      "nextHop": {
        "ip": "169.254.0.1",
        "vxc": {
          "id": "5d4bba15-db2a-4adc-935d-525558692601",
          "name": "AFBS-to-MCR"
        }
      },
      "prefix": "10.0.2.0/24",
      "protocol": "BGP"
    },
    {
      "distance": 20,
      "metric": 0,
      "nextHop": {
        "ip": "169.254.0.1",
        "vxc": {
          "id": "5d4bba15-db2a-4adc-935d-525558692601",
          "name": "AFBS-to-MCR"
        }
      },
      "prefix": "10.0.3.0/24",
      "protocol": "BGP"
    },
    {
      "distance": 20,
      "metric": 0,
      "nextHop": {
        "ip": "169.254.0.1",
        "vxc": {
          "id": "5d4bba15-db2a-4adc-935d-525558692601",
          "name": "AFBS-to-MCR"
        }
      },
      "prefix": "10.0.4.0/24",
      "protocol": "BGP"
    },
    {
      "distance": 20,
      "metric": 0,
      "nextHop": {
        "ip": "169.254.0.1",
        "vxc": {
          "id": "5d4bba15-db2a-4adc-935d-525558692601",
          "name": "AFBS-to-MCR"
        }
      },
      "prefix": "10.0.5.0/24",
      "protocol": "BGP"
    },
    {
      "distance": 20,
      "metric": 0,
      "nextHop": {
        "ip": "169.254.0.1",
        "vxc": {
          "id": "5d4bba15-db2a-4adc-935d-525558692601",
          "name": "AFBS-to-MCR"
        }
      },
      "prefix": "10.0.6.0/24",
      "protocol": "BGP"
    },
    {
      "distance": 20,
      "metric": 0,
      "nextHop": {
        "ip": "169.254.0.1",
        "vxc": {
          "id": "5d4bba15-db2a-4adc-935d-525558692601",
          "name": "AFBS-to-MCR"
        }
      },
      "prefix": "10.0.7.0/24",
      "protocol": "BGP"
    },
    {
      "distance": 20,
      "metric": 0,
      "nextHop": {
        "ip": "169.254.0.1",
        "vxc": {
          "id": "5d4bba15-db2a-4adc-935d-525558692601",
          "name": "AFBS-to-MCR"
        }
      },
      "prefix": "10.0.8.0/24",
      "protocol": "BGP"
    },
    {
      "distance": 20,
      "metric": 0,
      "nextHop": {
        "ip": "169.254.0.1",
        "vxc": {
          "id": "5d4bba15-db2a-4adc-935d-525558692601",
          "name": "AFBS-to-MCR"
        }
      },
      "prefix": "10.0.9.0/24",
      "protocol": "BGP"
    }
  ],
  "message": "MCR routes are retrieved successfully",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python
import requests

url = "https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation';
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
package main

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

func main() {

	url := "https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation"

	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
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation")

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
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/diagnostics/routes/operation")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

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

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation")! 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()
```

### Example 2

**Response**

```json
{
  "message": "Data result will be available soon",
  "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy"
}
```

**SDK Code**

```python
import requests

url = "https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation';
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
package main

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

func main() {

	url := "https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation"

	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
require 'uri'
require 'net/http'

url = URI("https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation")

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
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/diagnostics/routes/operation")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

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

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.megaport.com/v2/product/mcr2/productUid/diagnostics/routes/operation")! 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()
```