title: 'Resource me does not exist' API error while calling /v2/me
body: <p>I receive the error "Resource me does not exist" when I tried to call the URL GET: /v2/me.</p>
  
  <p>GET: <a href="https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture)" rel="nofollow noreferrer">https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture)</a></p>
  
  <p>Token received from: <a href="https://www.linkedin.com/oauth/v2/accessToken" rel="nofollow noreferrer">https://www.linkedin.com/oauth/v2/accessToken</a></p>
  
  <p>Authorization URL:</p>
  
  <pre><code>$url = 'https://www.linkedin.com/oauth/v2/authorization'
          .'?response_type=code'
          .'&amp;client_id='."77uuvjhz11mi71"
          .'&amp;redirect_uri='."http://localhost/linkedin"
          .'&amp;state=123123123'
          .'&amp;scope=r_liteprofile%20r_emailaddress%20w_member_social';
  </code></pre>
  
  <p>Request:</p>
  
  <pre><code>...
  $linkedin-&gt;getAccessToken($_GET['code']);
  ...
  $this-&gt;setMethod("GET");
  $this-&gt;setUrl("https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture)");
  $this-&gt;setHeaders([
      "Authorization: Bearer ".$this-&gt;accessToken,
  ]);
  $resp = $this-&gt;sendRequest();
  </code></pre>
  
  <p>Response:</p>
  
  <pre><code>{#81 ▼
    +"serviceErrorCode": 0
    +"message": "Resource me does not exist"
    +"status": 404
  }
  </code></pre>
  
  <p>The API functions:</p>
  
  <pre><code>public function __construct()
  {
      $this-&gt;ch = curl_init();
  }
  public function sendRequest()
  {
      curl_setopt_array($this-&gt;ch, $this-&gt;options);
      $result = curl_exec($this-&gt;ch);
  
      if (curl_errno($this-&gt;ch)) {
          throw new Exception("Error ". curl_error($this-&gt;ch), 1);
      }
  
      $json = json_decode($result);
  
      return $json;
  }
  public function setMethod(String $method)
  {
      $method = strtoupper($method);
  
      if ($method === "POST") {
          $this-&gt;options[CURLOPT_POST] = true;
      }
  
      return $this;
  }
  public function setUrl(String $url)
  {
      $this-&gt;options[CURLOPT_URL] = $url;
  
      return $this;
  }
  public function setHeaders(Iterable $headers)
  {
      $this-&gt;options[CURLOPT_HTTPHEADER] = $headers;
  
      return $this;
  }
  public function getAccessToken($code)
  {
      $this-&gt;setMethod("POST");
      $this-&gt;setUrl("https://www.linkedin.com/oauth/v2/accessToken");
      $this-&gt;setPostFields([
              "grant_type" =&gt; "authorization_code",
              "code" =&gt; $code,
              "redirect_uri" =&gt; "http://localhost/test",
              "client_id" =&gt; $this-&gt;clientId,
              "client_secret" =&gt; $this-&gt;clientSecret,
      ]);
      $resp = $this-&gt;sendRequest();
      $this-&gt;accessToken = $resp-&gt;access_token;
  }
  </code></pre>