class DnB::Direct::Plus::Content

Public Class Methods

plus_executives(params = {}) click to toggle source

Converts the object into textual markup given a specific `format` (defaults to `:html`)

Parameters:

format

A Symbol declaring the format to convert the object to. This can be `:text` or `:html`.

Returns:

A string representing the object in a specified format.

# File lib/dnb/direct/plus/content.rb, line 32
def self.plus_executives(params = {})
    response = DnB::Direct::Plus.connection.get do |req|
        req.url "/v1/data/duns/#{params[:duns]}?productId=cmpelk&versionId=v1"
        req.headers[:authorization] = "Bearer #{DnB::Direct::Plus.api_token}"
    end

    JSON.parse(response.body)
end
profile_with_linkage(params = {}) click to toggle source

This service is the most efficient way to gain basic marketing information about an existing customer or potential prospect such as business name, address, D&B® D-U-N-S® Number, phone and trade style. Includes business intelligence such as senior executive name, activities, sales, number of employees and owners.

# File lib/dnb/direct/plus/content.rb, line 7
def self.profile_with_linkage(params = {})
    start = Time.now
    puts "== Started profile_with_linkage at #{start}" if $LOG_DNB
    response = DnB::Direct::Plus.connection.get do |req|
        req.url "/v1/data/duns/#{params[:duns]}?productId=cmplnk&versionId=v1"
        req.headers[:authorization] = "Bearer #{DnB::Direct::Plus.api_token}"
    end
    puts "== Completed in #{Time.now - start}s" if $LOG_DNB
    org = DnB::Direct::Plus::Mappings::Organization.extract_single(response.body, :read)
    org.payload = response.body if !org.nil? && org.respond_to?(:payload)
    org
end