title: How to place bet via Pinnacle API in C#?
body: <p>How does placing bet request from C# for Pinnacle API looks like?</p>
  
  <p>Could someone help with small example?</p>
  
  <p><a href="http://www.pinnacle.com/en/api/manual" rel="nofollow">http://www.pinnacle.com/en/api/manual</a>  - this is pinnacle api documentation</p>
  
  <p>From that documentation without problems I can get for example all teams with totals and other odds or I can get team names.</p>
  
  <p>Here is code example for getting all odds for some type of sport via C# and pinnacle API:</p>
  
  <pre><code>/// &lt;summary&gt;
      /// This function get events with their totals
      /// &lt;/summary&gt;
      /// &lt;returns&gt;&lt;/returns&gt;
      protected virtual async Task&lt;HttpWebResponse&gt; GetAllTotalsAsync(string userLogin, string userPass)
      {
          var request = (HttpWebRequest)WebRequest.Create("https://api.pinnaclesports.com/v1/odds?sportid=" + (int)_sportType);
          string credentials = $"{userLogin}:{userPass}";
          byte[] bytes = Encoding.UTF8.GetBytes(credentials);
          string base64 = Convert.ToBase64String(bytes);
          string authorization = String.Concat("Basic ", base64);
          request.Headers.Add("Authorization", authorization);
          request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)";
          request.Method = "GET";
          request.Accept = "application/json";
          request.ContentType = "application/json; charset=utf-8";
          return (HttpWebResponse)await request.GetResponseAsync().ConfigureAwait(false);
      }
  </code></pre>
  
  <p>Later from HttpWebResponse we can get JSON output</p>
  
  <p><code>var totalResp = await GetAllTotalsAsync(userLogin, userPass).ConfigureAwait(false);
   var sportEvents = (JsonObject)JsonValue.Load(totalResp.GetResponseStream());</code></p>
  
  <p>Here in sportEvents we have our JSON with all data.</p>
  
  <p>So, can anyone help me with placing some bets via Pinnacle API by using C# laguage???</p>