You must be a Company Admin to create and manage forms via the API.
Use cases
These API endpoints help service providers automate form management for their Megaport Marketplace services. Common use cases include:- Creating custom forms to collect specific onboarding information from customers.
- Linking forms to services so customers can complete them when requesting connections.
- Retrieving submitted form data for processing connection requests.
- Integrating form data into your provisioning workflows.
Prerequisites
- You must have a Megaport Marketplace profile. For more information, see Creating a Megaport Marketplace Profile.
- You must be a Company Admin to create and manage forms.
Managing form definitions
Form definitions define the structure and fields of forms that customers complete. Each form can contain multiple fields of different types.Supported field types
Form field structure and validation are defined in JSON. These field types are supported in form definitions:
An example for adding an email:
Creating a form
To create a new form definition, send a POST request to the forms endpoint with the form structure. After the form is created, it is set to the Active status by default and can be linked to your services. Endpoint
Example Request
Listing forms
To retrieve all form definitions for your company, send a GET request to the forms endpoint. Endpoint
Example Request
Retrieving a form
To retrieve a specific form definition, send a GET request with the form UID. Endpoint
Example Request
Updating a form
To update an existing form definition, send a PUT request with the updated fields. Form definitions can be updated after a VXC connection has been requested using the form. Form requirements might change over time, so forms can be updated as required without affecting existing submissions.Form status cannot be updated. To change the form status to Archived, use the delete endpoint. This marks the form as Archive if it has submissions against it or permanently deletes it if there are no submissions. To reactivate an archived form, use the activate endpoint. For more information, see Activating a form and Deleting a form.
Request Body
Include only the fields you want to update. You can update the
name and formStructure fields.
Example Request
Activating a form
To activate an archived or draft form, send a POST request to the activate endpoint. Endpoint
Example Request
Deleting a form
To delete a form definition, send a DELETE request. If the form has service associations, these associations will be removed and the form will be deleted. If the form has linked submissions, it will be archived instead of deleted. Endpoint
Example Request
Linking forms to services
After creating a form definition, link it to your Megaport Marketplace services so customers can complete the form when requesting a connection.Attaching a form to a service
To attach a form to a service, send a POST request to the service forms endpoint. Endpoint
Example Request
Each service can be linked to only one form, but a form can be linked to multiple services.
Listing service-form associations
To list all service-form associations, send a GET request with optional parameter filters. Endpoint
Example Request
Updating a service-form association
To change the form associated with a service, send a PUT request with the UID of the new form. This replaces the form currently associated with the service. Endpoint
Request Body
Example Request
Detaching a form from a service
To remove a form from a service, send a DELETE request. Endpoint
Example Request
Managing form submissions
When customers request a connection to a service with a form configured, they submit the form data. Service providers can retrieve this data to review connection requests.Listing all form submissions
To list all form submissions for your company’s forms, send a GET request to the submissions endpoint. EndpointRetrieving a form submission
To retrieve a specific form submission, send a GET request with the submission UID. Endpoint
Example Request
Listing submissions by form
To retrieve all submissions for a specific form, send a GET request with the form UID. Endpoint
Example Request
Listing submissions by service
To retrieve all submissions for a specific service, send a GET request with the service UID. Endpoint
Example Request
Deleting a form submission
To delete a form submission, send a DELETE request to the submissions endpoint. Endpoint
Example Request