Exercise - Create a new connector in a solution

Completed

In this exercise, you will create your first custom connector for an existing API called Contoso Invoicing.

Important

Use a test environment with Microsoft Dataverse provisioned. If you don't have a test environment, you can sign up for the Power Apps Community Plan.

Task 1: Review the API

To review the API, follow these steps:

  1. Go to Contoso Invoicing.

  2. Select the documentations link.

    An arrow pointing to the API documentation link - screenshot.

  3. Review the available operations.

  4. Select to expand and review each operation.

  5. Close the documentation browser tab or window.

  6. Select the Open API definition link.

  7. The following image shows an example of the Open API version of what was shown on the documentations page. Right-click and select Save as.

    An arrow pointing to the save as button - screenshot.

  8. Save the file locally. You will use this file later in the exercise.

  9. Close the definition browser tab or window.

  10. Select the API Key link.

  11. Copy and save your API key because you will need it later.

    API key for Contoso invoicing - screenshot.

  12. Select Return to home.

  13. Select Download Logo.

  14. Save the logo image locally; you will use it later.

Task 2: Create a new solution

To create a new solution, follow these steps:

  1. Go to Power Apps maker portal and make sure that you are in the correct environment.

  2. Select Solutions > + New solution.

  3. Enter Contoso invoicing for the Display name, select CDS Default Publisher for Publisher, and then select Create. When you are working with a real project, it's best to create your own publisher.

    Create new Contoso Invoicing solution - screenshot.

  4. Do not navigate away from this page after selecting Create.

Task 3: Create a new connector

To create a new connector, follow these steps:

  1. Select to open the Contoso invoicing solution that you created.

  2. Select + New > Other > Custom connector.

    An arrow pointing to create new custom connection - screenshot.

  3. Enter Contoso invoicing for the Connector name and then select to Upload the image.

    An arrow pointing to the upload icon image button - screenshot.

  4. Select the connector logo image that you downloaded in Task 1: Review the API.

  5. Enter #175497 for Icon background color.

  6. Enter Contoso Invoicing API for Description.

  7. Enter contosoinvoicingtest.azurewebsites.net for Host.

  8. Select Create connector.

    An arrow pointing to the create connector button - screenshot.

  9. Do not navigate away from this page.

Task 4: Import the Open API definition

To import the Open API definition, follow these steps:

  1. Select the arrow next to Connector Name.

    An arrow pointing to the back button - screenshot.

  2. Select the ellipsis (...) button of the connector and then select Update from OpenAPI file.

    An arrow pointing to the Update from open API file button - screenshot.

  3. Select Import.

  4. Select the swagger.json file that you downloaded in Task 1: Review the API and then select Open.

  5. Select Continue.

  6. Fill in the host URL as contosoinvoicingtest.azurewebsites.net and then select Security.

    An arrow pointing to the Security tab - screenshot.

  7. Notice that the field is filled out from the imported file.

  8. Do not navigate away from this page.

Task 5: Review and adjust definitions

To review and adjust definitions, follow these steps:

  1. Select the Definition tab.

  2. Take a few minutes to review the operations that were imported.

  3. Notice the orange triangle next to GetInvoice that indicates a warning.

  4. Select the GetInvoice operation.

    An arrow pointing to the get invoice action - screenshot.

  5. Notice that the operation indicates a missing Summary.

  6. Enter Get Invoice as the Summary to improve the usability.

    Get invoice action summary - screenshot.

  7. Notice the blue information circle on the PayInvoice operation and that it indicates a missing Description.

  8. Enter Pay an invoice as the Description.

  9. Delete both NewInvoice operations because you won't use them.

    An arrow pointing to the Delete button - screenshot.

  10. Select the GetInvoiceSchema operation.

  11. Modify the Visibility option to internal so that people don't see it in their action list.

  12. Select Update connector.

    An arrow pointing to the Update connector button - screenshot.

  13. Do not navigate away from this page.

Task 6: Test the connector

To test the connector, follow these steps:

  1. Select the Test tab.

  2. Select + New connection.

    An arrow pointing to the New connection button - screenshot.

  3. Paste in the API Key that you saved in Task 1: Review the API and then select Create connection.

  4. Select the Refresh button.

    An arrow pointing to the Refresh button - screenshot.

  5. Select ListInvoice > Test Operation.

    An arrow pointing to the Test operation button - screenshot

You should see some invoice data in the body area.