Create a Contact in HubSpot using C#

In this article, we will learn about How to Create a Contact in HubSpot using C#.
In this blog, we will learn step by step using a console How to Create a Contact in HubSpot using C#.
Now Open Visual Studio and create the project as:
“Start” –> “All Programs”- “Microsoft Visual Studio 2017”.
“File” – “New Project” – ” Select Visual C# from left template” – “Console App(.Net Framework).Write the name of Project and Click Ok Button.

key Point:
After creating a project right click on your project and click on “Manage NuGet Packages..” and install “RestSharp” library.

After installation you can check your Refrence folder.RestSharp library store in “Referencefolder.

Before Create a Contact in HubSpot using C#.Learn about some basic knowledge of “RestSharp”.
RestSharp:It is generally used for create Web Services and Web request in .Net.It is an open-source HTTP client library that works with all kinds of DotNet technologies.

Finally Open “Form1.cs” page to write code for Create a Contact in HubSpot using C#.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Need to add this Namespaces
using RestSharp;

namespace Contact
class Program
static void Main(string[] args)
var emailAddress = "write here email";//like abcd@gmail.com
var hapikey = "write your hapi key";
var client = new RestClient("https://api.hubapi.com/");
var request = new RestRequest("contacts/v1/contact/createOrUpdate/email/{email}",Method.POST);
request.RequestFormat = DataFormat.Json;

properties = new[]

IRestResponse response = client.Execute(request);


Any question and suggestion related to this article please comment me. Thank you

Leave a Reply

Your email address will not be published.