title: C# call global action in MS Dynamics CRM
body: <p>I have Global action in CRM. It have one input string parameter. 
  This is call for sending request</p>
  
  <pre><code>obj.CallActivity("this is parameter string","MyActionName")
  </code></pre>
  
  <p>and my method <em>CallActivity</em> looks like this</p>
  
  <pre><code>public async Task&lt;bool&gt; CallActivity(string record, string Activity)
          {
             try
              {
  
                  HttpRequestMessage requestMessage = null;
                  requestMessage = new HttpRequestMessage(HttpMethod.Post, App.ResourceUri + "/api/data/v8.2/" + Activity); //uri to activity
                  requestMessage.Content =new StringContent(record); 
                  requestMessage.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
                  //Send the HttpRequest
                  Task&lt;HttpResponseMessage&gt; response = httpClient.SendAsync(requestMessage);
                    response.Wait();
                  //If the response is Successfully executed then it will return the value true
                  if (response.Result.IsSuccessStatusCode)
                  {
                      return true;
                  }
                  else
                  {
                      return false;
                  }
              }
              catch (Exception error)
              {
  
                  return false;
              }
          }
  </code></pre>
  
  <p>When the executing the request, I get the message:</p>
  
  <blockquote>
    <p>StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:</p>
  </blockquote>
  
  <p>Where I am making mistakes?</p>