# 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.

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](https://developer.usps.com/addressesv3).

![The USPS Addresses 3.0 API](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-the-usps-addresses-3-0-api-497944-0965fcf8.webp)

### Import the API reference into Connector Builder

1. Upload the API reference into Connector Builder.

   ![Uploading the API reference as a .yaml file](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-uploading-the-api-reference-as-a-yaml-file-497948-2ad5db53.webp)
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](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-all-the-resources-available-in-the-api-definition-497956-af9e3e74.webp)

### 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](https://developer.usps.com/). For details, refer to the [Getting started](https://developer.usps.com/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](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-configuring-an-application-usps-dev-portal-498018-b7dfaa7c.webp)
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](https://dev-assets.cms.uipath.com/assets/images/integration-service/integration-service-a-get-city-state-request-498010-49273b25.webp)
