Any formal reporting organization (including corporations, NGOs, Universities, etc.) represented as a company on Wikirate.
This example assumes you have configured your Wikirate REST client
. Instructions on how to configure a client can be
found in examples/Configurations.md
WikiRate's REST API allows you not only to create new companies but also to update existing ones. wikirate4ruby provides
the method update_company
to allow users updating existing companies. The method takes as an input a number of
parameters on a Hash
object and the users need to define the company and the fields they want to update.
required params:
- company: wikirate company name or identifier
optional params:
- headquarters: the region/country the headquarters of the company are located. All the available wikirate Regions can be found here.
- open_corporates: company's open corporates identifier
- wikipedia: company's page name on wikipedia
- sec_cik: company's central index key as assigned by US Securities and Exchange Commission (SEC)
- os_id: company's open supply hub identifier
In the example below, we are updating Nike Inc. headquarters location.
nike = client.add_company({ 'company' => 'Nike Inc.',
'headquarters' => 'Oregon (United States)' })
Instead of the company name we can use the company's identifier when performing updates:
nike = client.add_company({ 'company' => 5800,
'headquarters' => 'Oregon (United States)' })