Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 2.25 KB

Update Research Metric Answer.md

File metadata and controls

47 lines (33 loc) · 2.25 KB

Add Research Metric Answer

Wikirate platform helps users to find/research answers on specific questions/metrics about companies. Thus, each answer is described by the question/metric, company, value, year and source.

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 to update existing answers. wikirate4ruby provides the method update_research_metric_answer to allow users to import answers on metrics. The method takes as an input a number of parameters where all the information about the existing answer is defined. The parameters can be split into required and optional.

required params:

  • metric_designer: the designer of the metric we want to add the answer to
  • metric_name: the metric name/title of the metric we want to add the answer to
  • company: the company name/id the answer is referred to
  • year: the year the answer is referred to

or

  • answer_id: the user can define directly the id of the answer, they want to update, instead of the aformentioned paramaters

optional params:

  • discussion: any comments we might have on the answer
  • value: the value/answer to the question
  • source: wikirate's source name of the source we found the answer

The example below demonstrates the update of an existing answer. Note that, if the answer does not exist if all the required parameters have been defined a new answer will be created (from the example below the source is missing for creating a new answer if that answer does not exist)

updated_answer = client.update_research_metric_answer({ 'metric_designer' => 'Walk Free',
                                                        'metric_name' => 'MSA Whistleblowing mechanism',
                                                        'company' => 'AIB Group plc',
                                                        'year' => 2017,
                                                        'value' => 'Supply Chain Workers' })