Once the company reference is obtained (this is the "ref" parameter returned with the results of the previous search, it is possible to retrieve all the details of the company via a second call. To do this, simply call the "infos" method of our "b2b" object.
Example:
b2b.infos(ref, 'callback2');
It will also be necessary to provide the name of a callback function in JavaScript that will be responsible for processing the information returned for this company.
Implementation example of the callback function that will display company information:
function callback2(data) {
var html = '<table>';
for (var key in data) {
if (!data.hasOwnProperty(key)) continue;
html += '<tr><td>' + key + '</td><td>' + data[key] + '</td></tr>';
}
html += '</table>';
$("#id_company_info").html(html);
}