Product Data Exchange Receiver

The Product Data Exchange Receiver option is only available in IIEPs. STEP receives data from the Product Data Exchange (PDX) platform via the default PDX Inbound Integration Endpoint and the API.

For additional information on PDX, refer to the Product Data Exchange topic within the Data Integration documentation, or contact Stibo Systems.

Prerequisites

Changes to the properties file, outlined below, are implemented when the server is restarted.

  1. Provide a selection for the Server URL parameter (image shown in the Configuration section) via the sharedconfig.properties file on the STEP application server using the case-sensitive PDS.Url property.

    PDS.Url=1=https://api.pds.stibosystems.com 
  1. Determine authentication method.

  2. Perform additional configuration required in the IIEP as described in the PDX Inbound Integration Endpoint Configuration topic.

Configuration

After completing the prerequisite steps, edit the receiver of the IIEP. Use the following parameters to configure the IIEP. For information on a parameter, hover over the parameter field to display help text.

  1. For the Receiver parameter, choose Product Data Exchange.

  2. For the Server URL parameter, select the URL from the dropdown.

  3. For the Proxy Config parameter, select the desired HTTP proxy configuration if the delivery connection must first pass through a proxy server with its own login requirement.

    Note: For more information regarding HTTP proxy configurations, refer to the HTTP Proxy Configurations topic in the Data Exchange documentation.

  4. For API access via user name and password, complete the Basic Authentication section:

    • API User Name parameter, type the user name with access to the API.

    • For the API Password parameter, type the password for the user name with access to the API.

  5. For token access via OAuth 2.0 authorization protocol, complete the Token-based Authentication section:

    • Auth Header Value Function - Select a business function that produces the required authentication headers. For general information about business functions, refer to the Business Functions topic in the Business Rules documentation. For examples with or without using a proxy, refer to the Token-based Authentication Function Example section below.

  6. Click the Next button to continue with the IIEP - Configure Endpoint and subsequent steps.

Token-based Authentication Function Example

Use the steps below to create an example business function for token-based authentication with or without using a proxy.

  1. In PDX, go to Manage team / User management / API keys and generate a key. Refer to PDX Help Center / Documentation for more information.

    Important: Existing PDX integrations moving to OAuth must not enter a source system ID when creating keys (which causes duplication of attribution created in the previous integration setup).

  2. In STEP, create a JavaScript Function with:

    • Bind for secret (add variable name; Binds to = Secret; Parameter = ClientSecret (generated via PDX 'API keys' option)

    • Return Type = 'Map<String,String>'

    • JavaScript = example code below

  3. Make necessary updates in the JavaScript for your system:

    • YourClientID = 'ID' of the generated API key

    • Verify the URL variable is aligned with the appropriate PDX environment (QA or PROD)

    • To use a proxy, uncomment the 'Proxied token request' section and modify as required

    • Add your secret Bind variable (pdxSecret is used in this example)

  4. Test your integration.

Copy
logger.info("================== PDX Auth has been called ==================");
var clientID = "YourClientID";
var url = new java.net.URL("https://auth.pdx.stibosystems.com/auth/realms/pds/protocol/openid-connect/token");
 
/// Proxied token request
//var proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, new java.net.InetSocketAddress(java.net.InetAddress.getByName("proxy.host.name"), proxyPortNumber));
//var http = url.openConnection(proxy);
 
// non proxied token request
var http = url.openConnection();
 
http.setRequestMethod("POST");
http.setDoOutput(true);
http.setRequestProperty("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
http.connect();
var os = http.getOutputStream()
try {
       os.write(new java.lang.String("grant_type=client_credentials&client_id="+clientID+"&client_secret="+pdxSecret).getBytes());
} finally {
   os.close();
}
var input= http.getInputStream();
try {
   var reader = new java.io.BufferedReader(new java.io.InputStreamReader(input));
   var string ="";
   while (reader.ready()){       
      string=string+reader.readLine();
   }
   var json = JSON.parse(string)
   var map = new java.util.HashMap();
   map.put("Authorization",json.token_type + " " + json.access_token);
   logger.info("Authorization "+json.token_type + " " + json.access_token);
     return map;
} finally {
   reader.close();