惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

Megaport Blog

Early Warning Signs Your Network Needs a Refresh Introducing Megaport DDoS Protection A Guide to 400G Connectivity A Guide to NAT Gateway A Guide to Cloud Storage How the Data Center Is Evolving in 2026 What to Expect When Attending Your First Network Operator Group (NOG) Nine Ways to Connect to Cloud Using Private Connectivity Migrate Your On-premises to the Cloud: A Step-by-Step Guide How to Lower Your Egress Fees in 2026 How to Achieve Data Sovereignty in Europe Redefining the Edge with Cisco and Megaport How to Reduce Latency in Your Multicloud Environment Introducing Megaport High-Speed Cross-Cloud Encryption Are Businesses Leaving the Cloud? Using Meraki and Megaport Virtual Edge for Multicloud Networking Equinix Metal® is Going Away: Here’s What You Can Do Introducing Megaport On-ramp as a Service Megaport’s Full Solution Portfolio Is Coming to India New Bare-metal GPU Instance Now Available with NVIDIA RTX Pro 6000 A Look Back at 2025: Megaport's Biggest Updates Megaport Expands Into India With Extreme IX Your 2026 Predictions From AWS re:Invent 2025 Top NaaS Trends for 2026 What is IPsec? When to Move From Public Internet to Private Connectivity Megaport and Latitude.sh: Bringing Compute and Connectivity Together Improve Your Microsoft ExpressRoute Resilience with Megaport Comparing Ways to Connect to AWS What is API-First Networking? The Hidden Cost of Running Cloud-Hosted SD-WAN for IaaS Overcoming NaaS Integration Challenges Introducing SCION with Anapaya and Megaport How to Use Network as a Service to Future-Proof Your Network Introducing 400G Ports All the As-a-services, Compared Introducing Megaport IPsec Tunnels High Score: Megaport Hits 1,000 Locations A Guide to Colocation Data Centers Maximizing Peering Through Flow Analysis Build Resilient Networks for AI Production Workloads Introducing Packet Filtering on Megaport Cloud Router Building Resilient Government IT: Strategies for Secure, Compliant, and Scalable Connectivity Future-Proofing Government IT Telstra Programmable Network Is Being Discontinued. Here’s How to Migrate The Future of WAN Design Depends on Network as a Service (NaaS) Cisco Webex Edge Connect Launches on Megaport Voice and Video Exchange How to Prepare for APRA CPS 230 Comparing the SD-WAN Licensing Needs of Major Vendors A Guide to Improving Network Performance How Latitude.sh, Wasabi, and Megaport Unlock Cost-Effective Multicloud Four Ways to Connect Your Clouds SD-WAN and MPLS: Weighing the Similarities, Differences, and Benefits A Guide to Network as a Service (NaaS) How to Arrange Bilateral Peering Sessions Comparing Major SD-WAN Vendors Software Defined Networking in Healthcare Deploying A Global Network in Minutes With Megaport AWS Direct Connect Gateway (DGW) Data Transfer Outbound Rules Bilateral and Multilateral Peering: What’s the Difference? Multi-Region SD-WAN: Why Megaport SDCI is the Right Choice Microsoft Azure is Going Secure by Default. Are You Ready? How Megaport and Vultr Are Solving the Enterprise AI Challenge Introducing Megaport NAT Gateway A Guide to AWS Security Tools How to Deploy Amazon Bedrock Using AWS Direct Connect and Megaport Azure Private Link, Explained Introducing 100G MCRs Simplifying Hybrid and Multicloud Network Connectivity How to Fix Poor AWS Latency A Look Back at 2024: Megaport’s Biggest Updates Your 2025 Predictions From AWS re:Invent 2024 Six Ways to Get a More Resilient Network in 2025 Multicloud Security: Challenges and Solutions The Real Cost of High Network Latency Why Brazil is Your Key to Unlocking Business Growth in Latin America Why You Need Integrated Network Security Six Key Differences Between Major Cloud Providers How to Automate Your Megaport Infrastructure With APIs Why Italy is Europe’s Next Cloud Expansion Hotspot How to Lower Your Cloud Costs Peering: How Local Is Local? Introducing Megaport AI Exchange Two Scenarios for Hybrid Multicloud Deployment With IBM Cloud and Microsoft Azure How to Connect Equinix and Digital Realty Megaport Enables Microsoft Azure ExpressRoute Metro for More Resilient Network Connectivity Executives, Here’s What Your Network Team Wants You to Know Easy Ways to Interconnect Your Network The Role of the Data Center in Your Network 100G VXC Expansion: Now Available From 597 Data Centers Worldwide Top 10 How-To Guides To Improve Your Network Comparing Encryption in Transit Options Comparing Generative AI Offerings From Major Cloud Providers A Sustainable Business Strategy Starts With Your Network Transforming Financial Connectivity: Introducing Megaport Financial Services Exchange (FSX) Megaport Enhancing Connectivity in Adelaide Megaport’s Latest Portal Features and Functionalities Automate Your Network Deployments With The New Megaport Terraform Provider A Recap of the Megaport World Tour 2024 Top 5 Cloud and Networking Announcements From Cisco Live 2024
Solutions to Common API Issues With Megaport
2024-07-15 · via Megaport Blog

