Creating L2 Connection

A detailed guideline for creating a port-to-port or business-to-business layer 2 connection request through the Console Connect API Service.

Prerequisite

The following requirements must be met to perform the provided code samples.

  1. API Key - Contact the Console Connect Support team to request for an API Key Email: support@consoleconnect.com
  2. Access Rights - User must have role: Network Admin/NETWORKCONTROL. You may verify your role here
  3. Acceptance of Agreement - API users must sign the Specific Terms for API Use.
  4. Your company has been verified on the Console Connect platform.

    I. Creating a Port-to-Port Layer 2 Connection

    An L2 connectivity in which a user establishes a link between two ports managed by the same organization. This setup indicates that the user has precise knowledge of the ports involved in the connection. Below is a guideline to establish a port-to-port connectivity through the Console Connect API Service.

    I.I. Listing ports for source port and destination port

    To list all ports owned by your company execute the following curl command: ```bash curl -X GET https://api.consoleconnect.com/api/company/:companyUsername/ports?deleted=false`\ -H "Authorization: Bearer "
<details>
  <summary>
    If the request was successful, it will respond with a detailed list of ports for the given company.</summary>

  ```json

  {
    "results": [
      {
        "dcpCompanyId": null,
        "name": "XXXX CONNECTIVITY",
        "speed": {
          "value": 1000,
          "name": "1000 Mbps"
        },
        "speedOverprovisioningFactor": 1,
        "singleService": false,
        "locationId": null,
        "dataCenterFacilityId": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "popId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "metroId": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "status": "ACTIVE",
        "serviceStatus": "OPEN",
        "linkState": "UP",
        "linkStateUpSince": null,
        "linkStateSyncedAt": "2021-06-08T01:05:03.507Z",
        "type": "NNI",
        "isEdgePort": false,
        "edgePayload": null,
        "mediaType": "COPPER",
        "partner": {
          "type": "NONE",
          "connectionSpeeds": []
        },
        "ip": {
          "ipv4": null,
          "ipv6": null
        },
        "capabilities": {
          "model6Limit": false,
          "model6LimitNumber": null,
          "singleService": false
        },
        "activeChangedAt": "2021-06-08T01:05:33.694Z",
        "firstActiveAt": "2021-06-08T01:05:03.706Z",
        "updatedAt": "2023-01-24T02:08:29.005Z",
        "createdAt": "2021-06-08T01:04:59.457Z",
        "deleted": false,
        "deletedAt": null,
        "importedAt": null,
        "importer": null,
        "salesRecordId": "123456",
        "paymentType": "plan",
        "payg": null,
        "onboarded": true,
        "onboardedBy": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "onboardedAt": "2021-06-08T01:04:59.455Z",
        "onboardedStatus": "COMPLETE",
        "onboardedStatusDetail": null,
        "onboardedDeviceName": "usw01.pop01.hkg39",
        "onboardedInterfaceName": "GigabitEthernet0/0/11",
        "onboardedAllocatedBandwidth": 10,
        "billingId": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "vlanRanges": [
          {
            "start": 1000,
            "end": 1010
          }
        ],
        "iciLink": "A",
        "reportingLabels": [
          "Meeting place port"
        ],
        "supportedServices": [
          "L2"
        ],
        "cosTransparency": null,
        "cosMapping": {
          "GOLD": [
            ""
          ],
          "SILVERPLUS": [],
          "SILVER": [
            ""
          ],
          "BRONZE": []
        },
        "externalId": "port-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "ticketLink": null,
        "crossConnectXcOwner": null,
        "crossConnectFullDemarc": null,
        "interconnectEnabled": null,
        "interconnectProvider": null,
        "interconnectOrderNumber": null,
        "interconnectCircuitId": null,
        "interconnectCompletedAt": null,
        "interconnectVlanRange": null,
        "interconnectNniPortName": null,
        "localLoopEnabled": null,
        "localLoopId": null,
        "localLoopCustomerId": null,
        "localLoopProviderName": null,
        "localLoopSalesRecordId": null,
        "localLoopBandwidth": null,
        "localLoopCompletedAt": null,
        "localLoopASideAddress": null,
        "localLoopASideXConnectId": null,
        "localLoopZSideAddress": null,
        "localLoopGsmpId": null,
        "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "accessCircuit": {
          "crossConnectMediaType": null
        },
        "companyId": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "capacity": {
          "total": 1000,
          "utilised": 365,
          "remaining": 635
        },
        "company": {
          "officeAddress": null,
          "system": {
            "welcomeMessage": true
          },
          "company": {
            "industry": null,
            "companySize": null,
            "dateFounded": null,
            "clientId": null,
            "first": null,
            "last": null,
            "address": null,
            "city": null,
            "state": null,
            "zip": null,
            "phone": null,
            "fax": null,
            "businessType": "Internet Exchange",
            "website": "sample.com",
            "registeredName": "updatedone2",
            "addresses": [
              {
                "geo": {
                  "type": "Point",
                  "coordinates": []
                },
                "primary": true,
                "registered": true,
                "address": "2 Stuart Road",
                "city": "Tegucigalpa",
                "state": "hk",
                "zip": "4000",
                "country": "HN",
                "email": null,
                "phone": "01234567891"
              }
            ],
            "partnerType": null,
            "isIoTDemoCompany": false
          },
          "cloudProviderDetails": {
            "asn": {
              "range": [
                4200099007,
                4200099009
              ]
            },
            "cloudType": "vultr",
            "companyType": "B2B",
            "bgpAuthority": "PCCWGLOBAL"
          },
          "stats": {
            "members": 186,
            "interconnections": 0,
            "followers": 0,
            "following": 0,
            "privateArticles": 0,
            "privateEvents": 0,
            "privatePosts": 0,
            "articles": 14,
            "events": 0,
            "posts": 29
          },
          "accountManagerEmail": null,
          "accountManagerId": null,
          "createdAt": "2019-08-09T05:32:18.613Z",
          "updatedAt": "2024-07-25T06:51:06.162Z",
          "username": "qe1",
          "deletedAt": null,
          "deleted": false,
          "verified": true,
          "tags": [
            "promoted"
          ],
          "status": "ACTIVE",
          "displayOrder": 0,
          "external": [
            {
              "id": "15",
              "type": "SDWAN",
              "status": "UNSYNCED"
            }
          ],
          "groups": [],
          "location": null,
          "summary": "<p>Testing adding new image12</p>",
          "headline": "wholesale",
          "background": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "avatarId": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "SAMPLE NAME",
          "type": "COMPANY",
          "oldAvatarId": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "verifiedIdentity": true,
          "portsActive": 14,
          "categories": [
            "Analytics",
            "AI",
            "IoT"
          ],
          "overviewImage": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "isCloudProvider": true,
          "signedCompanyRefId": 4,
          "signedCompanyVerified": true,
          "billingAccount": "115475",
          "businessRegistrationNumber": "123456",
          "selectiveQinQTunnelProvider": [],
          "companies": [],
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "online": false
        },
        "dataCenterFacility": {
          "system": {
            "welcomeMessage": null
          },
          "company": {
            "privacy": {
              "network": {
                "mode": "PUBLIC",
                "blackListIds": [],
                "whiteListIds": []
              },
              "community": {
                "mode": "PUBLIC",
                "blackListIds": [],
                "whiteListIds": []
              }
            },
            "businessType": null,
            "partnerType": null,
            "companySize": null,
            "dateFounded": null,
            "registeredName": null,
            "businessRegistrationCertReference": null,
            "businessRegistrationCertUploadedAt": null,
            "businessRegistrationCertRejectedReason": null,
            "clientId": null,
            "first": null,
            "last": null,
            "address": null,
            "city": null,
            "state": null,
            "zip": null,
            "phone": null,
            "fax": null,
            "addresses": [
              {
                "geo": {
                  "type": "Point",
                  "coordinates": []
                },
                "registered": false,
                "address": "",
                "city": "Hong Kong",
                "state": "",
                "zip": "zipcode",
                "country": "HK",
                "email": null,
                "phone": null
              }
            ],
            "regionalInternetRegistry": [],
            "businessRegistrationCertVerified": "UNVERIFIED",
            "website": "http://www.company.com1",
            "emailDomains": [],
            "industry": "",
            "businessDevelopmentManagerTypePreference": "UNSPECIFIED",
            "isIoTDemoCompany": false
          },
          "dataCenterFacility": {
            "airportCodes": [],
            "speeds": [],
            "metroId": "dataCenterFacility",
            "ready": true,
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "nniReady": true,
            "brandId": null,
            "canBundleCrossConnect": false
          },
          "cloudProviderDetails": {
            "asn": {
              "range": []
            },
            "bgpAuthority": "PCCWGLOBAL",
            "companyType": "DCP"
          },
          "stats": {
            "members": 0,
            "interconnections": 0,
            "followers": 5,
            "following": 0,
            "privateArticles": 0,
            "privateEvents": 0,
            "privatePosts": 0,
            "articles": 0,
            "events": 0,
            "posts": 0
          },
          "overviewImage": null,
          "businessRegistrationNumber": null,
          "signedCompanyRefId": null,
          "accountManagerEmail": null,
          "accountManagerId": null,
          "createdAt": "2018-02-20T04:49:09.604Z",
          "updatedAt": "2024-07-10T04:22:15.894Z",
          "username": "hkg05",
          "deletedAt": null,
          "deleted": false,
          "verified": true,
          "tags": [
            "offnet",
            "monthly-ports"
          ],
          "status": "ACTIVE",
          "displayOrder": -299,
          "groups": [],
          "location": null,
          "summary": "",
          "headline": null,
          "background": null,
          "avatarId": null,
          "name": "hkg39-Asia-HK-APAC",
          "type": "DATA_CENTER_FACILITY",
          "popIds": [
            "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
          ],
          "costbookLocationId": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "costbookLocation": {
            "name": "ASIA 1",
            "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
            "deletedAt": null,
            "createdAt": "2019-05-21T04:09:32.819Z",
            "updatedAt": "2019-11-05T01:31:28.426Z",
            "tags": [
              "generated"
            ],
            "gatewayIds": [],
            "regionIds": [
              "xxxxxxxxxxxxxxxxxxxxxxxx"
            ],
            "regions": [
              {
                "name": "APAC",
                "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
                "deletedAt": null,
                "createdAt": "2017-12-18T00:26:28.610Z",
                "updatedAt": "2018-09-11T04:15:10.124Z",
                "deleted": false,
                "priceMultiplier": 1,
                "insightRegion": "Asia"
              }
            ],
            "gateways": []
          },
          "verifiedIdentity": false,
          "provider": [
            "PCCWGLOBAL"
          ],
          "destinationPortOnly": false,
          "categories": [],
          "nnis": null,
          "isCloudProvider": false,
          "l3CostbookLocationId": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "bundleCrossConnectChargeId": null,
          "signedCompanyVerified": false,
          "selectiveQinQTunnelProvider": [],
          "companies": [],
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "online": false
        },
        "connections": [
          {
            "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
            "name": "SAMPLE NAME",
            "status": "ERROR",
            "speed": 10,
            "type": "LAYER2",
            "srcConfigTag": null,
            "typeFriendly": "IBM Direct Link"
          },
          {
            "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
            "name": "SAMPLE NAME2",
            "status": "ERROR",
            "speed": 10,
            "type": "LAYER2",
            "srcConfigTag": null,
            "typeFriendly": "IBM Direct Link"
          }
        ],
        "metro": {
          "name": "Hong Kong",
          "code": "HKG",
          "country": "hk",
          "rir": "APNIC",
          "regionIds": [
            "xxxxxxxxxxxxxxxxxxxxxxxx"
          ],
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "deletedAt": null,
          "createdAt": "2017-12-18T00:45:44.120Z",
          "updatedAt": "2024-02-25T05:02:47.267Z",
          "logo": null,
          "description": "a",
          "ready": true,
          "canCreateController": false,
          "deleted": false,
          "tags": []
        }
      }
    ]
  }

Note:
Take note of your port ID (Sample: results[0].id), speed (Sample: results[0].speed), and metro ID (Sample: results[0].metroId) of the destination port.

I.II. Creating S2S (Self to Self) Connectivity request

Below is a sample curl command that will execute the creation of L2 Connection (port to port), it accepts your company username as path parameter.

curl -X PUT https://api.consoleconnect.com/api/v2/company/:companyUsername/connections/layer2`\
  -H "Authorization: Bearer <API_KEY>"
  --data-raw '{
    "name":"DEMO-L2-S2S",
    "portId":"xxxxxxxxxxxxxxxxxxxxxxxx",
    "destPortId":"xxxxxxxxxxxxxxxxxxxxxxxx",
    "destCompany": <COMPANY_USERNAME>,
    "destMetroId": "xxxxxxxxxxxxxxxxxxxxxxxx",
    "duration":1,
    "durationUnit":"m",
    "paymentType":"invoice",
    "classOfService":"SILVER",
    "speed":100,
    "type":"LAYER2",
    "evergreen":true
  }'

