Suppose we want to get company profile or verify a company address based on a DUNS number.
Prerequisites for the Dun and Bradstreet API integration are:
1. User token and password from Dun & Bradstreet
2. Authorization token to connect to the API
First we will create the connection to D&B API for getting standard company profile.The REST API for this is:
GET https://maxcvservices.dnb.com/V{version}/organizations/{DUNS}/products/{productID}
OrderProduct is one of many operations or products that are support by Dun & Bradstreet API please refer to this link for more information.
http://developer.dnb.com/docs/2.0/firmographic/3.2
Step 1.
In Adeptia Suite go to Develop > Services > Web Services > Consumer and create the following RESTful API connection as shown below.
Notice that in the Parameter field I have added the Authorization token. Refer below on how to get the token.
In the URL field I have provided a template URL value as https://maxcvservices.dnb.com/version/organizations/DUNS/products/productID
Since we will be providing the actual dynamic URL at run time in the process flow we can provide a template value and save the activity.
Step 2.
Open up the process designer and create a flow as shown below.
First activity is a put-context-var action that contains the actual REST URL as shown below.
https://maxcvservices.dnb.com/V3.2/organizations/804735132/products/DCP_STD
Context target will hold the JSON response. You can also convert the JSON into XML. Refer to the support forum post on JSON for more information.
If XML is needed then put the JSONtoXML custom plugin after the Web Service activity and then map the output data stream of the custom plugin to the target activity which will consume the data. Use multiple stream option in the custom plugin and give the data stream name as default and map to the target activity
Attached is the sample JSON response based on the actual REST API URL i the put-context-var.
To get the Authorization token you can call the REST API URL first:
https://maxcvservices.dnb.com/rest/Authentication
Pass the User token and the Password in the header and you will get the Authorization token which needs to be passed in the above REST call to get the Company profile. Refer to this link to get more help on how to get the credentials http://developer.dnb.com/docs/2.0/guides/DnBDirect2-Ordering-Reports.pdf
Comments
0 comments
Article is closed for comments.