By Gary Taylor, Solutions Architect

This detailed guide gives you 11 solutions to common API problems, so you can automate and streamline your deployments with ease.

With automation pervading the networking world in recent years, APIs have become standard for software and IT specialists. While the jury is out on the exact number of public APIs offered today, all estimates point to their massive (and ever-growing) popularity.

Megaport is one of the many thousands of vendors that provides public API access to all our services, enabling our customers to automate and streamline their deployments.

Get started with our API Overview documentation.

But for those still familiarizing themselves with a new set of APIs, it can be overwhelming to determine the cause of an error. That’s why we’ve put together this beginner-friendly guide, with 11 step-by-step solutions to common API issues, so you can bookmark and come back to it whenever you need.

HTTP status codes

If you aren’t already familiar, we recommend first memorizing these HTTP status codes. When they appear, they can offer valuable insight as to what your issue may be.

Code

Meaning

200

OK. A successful request.

400

Bad request. This error is typically caused by missing or incorrect request parameters.

401

Unauthorized. This error indicates the request is missing the required authentication credentials, usually a missing or invalid API access token.

403

Forbidden. You do not have the required permissions to perform this request.

500

Server error. When this occurs, Megaport developers are notified of the error via email from the server.

503

Server is unavailable, possibly down for maintenance.

If you’re using Postman and following our setup guide ‘Creating an API Key’, the following suggestions can help with a number of common errors.

1. Check the correct request type is being used

When creating a request, using the incorrect request type (GET, PUT, POST, etc.) can result in errors like the below:

Incorrect request type error

The error message for this issue is usually self-explanatory:

{
   "message": "Request method 'POST' not supported",
   "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
   "data": [
       "Unsupported Http Methods: POST",
       "Supported Http Methods: [GET]"
   ]
}

To avoid this error, make sure you use the correct request type.

Correct request type

2. Check the correct URL for token authentication

After first generating an access token (which is done as a POST request), the URL you enter will depend on whether you’re using our staging or production environment. Not using the correct URL will cause the error below:

{
   "error": "invalid_client"
}

Include the correct token authentication URL for your API:

  • https://api.megaport.com/: This is the live production environment. You will be liable for any services ordered in this system.
    • The token authentication URL for production is https://auth-m2m.megaport.com/oauth2/token.
  • https://api-staging.megaport.com/: This is the test staging environment. You can test any action in this environment and the API calls and responses will mirror the production system, but the services won’t be deployed and you won’t be billed for any activity.
    • The token authentication URL for staging is https://auth-m2m-staging.megaport.com/oauth2/token.

3. Check the Auth Type

When retrieving the access token, ensure “Auth Type” is set to “Basic Auth”:

Auth Type

For additional API calls, the Auth Type should be set to “Bearer Token” and the token should be set to the access token variable {{accessToken}}.

Auth Type - Bearer Token

4. Use the correct API Key role

When creating the API Key and Secret you can choose the role, namely “Company Admin” or “Read Only”. Choosing the incorrect role can result in errors.

Ensure the correct role is chosen for the user.

API Key role

To improve security, it is also recommended that you add the API Client and Secret as a variable within the authorization section.

API Client and Secret variable

You can then add the details to just the collection under “Edit”.

Here, you need to remove the brackets:

API Key edits

6. Check MVE image details

As the Megaport MVE portfolio increases, the image ID can change over time. A common deployment error is to reuse an old image ID without confirming the latest image ID version, resulting in an error like this one:

{
   "message": "Validation failed",
   "terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
   "data": "MVE product code null not found"
}

