Note that while Centercode’s integration features are intended to be approachable by a Customer Validation Professional, you might need to enlist help from an internal technical resource and refer to our vocabulary and troubleshooting documentation.

In this guide, we’ll be using a Webhook with External Data integration to run a cursory check on potential testers via https://api.trade.gov. Then, we’ll record the lookup results to take informed action.

In this example, we’ll be sending users’ names to trade.gov to identify any matches, indicating potential involvement in export infractions by the Department of Commerce, State, and the Treasury. The principles included in this guide apply to triggering a Feedback or User Webhook Macro within Centercode to any API-capable endpoint. 

In this guide, you will:

  1. Create an (or identify an existing) API Key in Centercode
  2. Register for an API Key at api.trade.gov
  3. Create a GET Webhook Request with External Data in Centercode

In order to configure both sides of this integration, you will need:

  1. Access to an existing API Key or Community Manager access to create a new one
  2. Project Manager access in the project of your choice (or your project template)

-

Preparing to Send Data to Your External System

1.   Creating an API Key

From the Centercode side, the first step in any API integration is to ensure that you have an API Key available within your Centercode Community. While this integration doesn’t use an API key, your integration features won’t be visible unless one is available.

If necessary, create a Community API Key by following steps outlined here.
-

2.  Generate Your Third-Party’s API Key

You may need to utilize an API Key generated by the third party system that’s specific to your account. Some services may provide your specific API Key and authentication in their provided API Endpoint URL. In this example, trade.gov provides your account with a unique API key once you've registered. 

To get started at api.trade.gov:

  1. Register for an account to receive an API Key
  2. Click Get an API Key in the left-hand menu

-

3.  Creating a Webhook Macro

Macros allow you to create a single instruction that includes a set of actions to complete a desired task.  In this example, we’re creating a User Macro with a Webhook to send names to trade.gov, then capturing the return values.

From the Community or Project Homepage:

  1. Click Users in the left-hand menu
  2. Click User Resources
  3. Click the Create a New Macro button
  4. Enable the Trigger Webhooks option
  5. Click Web Request and select GET
  6. Enter api.trade.gov’s API Endpoint into the Web Request text field
    https://api.trade.gov/consolidated_screening_list/search?api_key={your key}&q={term}
  7. Add the necessary authentication Headers (discussed below)
  8. Enable and configure the Capture Return Values options (discussed below)
  9. Click Show in User Management Actions
  10. Click Submit

You’ve just created your Webhook Macro to check trade.gov for results!
-

Headers for Authentication

Headers allow you to define additional static values sent with each request. Not all API calls require headers to be defined. A common use for headers it to provide authorization for your Webhook by adding your access key to your header and specify how you want returned values to be formatted.

Authorization Header example:
Authorization: 2nt6cs2EuPbF4keBBV7brZlP

Return value formatting example:
Content-Type: application/json
-

Capturing Return Values

Note that you can find more information on the definitions of these fields and options in our Integration Terms and Troubleshooting documentation. For this integration, the italicized text is used.

  • Create a new Data Group Label or select a pre-existing group
    eg. Blacklist
  • Label the data fields you're expected to receive and store
    eg. Blacklisted
  • Use Parameter to identify the data received in the response from the lookup
    eg. total
  • For each incoming data point, set it's correct Type to properly classify it
    eg. Integer
  • Mark the incoming data field as a Favorite to display it on the user’s Summary or feedback ticket

-

Using Your Data to Your External System

Once your Webhook Macro is configured, you may use it to send user data to your external system to capture return data. In this example, we’ll send user’s names to trade.gov to capture any matches.

4. Using Your Webhook

Now that you’ve created your Webhook Macro, it’s time to decide how you’d like it applied to your Feedback tickets within Centercode. Like any Macro within Centercode, you can trigger your macro manually on individuals or in bulk, as a Notice (Click here), or automatically on a scheduled cadence (Click here). 

Bulk Manual Trigger
In addition to running your Macro on a single user account, you also have the option to apply your Macro on users who match Filter criteria as an Action. 

To trigger manually, start at the Community or Project Homepage:

  1. Click Users in the left-hand menu
  2. Create a Filter to target specific segments of users if desired
  3. Under Action, select your new Webhook Macro
  4. Click Perform Action

You’ve just sent your data to your third-party system and captured return data!
-

5. Reviewing Your Webhook Results

The External Data returned from your third-party system extends the reach of your Centercode Data engine. These results can be leveraged in Reporting, User or Feedback Management, and user’s summary or feedback ticket.

Creating an External Data View

Viewing External Data in User Management

Viewing External Data in a User Summary

-

Troubleshooting your Webhook

If you find that your Webhook failed or that data isn’t updated as expect, you’ll want to review the Webhook’s logs to troubleshoot any issues. 

From User Management:

  1. Click User Resources
  2. Hover over your Macro and click Macro Webhook Log
  3. Hover over a username and click Macro Webhook Log

-

Status codes are covered in this article:
Understanding Integration Terms & Troubleshooting
-

Notes

  • trade.gov's API documentation can be found here

Related Articles

Understanding Integration Terms & Troubleshooting
What are Notices and when can I use them?
Updating Centercode Feedback via External Tracking Systems
Creating Your Community-Level API Key
Centercode + Jira Integration Guide
Centercode Guide to Simple Webhooks
Centercode Guide to Simple External Listeners
Centercode Guide to Simple External Feedback
Centercode Guide to Simple Data Packages
Centercode Guide to Simple External Users
Centercode Guide to Simple Record Lookup 

Did this answer your question?