II. Creating a Business-to-Business Connection

An L2 connectivity where in a user initiates a link between two ports managed by separate organizations. Consequently, the user does not have prior knowledge of which specific port will be used for the connection.

II.I. Listing ports for source port

To list all ports owned by your company execute the following curl command:

curl -X GET https://api.consoleconnect.com/api/company/:companyUsername/ports?deleted=false`\
    -H "Authorization: Bearer <API_KEY>"
If the request was successful, it will respond with a detailed list of ports for the given company.

{
  "results": [
    {
      "dcpCompanyId": null,
      "name": "XXXX CONNECTIVITY",
      "speed": {
        "value": 1000,
        "name": "1000 Mbps"
      },
      "speedOverprovisioningFactor": 1,
      "singleService": false,
      "locationId": null,
      "dataCenterFacilityId": "xxxxxxxxxxxxxxxxxxxxxxxx",
      "popId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "metroId": "xxxxxxxxxxxxxxxxxxxxxxxx",
      "status": "ACTIVE",
      "serviceStatus": "OPEN",
      "linkState": "UP",
      "linkStateUpSince": null,
      "linkStateSyncedAt": "2021-06-08T01:05:03.507Z",
      "type": "NNI",
      "isEdgePort": false,
      "edgePayload": null,
      "mediaType": "COPPER",
      "partner": {
        "type": "NONE",
        "connectionSpeeds": []
      },
      "ip": {
        "ipv4": null,
        "ipv6": null
      },
      "capabilities": {
        "model6Limit": false,
        "model6LimitNumber": null,
        "singleService": false
      },
      "activeChangedAt": "2021-06-08T01:05:33.694Z",
      "firstActiveAt": "2021-06-08T01:05:03.706Z",
      "updatedAt": "2023-01-24T02:08:29.005Z",
      "createdAt": "2021-06-08T01:04:59.457Z",
      "deleted": false,
      "deletedAt": null,
      "importedAt": null,
      "importer": null,
      "salesRecordId": "123456",
      "paymentType": "plan",
      "payg": null,
      "onboarded": true,
      "onboardedBy": "xxxxxxxxxxxxxxxxxxxxxxxx",
      "onboardedAt": "2021-06-08T01:04:59.455Z",
      "onboardedStatus": "COMPLETE",
      "onboardedStatusDetail": null,
      "onboardedDeviceName": "usw01.pop01.hkg39",
      "onboardedInterfaceName": "GigabitEthernet0/0/11",
      "onboardedAllocatedBandwidth": 10,
      "billingId": "xxxxxxxxxxxxxxxxxxxxxxxx",
      "vlanRanges": [
        {
          "start": 1000,
          "end": 1010
        }
      ],
      "iciLink": "A",
      "reportingLabels": [
        "Meeting place port"
      ],
      "supportedServices": [
        "L2"
      ],
      "cosTransparency": null,
      "cosMapping": {
        "GOLD": [
          ""
        ],
        "SILVERPLUS": [],
        "SILVER": [
          ""
        ],
        "BRONZE": []
      },
      "externalId": "port-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "ticketLink": null,
      "crossConnectXcOwner": null,
      "crossConnectFullDemarc": null,
      "interconnectEnabled": null,
      "interconnectProvider": null,
      "interconnectOrderNumber": null,
      "interconnectCircuitId": null,
      "interconnectCompletedAt": null,
      "interconnectVlanRange": null,
      "interconnectNniPortName": null,
      "localLoopEnabled": null,
      "localLoopId": null,
      "localLoopCustomerId": null,
      "localLoopProviderName": null,
      "localLoopSalesRecordId": null,
      "localLoopBandwidth": null,
      "localLoopCompletedAt": null,
      "localLoopASideAddress": null,
      "localLoopASideXConnectId": null,
      "localLoopZSideAddress": null,
      "localLoopGsmpId": null,
      "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
      "accessCircuit": {
        "crossConnectMediaType": null
      },
      "companyId": "xxxxxxxxxxxxxxxxxxxxxxxx",
      "capacity": {
        "total": 1000,
        "utilised": 365,
        "remaining": 635
      },
      "company": {
        "officeAddress": null,
        "system": {
          "welcomeMessage": true
        },
        "company": {
          "industry": null,
          "companySize": null,
          "dateFounded": null,
          "clientId": null,
          "first": null,
          "last": null,
          "address": null,
          "city": null,
          "state": null,
          "zip": null,
          "phone": null,
          "fax": null,
          "businessType": "Internet Exchange",
          "website": "sample.com",
          "registeredName": "updatedone2",
          "addresses": [
            {
              "geo": {
                "type": "Point",
                "coordinates": []
              },
              "primary": true,
              "registered": true,
              "address": "2 Stuart Road",
              "city": "Tegucigalpa",
              "state": "hk",
              "zip": "4000",
              "country": "HN",
              "email": null,
              "phone": "01234567891"
            }
          ],
          "partnerType": null,
          "isIoTDemoCompany": false
        },
        "cloudProviderDetails": {
          "asn": {
            "range": [
              4200099007,
              4200099009
            ]
          },
          "cloudType": "vultr",
          "companyType": "B2B",
          "bgpAuthority": "PCCWGLOBAL"
        },
        "stats": {
          "members": 186,
          "interconnections": 0,
          "followers": 0,
          "following": 0,
          "privateArticles": 0,
          "privateEvents": 0,
          "privatePosts": 0,
          "articles": 14,
          "events": 0,
          "posts": 29
        },
        "accountManagerEmail": null,
        "accountManagerId": null,
        "createdAt": "2019-08-09T05:32:18.613Z",
        "updatedAt": "2024-07-25T06:51:06.162Z",
        "username": "qe1",
        "deletedAt": null,
        "deleted": false,
        "verified": true,
        "tags": [
          "promoted"
        ],
        "status": "ACTIVE",
        "displayOrder": 0,
        "external": [
          {
            "id": "15",
            "type": "SDWAN",
            "status": "UNSYNCED"
          }
        ],
        "groups": [],
        "location": null,
        "summary": "<p>Testing adding new image12</p>",
        "headline": "wholesale",
        "background": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "avatarId": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "name": "SAMPLE NAME",
        "type": "COMPANY",
        "oldAvatarId": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "verifiedIdentity": true,
        "portsActive": 14,
        "categories": [
          "Analytics",
          "AI",
          "IoT"
        ],
        "overviewImage": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "isCloudProvider": true,
        "signedCompanyRefId": 4,
        "signedCompanyVerified": true,
        "billingAccount": "115475",
        "businessRegistrationNumber": "123456",
        "selectiveQinQTunnelProvider": [],
        "companies": [],
        "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "online": false
      },
      "dataCenterFacility": {
        "system": {
          "welcomeMessage": null
        },
        "company": {
          "privacy": {
            "network": {
              "mode": "PUBLIC",
              "blackListIds": [],
              "whiteListIds": []
            },
            "community": {
              "mode": "PUBLIC",
              "blackListIds": [],
              "whiteListIds": []
            }
          },
          "businessType": null,
          "partnerType": null,
          "companySize": null,
          "dateFounded": null,
          "registeredName": null,
          "businessRegistrationCertReference": null,
          "businessRegistrationCertUploadedAt": null,
          "businessRegistrationCertRejectedReason": null,
          "clientId": null,
          "first": null,
          "last": null,
          "address": null,
          "city": null,
          "state": null,
          "zip": null,
          "phone": null,
          "fax": null,
          "addresses": [
            {
              "geo": {
                "type": "Point",
                "coordinates": []
              },
              "registered": false,
              "address": "",
              "city": "Hong Kong",
              "state": "",
              "zip": "zipcode",
              "country": "HK",
              "email": null,
              "phone": null
            }
          ],
          "regionalInternetRegistry": [],
          "businessRegistrationCertVerified": "UNVERIFIED",
          "website": "http://www.company.com1",
          "emailDomains": [],
          "industry": "",
          "businessDevelopmentManagerTypePreference": "UNSPECIFIED",
          "isIoTDemoCompany": false
        },
        "dataCenterFacility": {
          "airportCodes": [],
          "speeds": [],
          "metroId": "dataCenterFacility",
          "ready": true,
          "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
          "nniReady": true,
          "brandId": null,
          "canBundleCrossConnect": false
        },
        "cloudProviderDetails": {
          "asn": {
            "range": []
          },
          "bgpAuthority": "PCCWGLOBAL",
          "companyType": "DCP"
        },
        "stats": {
          "members": 0,
          "interconnections": 0,
          "followers": 5,
          "following": 0,
          "privateArticles": 0,
          "privateEvents": 0,
          "privatePosts": 0,
          "articles": 0,
          "events": 0,
          "posts": 0
        },
        "overviewImage": null,
        "businessRegistrationNumber": null,
        "signedCompanyRefId": null,
        "accountManagerEmail": null,
        "accountManagerId": null,
        "createdAt": "2018-02-20T04:49:09.604Z",
        "updatedAt": "2024-07-10T04:22:15.894Z",
        "username": "hkg05",
        "deletedAt": null,
        "deleted": false,
        "verified": true,
        "tags": [
          "offnet",
          "monthly-ports"
        ],
        "status": "ACTIVE",
        "displayOrder": -299,
        "groups": [],
        "location": null,
        "summary": "",
        "headline": null,
        "background": null,
        "avatarId": null,
        "name": "hkg39-Asia-HK-APAC",
        "type": "DATA_CENTER_FACILITY",
        "popIds": [
          "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        ],
        "costbookLocationId": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "costbookLocation": {
          "name": "ASIA 1",
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "deletedAt": null,
          "createdAt": "2019-05-21T04:09:32.819Z",
          "updatedAt": "2019-11-05T01:31:28.426Z",
          "tags": [
            "generated"
          ],
          "gatewayIds": [],
          "regionIds": [
            "xxxxxxxxxxxxxxxxxxxxxxxx"
          ],
          "regions": [
            {
              "name": "APAC",
              "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
              "deletedAt": null,
              "createdAt": "2017-12-18T00:26:28.610Z",
              "updatedAt": "2018-09-11T04:15:10.124Z",
              "deleted": false,
              "priceMultiplier": 1,
              "insightRegion": "Asia"
            }
          ],
          "gateways": []
        },
        "verifiedIdentity": false,
        "provider": [
          "PCCWGLOBAL"
        ],
        "destinationPortOnly": false,
        "categories": [],
        "nnis": null,
        "isCloudProvider": false,
        "l3CostbookLocationId": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "bundleCrossConnectChargeId": null,
        "signedCompanyVerified": false,
        "selectiveQinQTunnelProvider": [],
        "companies": [],
        "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "online": false
      },
      "connections": [
        {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "SAMPLE NAME",
          "status": "ERROR",
          "speed": 10,
          "type": "LAYER2",
          "srcConfigTag": null,
          "typeFriendly": "IBM Direct Link"
        },
        {
          "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
          "name": "SAMPLE NAME2",
          "status": "ERROR",
          "speed": 10,
          "type": "LAYER2",
          "srcConfigTag": null,
          "typeFriendly": "IBM Direct Link"
        }
      ],
      "metro": {
        "name": "Hong Kong",
        "code": "HKG",
        "country": "hk",
        "rir": "APNIC",
        "regionIds": [
          "xxxxxxxxxxxxxxxxxxxxxxxx"
        ],
        "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
        "deletedAt": null,
        "createdAt": "2017-12-18T00:45:44.120Z",
        "updatedAt": "2024-02-25T05:02:47.267Z",
        "logo": null,
        "description": "a",
        "ready": true,
        "canCreateController": false,
        "deleted": false,
        "tags": []
      }
    }
  ]
}

Info
Take note of your port ID (results[0].id) as your source port

II.II. Obtaining Metro precense for a specific company

To obtain the list of company's metro precense and details execute the sample curl command below.

curl -X GET https://api.consoleconnect.com/api/company/:companyUsername/metro/capabilities`\
    -H "Authorization: Bearer <API_KEY>"
If the request was successful, it will respond with a detailed list of DCFs.

{
  "results": [
    {
      "name": "Hong Kong",
      "code": "HKG",
      "logo": null,
      "canCreateController": false,
      "tags": [],
      "description": "a",
      "country": "hk",
      "rir": "APNIC",
      "regionIds": [
        "xxxxxxxxxxxxxxxxxxxxxxxx"
      ],
      "ready": true,
      "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
      "deletedAt": null,
      "createdAt": "2017-12-18T00:45:44.120Z",
      "updatedAt": "2024-02-25T05:02:47.267Z",
      "deleted": false,
      "capabilities": {
        "layer2": true
      },
      "firstDataCenterFacilityIdInMetro": "xxxxxxxxxxxxxxxxxxxxxxxx"
    }
  ]
}

Info
Take note of the metro ID (id), and region IDs (metro.regionIds)

II.III. Searching Data Center Facilities (DCF)

Below is an example execution of API to filter and return a list Data Center Facilities with details based on the filter query parameter.

curl -X GET "https://api.consoleconnect.com/v2/data-center-facility?filter={"where":{"dataCenterFacility.ready":true, "dataCenterFacility.metroId": "xxxxxxxxxxxxxxxxxxxxxxxx"},"skip":0,"limit":100}"`\
    -H "Authorization: Bearer <API_KEY>"

Note
See more filtering samples here

If the request was successful, it will respond with a detailed list of DCFs.

[
  {
    "company": {
      "privacy": {
        "network": {
          "mode": "PUBLIC",
          "blackListIds": [],
          "whiteListIds": []
        },
        "community": {
          "mode": "PUBLIC",
          "blackListIds": [],
          "whiteListIds": []
        }
      },
      "addresses": [
        {
          "registered": false,
          "address": "",
          "city": "Hong Kong",
          "state": "",
          "zip": "zipcode",
          "country": "HK",
          "email": null,
          "phone": null,
          "geo": {
            "type": "Point",
            "coordinates": [
              "114.177216",
              "22.302711"
            ]
          }
        }
      ],
      "parentIds": [],
      "regionalInternetRegistry": [],
      "businessRegistrationCertVerified": "UNVERIFIED",
      "website": "http://www.company.com1",
      "emailDomains": [],
      "industry": "",
      "businessDevelopmentManagerTypePreference": "UNSPECIFIED",
      "isIoTDemoCompany": false
    },
    "username": "hkg05",
    "name": "hkg39-Asia-HK-APAC",
    "tags": [
      "offnet",
      "monthly-ports"
    ],
    "dataCenterFacility": {
      "airportCodes": [],
      "speeds": [],
      "metroId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
      "ready": true,
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "nniReady": true,
      "brandId": null,
      "canBundleCrossConnect": false
    },
    "stats": {
      "members": 0,
      "interconnections": 0,
      "followers": 5,
      "following": 0,
      "privateArticles": 0,
      "privateEvents": 0,
      "privatePosts": 0,
      "articles": 0,
      "events": 0,
      "posts": 0
    },
    "provider": [
      "PCCWGLOBAL"
    ],
    "selectiveQinQTunnelProvider": [],
    "externalId": null,
    "destinationPortOnly": false,
    "verified": true,
    "nnis": null,
    "costbookLocationId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
    "id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
    "bundleCrossConnectChargeId": null,
    "deletedAt": null,
    "createdAt": "2018-02-20T04:49:09.604Z",
    "updatedAt": "2024-11-15T00:23:58.765Z"
  },
  {
    "company": {
      "privacy": {
        "network": {
          "mode": "PUBLIC",
          "blackListIds": [],
          "whiteListIds": []
        },
        "community": {
          "mode": "PUBLIC",
          "blackListIds": [],
          "whiteListIds": []
        }
      },
      "addresses": [
        {
          "primary": true,
          "registered": false,
          "address": "Mega-iAdvantage, 399 Chai Wan Road",
          "city": "Hong Kong",
          "state": null,
          "zip": null,
          "country": "HK",
          "email": null,
          "phone": null,
          "geo": {
            "type": "Point",
            "coordinates": [
              "22.26637",
              "114.24658"
            ]
          }
        }
      ],
      "parentIds": [],
      "regionalInternetRegistry": [],
      "businessRegistrationCertVerified": "UNVERIFIED",
      "website": "https://sample.com",
      "emailDomains": [],
      "businessDevelopmentManagerTypePreference": "UNSPECIFIED",
      "isIoTDemoCompany": false
    },
    "username": "sample1",
    "name": "Sample",
    "tags": [
      "free-cross-connect",
      "free"
    ],
    "dataCenterFacility": {
      "airportCodes": [
        ""
      ],
      "speeds": [],
      "metroId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
      "ready": true,
      "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "nniReady": true,
      "brandId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
      "canBundleCrossConnect": false
    },
    "stats": {
      "members": 0,
      "interconnections": 0,
      "followers": 3,
      "following": 0,
      "privateArticles": 0,
      "privateEvents": 0,
      "privatePosts": 0,
      "articles": 0,
      "events": 0,
      "posts": 0
    },
    "provider": [
      "PCCWGLOBAL"
    ],
    "selectiveQinQTunnelProvider": [],
    "externalId": null,
    "destinationPortOnly": false,
    "verified": true,
    "nnis": null,
    "costbookLocationId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
    "id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
    "bundleCrossConnectChargeId": null,
    "deletedAt": null,
    "createdAt": "2018-02-20T04:50:25.328Z",
    "updatedAt": "2024-11-25T06:09:28.667Z"
  }
]

Info
Take note of the DCF ID ([0].id).

II.IV. Creating B2B (Business to Business) Connectivity Request

Below is a sample curl command that will execute the creation of L2 Connection (Business to Business) request, it accepts your company username as path parameter.

curl -X PUT https://api.consoleconnect.com/api/v2/company/:companyUsername/connections/layer2`\
  -H "Authorization: Bearer <API_KEY>"
  --data-raw '{
    "name":"DEMO-L2-B2B-for-docs",
    "portId":"xxxxxxxxxxxxxxxxxxxxxxxx",
    "destCompany": <COMPANY_USERNAME>,
    "destDcf": "xxxxxxxxxxxxxxxxxxxxxxxx",
    "destMetroId": "xxxxxxxxxxxxxxxxxxxxxxxx",
    "destRegionId": "xxxxxxxxxxxxxxxxxxxxxxxx",
    "duration":1,
    "durationUnit":"m",
    "paymentType":"invoice",
    "classOfService":"SILVER",
    "speed":100,
    "type":"LAYER2",
    "evergreen":true
  }'