Before adding your image ID, ensure you have the latest one by https://api.megaport.com/v3/product/mve/images checking current image IDs for each vendor.

  "data": {
       "mveImages": [
           {
               "id": 63,
               "version": "vION 3108v-6.4.1",
               "product": "Prisma SD-WAN 3108v",
               "vendor": "Palo Alto",
               "vendorDescription": "Engineering Build - Not for Production Use",
               "releaseImage": false,
               "productCode": "prisma-3108"
           },
           {
               "id": 56,
               "version": "6.4.15",
               "product": "FortiGate-VM",
               "vendor": "Fortinet",
               "vendorDescription": null,
               "releaseImage": true,
               "productCode": "fortigate"
           },

7. Avoid overlapping IP addresses

When a VXC with a specific IP schema is deployed and the same API call is made, you will get an error as follows:

data": "VRouter: ipAddress '169.254.96.46/29' overlaps with '169.254.96.40/29', Validation of a_csp_request failed"

Duplicate IP addresses are not allowed. Likewise, no overlapping VLAN IDs are permitted per individual Megaport, MCR, or MVE. Remove these duplicates and overlaps to resolve the issue.

Remove IP overlaps

8. MVE and Azure inner VLAN tag statement

There are two ways to deploy an Azure ExpressRoute:

  1. As “Single Azure Peering VLAN” for customers that do not support Q-in-Q
  2. With Q-in-Q enabled.

Each deployment method has a slightly different tag statement, and it’s easy to confuse the two – but doing so will cause issues.

Confirm your ExpressRoute deployment method and follow the relevant steps:

1. Single Azure Peering VLAN: The A-End (Megaport) and B-End (Azure) will have the same VLAN ID. Megaport passes/translates the Azure inner VLAN (C-TAG) as defined in the ExpressRoute portal. In the example below it is 200:

Single Azure Peering VLAN

The associated API field is called “innerVlan” and relates to the C-TAG as defined in the Azure portal.

{% raw %}     "rateLimit": 1000,
     "term": 12,
     "aEnd": {
       "innerVlan": 200
     },
     "bEnd": {
       "productUid": "{{azurepuid}}",
       "innerVlan": 200{% endraw %}

2. Q-in-Q: Within the Azure portal the same inner VLAN (C-TAG) is configured, but now as Q-in-Q is enabled, the Azure VLAN is not exposed in the Megaport APIs.

In the example below, the “innerVlan” field is actually the outer VLAN or S-TAG. The naming convention is the same, which is what causes the confusion.

{% raw %}"rateLimit": 1000,
"term": 12,
"aEnd": \{
"innerVlan": 100
     },
     "bEnd": {
       "productUid": "{{azurepuid}}"{% endraw %}

9. Enter your diversity zone

The “diversityZone” field is optional, and if not requested then the diversity zone will be automatically added:

Diversity zone

Diversity zone 2

Not confirming the diversity zone required for your service, as well as the preferred deployment location, could result in an unsuccessful deployment.

To avoid this, navigate to your diversity zone field and ensure it’s set to the correct location.

10. Align the Megaport diversity zone to the CSP zone

Once your Megaport service has deployed into your chosen diversity zone and you then wish to deploy a VXC into a Cloud Service Provider (CSP), we recommend deploying the cloud VXC in the same diversity zone as your Megaport service. Failure to do this can result in possible single points of failure within your network.

To align your Megaport diversity zone and CSP zone, confirm the diversity zone as follows:

https://api.megaport.com/v2/dropdowns/partner/megaports?connectType={cloudProvider}&vxcPermitted={boolean}

The below example uses AWSHC (for AWS Hosted Connection), with results filtered by location.

“productUid” would be the B-nd location in the VXC order.

{
           "productUid": "dc745b48-6e84-4a84-9023-76f151c0b7d2",
           "companyUid": "605cb850-dfb4-4a05-a171-8bf17757b3a2",
           "companyName": "AWS",
           "title": "EU (Stockholm) (eu-north-1)",
           "locationId": 95,
           "speed": 10000,
           "maxVxcSpeed": 10000,
           "vxcPermitted": true,
           "diversityZone": "red",
           "rank": 700,
           "lag_id": 5,
           "lag_primary": true,
           "aggregation_id": 120069,
           "connectType": "AWSHC"
       },
       {
           "productUid": "36ec86b8-e4e1-479a-958c-15917949c761",
           "companyUid": "605cb850-dfb4-4a05-a171-8bf17757b3a2",
           "companyName": "AWS",
           "title": "EU (Stockholm) (eu-north-1)",
           "locationId": 95,
           "speed": 10000,
           "maxVxcSpeed": 10000,
           "vxcPermitted": true,
           "diversityZone": "blue",
           "rank": 701,
           "lag_id": 3,
           "lag_primary": true,
           "aggregation_id": 120072,
           "connectType": "AWSHC"
       },

11. Export user activity

Customers often ask us how they can export user activity. This is possible via the following GET API call:

https://api.megaport.com/v2/activity?personIdOrUid={personID}&companyIdOrUid={companyID}&page=0

Export user activity

Megaport’s new v3 APIs

Megaport is deprecating v2 APIs on 30 September 2024. Our new v3 API suite offers more features and functionalities – we think you’re going to love it. An FAQ detailing the API v2 shutdown is available here if you want to learn more.

Need help on something we didn’t cover in this blog? From live chat to extensive documentation, get the support you need here.