title: Assign Related Product In Magento 2 API
body: <p>I am using magento 2 api for assigning product link like <strong>related</strong> or <strong>crosssell</strong> 
  using api <em>/V1/products/{sku}/links</em></p>
  
  <p>Here is My Sample Code </p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
  define('mag_apiurl',"http://www.mywebsite.com/rest/V1/");
  define('tn_webshopKey',"myshowpkey");
  $sku1 = "sku1";
  $sku2 = "sku2";
  $productData = array(
          "items" =&gt;  array(
                "sku" =&gt; $sku1,
                "linkType" =&gt; 'related',
                "linkedProductSku" =&gt; $sku2,
                "linkedProductType" =&gt; "simple",
                "position" =&gt; 0
          )
      );
  
      $headers = array("Content-Type:application/json","Authorization: Bearer ".tn_webshopKey);
      $requestUrl= mag_apiurl.'products/'.$sku1.'/links';
      $ch = curl_init($requestUrl);
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
      curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($productData));
      curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      echo $returnProductDetails = curl_exec($ch);
  ?&gt;
  </code></pre>
  
  <p>But Every time i run the script its 
  response </p>
  
  <pre><code>{"message":"%fieldName is required filed.","parameters":{"fieldName":"linkType"}}
  </code></pre>
  
  <p>But the link type 'related' is already defined in my data (productData)</p>
  
  <p>Does anyone knows the solution or related link which helps :)</p>