<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic C# RestSharp library Submit a Form Example in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/287332#M26575</link>
    <description>&lt;P&gt;This is my Code but is not working, Whats could be the problem??&lt;BR /&gt;I´m new in Hubspot integrations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var client = new RestClient("&lt;A href="https://api.hubapi.com/" target="_blank" rel="noopener"&gt;https://api.hubapi.com/&lt;/A&gt;");&lt;BR /&gt;var request = new RestRequest("uploads/form/v2/{PortalId}/{formGuid}", Method.POST);&lt;BR /&gt;request.AddUrlSegment("portalId", "miportalId");&lt;BR /&gt;request.AddUrlSegment("formGuid", "miformGuid");&lt;BR /&gt;request.AddQueryParameter("hapikey", "mihapiKey");&lt;/P&gt;&lt;P&gt;request.AddBody(new&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; properties = new[]&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "firstname", value = firstName ?? string.Empty },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "lastname", value = lastName ?? string.Empty },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "email", value = email },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "lifecyclestage", value = stage },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "company", value = company },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "ubicaci_n", value = stateName },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "centro_de_interes", value = locationName },&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "me_interesa", value = answerInterest },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "puesto", value = answerTitle ?? string.Empty }, // Puesto&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "rea_de_trabajo", value = answerArea ?? string.Empty },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "necesito_un_espacio_para", value = answerSpace ?? string.Empty&amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "dentro_de_cu_nto_tiempo_necesitas_el_espacio_", value = answerTime ?? string.Empty },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "tiempo_aproximado_de_contrato", value = answerTimeStay ?? string.Empty }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;IRestResponse response = client.Execute(request);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i am getting the next response.StatusCode: 0&lt;/P&gt;&lt;P&gt;"StatusCode: 0, Content-Type: , Content-Length: 0)"&lt;/P&gt;&lt;P&gt;Error Exception:&amp;nbsp;{System.PlatformNotSupportedException: Operation is not supported on this platform. at System.Net.SystemWebProxy.GetProxy(Uri destination) at System.Net.ServicePointManager.ProxyAddressIfNecessary(Uri&amp;amp; address, IWebProxy proxy) at System.Net.ServicePointManager.FindServicePoint(Uri address, IWebProxy proxy) at System.Net.HttpWebRequest.get_ServicePoint() at RestSharp.Http.ConfigureWebRequest(String method, Uri url) at RestSharp.Http.PostPutInternal(String method) at RestSharp.Http.AsPost(String httpMethod) at RestSharp.RestClient.DoExecuteAsPost(IHttp http, String method) at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse)}&lt;/P&gt;&lt;P&gt;Error Message: "Operation is not supported on this platform."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Aug 2019 16:16:32 GMT</pubDate>
    <dc:creator>rvaladez</dc:creator>
    <dc:date>2019-08-22T16:16:32Z</dc:date>
    <item>
      <title>C# RestSharp library Submit a Form Example</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/287332#M26575</link>
      <description>&lt;P&gt;This is my Code but is not working, Whats could be the problem??&lt;BR /&gt;I´m new in Hubspot integrations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var client = new RestClient("&lt;A href="https://api.hubapi.com/" target="_blank" rel="noopener"&gt;https://api.hubapi.com/&lt;/A&gt;");&lt;BR /&gt;var request = new RestRequest("uploads/form/v2/{PortalId}/{formGuid}", Method.POST);&lt;BR /&gt;request.AddUrlSegment("portalId", "miportalId");&lt;BR /&gt;request.AddUrlSegment("formGuid", "miformGuid");&lt;BR /&gt;request.AddQueryParameter("hapikey", "mihapiKey");&lt;/P&gt;&lt;P&gt;request.AddBody(new&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; properties = new[]&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "firstname", value = firstName ?? string.Empty },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "lastname", value = lastName ?? string.Empty },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "email", value = email },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "lifecyclestage", value = stage },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "company", value = company },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "ubicaci_n", value = stateName },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "centro_de_interes", value = locationName },&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "me_interesa", value = answerInterest },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "puesto", value = answerTitle ?? string.Empty }, // Puesto&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "rea_de_trabajo", value = answerArea ?? string.Empty },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "necesito_un_espacio_para", value = answerSpace ?? string.Empty&amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "dentro_de_cu_nto_tiempo_necesitas_el_espacio_", value = answerTime ?? string.Empty },&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new { property = "tiempo_aproximado_de_contrato", value = answerTimeStay ?? string.Empty }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;IRestResponse response = client.Execute(request);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i am getting the next response.StatusCode: 0&lt;/P&gt;&lt;P&gt;"StatusCode: 0, Content-Type: , Content-Length: 0)"&lt;/P&gt;&lt;P&gt;Error Exception:&amp;nbsp;{System.PlatformNotSupportedException: Operation is not supported on this platform. at System.Net.SystemWebProxy.GetProxy(Uri destination) at System.Net.ServicePointManager.ProxyAddressIfNecessary(Uri&amp;amp; address, IWebProxy proxy) at System.Net.ServicePointManager.FindServicePoint(Uri address, IWebProxy proxy) at System.Net.HttpWebRequest.get_ServicePoint() at RestSharp.Http.ConfigureWebRequest(String method, Uri url) at RestSharp.Http.PostPutInternal(String method) at RestSharp.Http.AsPost(String httpMethod) at RestSharp.RestClient.DoExecuteAsPost(IHttp http, String method) at RestSharp.RestClient.Execute(IRestRequest request, String httpMethod, Func`3 getResponse)}&lt;/P&gt;&lt;P&gt;Error Message: "Operation is not supported on this platform."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 16:16:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/287332#M26575</guid>
      <dc:creator>rvaladez</dc:creator>
      <dc:date>2019-08-22T16:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: C# RestSharp library Submit a Form Example</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/287734#M26629</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/103238"&gt;@rvaladez&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not as familiar with C# but I did want to point out something that could be causing your error. It looks like you're trying to use the form submission endpoint documented here:&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/methods/forms/submit_form" target="_blank"&gt;https://developers.hubspot.com/docs/methods/forms/submit_form&lt;/A&gt;. And it also looks like you're trying to submit the request to api.hubapi.com . Our form submission endpoints are actually on a different domain. So that form submission URL is on&amp;nbsp;forms.hubspot.com . Does your request work if you change:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var client = new RestClient("https://api.hubapi.com/");
&lt;/PRE&gt;
&lt;P&gt;to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;var client = new RestClient("https://forms.hubspot.com/");&lt;/PRE&gt;
&lt;P&gt;If not, let me know and I can take another look.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 16:48:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/287734#M26629</guid>
      <dc:creator>lscanlan</dc:creator>
      <dc:date>2019-08-23T16:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: C# RestSharp library Submit a Form Example</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/287738#M26630</link>
      <description>&lt;P&gt;I tried the change, I had not noticed that it was another domain, but the result is still the same error.&lt;/P&gt;&lt;P&gt;I appreciate your help&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 17:07:21 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/287738#M26630</guid>
      <dc:creator>rvaladez</dc:creator>
      <dc:date>2019-08-23T17:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: C# RestSharp library Submit a Form Example</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/287816#M26635</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/103238"&gt;@rvaladez&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to understand if this error is getting thrown on our side or if it's something that's happening before it gets to our API. I did a search for that error and a few things come up:&amp;nbsp;&lt;A href="https://www.google.com/search?source=hp&amp;amp;ei=L19gXYCQH6Ln5gKpupuICw&amp;amp;q=C%23+RestSharp+System.PlatformNotSupportedException%3A+Operation+is+not+supported+on+this+platform&amp;amp;oq=C%23+RestSharp+System.PlatformNotSupportedException%3A+Operation+is+not+supported+on+this+platform&amp;amp;gs_l=psy-ab.3...436.23839..24392...0.0..0.99.274.3......0....2j1..gws-wiz.......0.bpwdAJQVbAQ&amp;amp;ved=0ahUKEwjA46qj_JnkAhWis1kKHSndBrEQ4dUDCAc&amp;amp;uact=5" target="_blank" rel="noopener"&gt;link to Google search&lt;/A&gt;&amp;nbsp;. A status code 0 sounds like the request was canceled, and so it never made it to our API, which I would tend to think means something is going wrong before the request gets sent. But if I'm misunderstanding, definitely let me know. Could it be that you need to update something in your setup? I'm not sure if that search helps, but there are some GitHub threads that come up there. The top result is a pretty long thread, but I think they found a solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One other thing that's worth testing here is whether you're getting this error when making API calls to other HubSpot endpoints. If you're not, and this error is only happening for the form submission endpoint, that's something we'll want to look at. But if this is happening whenever you use this code to make any request to a HubSpot API, I'd think it's probably worth looking through that GitHub thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2019 22:34:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/287816#M26635</guid>
      <dc:creator>lscanlan</dc:creator>
      <dc:date>2019-08-23T22:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: C# RestSharp library Submit a Form Example</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/288274#M26680</link>
      <description>&lt;P&gt;I understand, I will review my configuration more thoroughly if I am missing something, if the result changes I will let you know.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will also check GitHub.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We only need the integration with hubspot with the form submission, we are not currently integrating any other method of your Api.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 14:52:34 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/288274#M26680</guid>
      <dc:creator>rvaladez</dc:creator>
      <dc:date>2019-08-27T14:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: C# RestSharp library Submit a Form Example</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/289623#M26868</link>
      <description>&lt;P&gt;The problem has already been resolved, the problem was caused by an error in a version of the C# RestClient. Once the library was updated to the latest version, the call to hubspot worked correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 15:21:02 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/289623#M26868</guid>
      <dc:creator>rvaladez</dc:creator>
      <dc:date>2019-09-04T15:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: C# RestSharp library Submit a Form Example</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/289676#M26872</link>
      <description>&lt;P&gt;That's great, thank you for the follow-up!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 18:08:20 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/C-RestSharp-library-Submit-a-Form-Example/m-p/289676#M26872</guid>
      <dc:creator>lscanlan</dc:creator>
      <dc:date>2019-09-04T18:08:20Z</dc:date>
    </item>
  </channel>
</rss>

