Company lookup
Method company_lookup is used for searching companies Maventa knows.
Return value(s)
This method returns an array that contains return string and an array of CompanyLookupOut hash tables.
Authentication
This method requires that you have registered to Maventa and received the API key.
Arguments
api_keys(required)- Search string (required)
Example code
1 require 'soap/wsdlDriver'
2
3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
4
5 begin
6 api_keys = Hash.new
7 api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
8 api_keys[:user_api_key] = "" # Put here your API key
9
10 # Search companies
11 results = serv.company_lookup(api_keys, "Search string")
12
13 # Iterate through result set
14 if results[0] == "OK"
15 results[1].each do |result|
16 # Name
17 puts result.name
18 # Maventa ID
19 puts result.maventa_id
20 # Business ID, VAT
21 puts result.bid
22 # Address line 1
23 puts result.address1
24 # Address line 2
25 puts result.address2
26 # Post code
27 puts result.post_code
28 # Post office
29 puts result.post_office
30 # State
31 puts result.state
32 # Country
33 puts result.country
34 # EDI-code (OVT)
35 puts result.ovt
36 end
37 end
38 end