Example #1
0
        public HubSpotApi(string apiKey)
        {
            IHubSpotClient client = new HubSpotBaseClient(apiKey);

            Company           = new HubSpotCompanyApi(client);
            Contact           = new HubSpotContactApi(client);
            Deal              = new HubSpotDealApi(client);
            Engagement        = new HubSpotEngagementApi(client);
            File              = new HubSpotCosFileApi(client);
            Owner             = new HubSpotOwnerApi(client);
            CompanyProperties = new HubSpotCompaniesPropertiesApi(client);
        }
Example #2
0
        /// <summary>
        /// Creates a HubSpotApi using OAuth 2.0 authentication for all API calls.
        /// </summary>
        /// <param name="clientId"></param>
        /// <param name="clientSecret"></param>
        /// <param name="appId"></param>
        /// <param name="token"></param>
        public HubSpotApi(string clientId, string clientSecret, string appId, HubSpotToken token = null)
        {
            IHubSpotClient client = new HubSpotBaseClient(string.Empty, HubSpotAuthenticationMode.OAUTH, appId, token);

            InitializeRepos(client, clientId, clientSecret);
        }
Example #3
0
        /// <summary>
        /// Creates a HubSpotApi using API key authentication instead of OAuth
        /// </summary>
        /// <param name="apiKey">The HubSpot API key for your application.</param>
        public HubSpotApi(string apiKey)
        {
            IHubSpotClient client = new HubSpotBaseClient(apiKey, HubSpotAuthenticationMode.HAPIKEY);

            InitializeRepos(client);
        }