Git Product home page Git Product logo

hubspot.net's Introduction

NuGet Build status

HubSpot.NET

C# .NET Wrapper around the common HubSpot APIs:

  • Contact
  • Company
  • Deal
  • Engagement
  • Owners
  • COS Files API (adds the ability to upload files to use as attachments to engagements)

Getting Started

To get started, install the Nuget package and create a instance of HubSpotApi passing your API Key as the only parameter.

  var api = new HubSpotApi("MY API KEY");
  
  // Create a contact
  var contact = api.Contact.Create(new ContactHubSpotModel()
  {
      Email = "[email protected]",
      FirstName = "John",
      LastName = "Smith",
      Phone = "00000 000000",
      Company = "Squared Up Ltd."
  });
  

For more examples see the HubSpot.NET.Examples project.

Using your own models

As HubSpot lets you create and add custom properties to your contacts, companies and deals it's likely you'll want to implement your own models. This is straightforward, simply extend the models shipped with this library, e.g. ContactHubSpotModel and add your own properties. Use the DataMember attributes to indicate the internal name. For example

  public class Contact : ContactHubSpotModel
  {
      [DataMember(Name = "activities")]
      public string Activities { get; set; }

      [DataMember(Name = "type")]
      public string Type { get; set; }
  }

Using checkbox/radio properties

These properties should be of type string and set as a semicolon delimitered list of values, e.g. "value1;value2". This is required by HubSpot, see here for more details.

Contributing

Please read CONTRIBUTING.md for more information on how to contribute. PRs welcome!

Authors

  • Dave Clarke

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgements

  • Initial version based on dotnetcore-hubspot-client by skarpdev, expanded to additional APIs and heavily refactored to use RestSharp etc.

hubspot.net's People

Contributors

clarkd avatar staybfutrell avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.