integration-service
latest
false
UiPath logo, featuring letters U and I in white

Integration Service user guide

Automation CloudAutomation Cloud Public SectorAutomation Suite
Last updated Feb 6, 2025

Example C: Build a connector from an API specification with OAuth 2.0 Client credentials authentication

In the following example, we build a connector for USPS from existing API documentation, using OAuth 2.0 Client credentials authentication.

Importing from an API documentation

With this approach, you can easily import as many resources as included in the API reference. Connector Builder allows you to upload existing API documentation in JSON or YAML format, or through Swagger or Postman.

In the following example we are building a connector for USPS Address Validation/Normalization API. Unlike for Examples A and B, now we:

  • Download the API reference from the USPS website.
  • Use OAuth 2.0 Client Credentials authentication.

Download the API reference

  1. Sign up on USPS Developer Portal (https://developer.usps.com/) and navigate to the API Catalog.
  2. Download the API reference you want to build the connector for. For example: addresses 3.0.

The USPS Addresses 3.0 API

Import the API reference into Connector Builder

  1. Upload the API reference into Connector Builder.

    Uploading the API reference as a .yaml file

  2. After you select Create, you can see all the resources available in the definition you uploaded: GET/addresses, GET/city-state, GET/zipcode.

    All the resources available in the API definition

Configure the authentication

Next, you must configure the authentication. To use OAuth 2.0 Client Credentials you must create an OAuth 2.0 application in the USPS Developer Portal. For details, refer to the Getting started guide.

  1. In the USPS Developer Portal, navigate to Apps and select Add app.
  2. Configure the application. Once you create it, copy the Consumer Key and Consumer Secret credentials. These correspond to the Client ID and Client Secret fields.

    Configuring an application USPS Dev portal

  3. Back in Connector Builder, set the Authentication type to OAuth 2.0 Client Credentials.
  4. Configure the following credentials:
    1. Client ID: <your Consumer Key>
    2. Client Secret: <your Consumer Secret>
    3. Scope: addresses
    4. Token URL: https://api.usps.com/oauth2/v3/token
  5. Test your connector. Select Send Request to test the created API resources and provide the input parameters as follows:


    A GET/city-state request

  • Importing from an API documentation
  • Download the API reference
  • Import the API reference into Connector Builder
  • Configure the authentication

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2025 UiPath. All rights reserved.