How to Authenticate with D&B Direct API Web Service

Step 1: First you have to create an account in D&B using this online form http://developer.dnb.com/register-v2 and get your Username and Password.

Step 2: You can get connected with D&B direct api via SOAP and REST api.

Soap API Call Example:

To get connected with D&B api using soap client call. Follow the below php code.

After hit this code you can company detail request. As i mentioned this api function in soap client request.

Rest API Example:

To get connected with D&B Direct Rest api, You need an authentication Token to access it. First get the New Token using this POST request.

After that you Success result with new auth token. Use token in below Curl code to get data from D&B Direct api.

4 thoughts on “How to Authenticate with D&B Direct API Web Service

  1. Hello,
    I am still working on connecting to the D&B soap api, do you have anything else you can add? I am new to programming and SOAP is harder than I thought.
    Thanks
    Caitlin

    • Hi Caitlin,

      Soap programming for d&b is quite simple. use this soap code to get connected.

      < ?php $opts = array( 'http'=>array(
      ‘method’=>’GET’,
      ‘ignore_errors’ => true,
      ‘header’=>”API-KEY:****Use API Key Here*****\r\nusername:***Username**\r\npassword:***Password**”,
      )
      );
      $fp = fopen(‘http://dnbdirect-api.dnb.com/DnBAPI-15/rest/company/060704780’, ‘rb’, false, stream_context_create($opts));
      $response = stream_get_contents($fp);
      print $response;
      ?>

  2. no one code is working for me, how i get API-KEY. I have only username and password.
    And what is the website url where i have check given username and password given by client.

Leave a Comment