-
Release Notes
- July 8, 2024
- May 22, 2024
- April 17, 2024
- March 20, 2024
- February 22, 2024
- January 18, 2024
- 2023 Releases
- 2022 Releases
-
2021 Releases
- December 20, 2021
- December 1, 2021
- November 22, 2021
- November 4, 2021
- October 26, 2021
- September 30, 2021
- September 22, 2021
- September 2, 2021
- August 16, 2021
- August 2, 2021
- July 19, 2021
- July 1, 2021
- June 17, 2021
- June 1, 2021
- April 30, 2021
- April 8, 2021
- March 25, 2021
- March 15, 2021
- February 25, 2021
- February 8, 2021
- January 28, 2021
- January 21, 2021
- January 13, 2021
- 2020 Releases
- Getting Started
- Ports
- Cross Connects
- Point-to-Point
- Virtual Circuits
- Cloud Connections
- Cloud Router
- Marketplace & IX
- Administration
- Billing
- Troubleshooting & FAQ
- Technical Reference
- Partners Portal
- API & Automation
Provision a Marketplace Connection Request via the API
Before you begin
Ensure you have a bearer token authorizing all your API calls. For information on authorizing calls, see one of the following pages:
- Using Postman with the PacketFabric API
- Using cURL with the PacketFabric API
- Using Python Requests with the PacketFabric API
API reference
Parameters and attributes
To provision a marketplace connection, you will need the following information:
- Header row
- Parameter
- Required
- Description
- Row 1
vc_request_uuid
string- Yes (parameter)
- The ID of the connection request. You can get the request ID from
https://api.packetfabric.com/v2/services/requests
.
- Row 1
interface
object- Yes
- Specify the A and Z sides of the connection. (See below)
- Row 1
description
string- No
- Brief description of the connection.
Interfaces
Enter the following information about the port on which you want the connection to land.
- Header row
- Parameter
- Required
- Description
- Row 1
port_circuit_id
string- Yes
- The circuit ID of the port you want to accept and provision the connection on. You can find this in the portal or you can use
https://api.packetfabric.com/v2/ports
to get a list of your ports.
- Row 1
vlan
string- Yes, unless untagged
- Valid VLAN range is from 4-4094, inclusive. You must provide a VLAN unless
untagged
is set to true.
- Row 1
svlan
string- Maybe
- Valid S-VLAN range is from 4-4094, inclusive. This is only applicable to virtual circuits provisioned on ENNI ports.
- Row 1
untagged
boolean- No
- Whether or not the interface should be untagged. The default is false. For information on untagged VLAN scenarios, see VLAN Tagging.
Get request information
Use the following GET call to find information about incoming connection requests:
https://api-beta.dev.packetfabric.net/v2/services/requests?type=received
The response should look similar to the following. You will want to note the vc_request_uuid
and market
:
[
{
"vc_request_uuid": "1b074b22-0a81-4189-a05c-12bdbd964728",
"from_customer": {
"customer_uuid": "9972df99-3a8e-44f0-87e1-51a3005d913b",
"name": "Evil KB Docs",
"market": "NYC",
"market_description": "New York City",
"contact_first_name": "Caitlin",
"contact_last_name": "McGoodwriter",
"contact_email": "caitlin@packetfabric.com",
"contact_phone": "1234567890"
},
"to_customer": {
"customer_uuid": "5ea91f45-4325-4503-8d7d-1eb5f075be97",
"name": "Knowledge Base Documents",
"market": "CHI",
"market_description": "Chicago"
},
"text": "Evil KB Docs is requesting an EVPL connection in CHI.",
"status": "pending",
"vc_mode": "evpl",
"request_type": "marketplace",
"bandwidth": {
"account_uuid": "b2af000f-d15f-4413-9645-6f566e641c29",
"longhaul_type": "dedicated",
"subscription_term": 1,
"speed": "50Mbps"
},
"time_created": "2022-07-06T11:17:03.623071-0600",
"time_updated": "2022-07-06T11:17:03.623071-0600",
"allow_untagged_z": true
}
]
Get port circuit ID
You will need a circuit ID for the port on which you will provision the connection. You can filter the port list for the market that the user requested.
In the example above, the user requested a connection in the Chicago market, so you could use the following GET call to view all your port options in Chicago:
https://api.packetfabric.com/v2/ports?q=CHI
From the response, note the port_circuit_id
you want to use.
Provision the connection
Postman
-
Open Postman and click the plus icon to add a new request.
-
Select POST from the drop-down menu that appears before the URL field.
-
Enter the following API call into the URL field. Replace
{vc_request_uuid}
with the appropriate string (see above):https://api.packetfabric.com/v2/services/requests/{vc_request_uuid}/provision
-
Select the Body subtab and then select raw. Select JSON from the drop-down menu (see below for an example that you can copy and paste):
-
In the space below, set your parameters. For example (include the curly brackets):
-
Click Send.
If successful, the API will respond with details about the new virtual circuit.
JSON sample
Here is a JSON sample for you to copy and then modify accordingly:
{
"interface": {
"port_circuit_id": "PF-AP-CHI-2596504",
"vlan": 95,
"untagged": false
},
"description": "Marketplace connection to Evil KB docs"
}
cURL
Replace {vc_request_uuid}
with the appropriate string (see above):
curl -X POST `https://api.packetfabric.com/v2/services/requests/{vc_request_uuid}/provision` -d @api.json -H "accept: */*" -H "Authorization: Bearer replace_with_api_key"
With the contents of api.json
similar to the following (modified to include your information):
{
"interface": {
"port_circuit_id": "PF-AP-CHI-2596504",
"vlan": 95,
"untagged": false
},
"description": "Marketplace connection to Evil KB docs"
}
Requests
import requests
api_key = 'replace_with_api_key'
request_header = {
'Authorization': f'Bearer {api_key}'
}
# Replace {vc_request_uuid} with the string you obtained earlier
post_url = 'placeholder_api.packetfabric.com/v2/services/requests/{vc_request_uuid}/provision'
post_json = {
"interface": {
"port_circuit_id": "PF-AP-CHI-2596504",
"vlan": 95,
"untagged": false
},
"description": "Marketplace connection to Evil KB docs"
}
api = requests.post(post_url, json=post_json, headers=request_header)
print(api)
Updated on 10 Jul 2022