title: TFS2018 path to api
body: <p>I have a TFS2018 setup on a server and I am trying to figure out what is the path to the api. Should the path look look like this? Do I have to enable the API on the server?</p>
  
  <pre><code>https://myserver/tfs/DefaultCollection/MyProject/_apis
  </code></pre>
  
  <p>If I run this in code like this</p>
  
  <pre><code>var cred = new VssCredentials(
                          new WindowsCredential(new NetworkCredential("username", "Pass")));
  var buildClient = new BuildHttpClient(new Uri("https://myserver/tfs/DefaultCollection/MyProject/_apis", UriKind.Absolute), cred);                       
  await buildClient.CreateDefinitionAsync(buildDef);
  </code></pre>
  
  <p>I get the following error</p>
  
  <blockquote>
    <p>Web method running:
    [<a href="https://myserver/tfs/DefaultCollection/MyProject/_apis]" rel="nofollow noreferrer">https://myserver/tfs/DefaultCollection/MyProject/_apis]</a>
    (OPTIONS)_apis[]</p>
  </blockquote>