Comments (5)
ok, clear. Thanks for the feedback. I will close this one.
from hubspot.net.
Hi @franknesse, thanks for your issue. Could you please tell me which version of the package you are using and perhaps post a little more of the code you are using around this for each loop?
from hubspot.net.
Hello @Psypher9 , thanks for your quick reply. I am using version 0.6.17 (just installed it from NuGet).
The code is nothng more than:
var api = new HubSpotApi("<my api key>");
var result = api.Contact.List<HubSpot.NET.Api.Contact.Dto.ContactHubSpotModel>();
foreach (ContactHubSpotModel contact in result.Contacts)
{
Console.WriteLine($"{contact.FirstName} {contact.LastName} {contact.Email}");
}
And this is my hubspot application:
from hubspot.net.
I managed to get the e-mail address now, by providing a ListRequestOptins object as follows:
var api = new HubSpotApi("<my api key>");
ListRequestOptions options = new ListRequestOptions()
{
PropertiesToInclude = new List<string> { "firstname", "lastname", "email" }
};
var result = api.Contact.List<HubSpot.NET.Api.Contact.Dto.ContactHubSpotModel>(options);
foreach (ContactHubSpotModel contact in result.Contacts)
{
Console.WriteLine($"{contact.FirstName} {contact.LastName} {contact.Email}");
}
But for me it is not clear yet why last and first name are provided by default where as I need to explicitly request for the email using the ListRequestOptions object. Can anybody explain this behavior to me?
from hubspot.net.
@franknesse, this is actually due to HubSpot's API specifications found here under the Optional Parameter section and Property. Their API only includes a few properties (i.e. first and last name) by default when getting all contacts by this method.
from hubspot.net.
Related Issues (20)
- Deal Close Date seems to be wrong type.
- HubSpotOAuthApi Authorize and Refresh Methods Return Null Token with Valid Input
- New nuget release? HOT 1
- Missing API - Best practice to contribute
- Removal of flurl broke everything. Bad query strings.
- "Engagement type cannot be null" while creating engagement. HOT 1
- Using custom properties dynamically
- v0.8.13 Released to NuGet? HOT 4
- RestSharp HOT 1
- Replacement Project
- Upload File Responses with Empty JSON
- StatusCode is private
- Most Updated/Maintained Fork? HOT 4
- Private App Support
- Endpoint not found and Bearer token not set
- HubSpot phasing out API for Private App HOT 4
- Contact Get Requests does not return 'CreatedAt' and 'UpdatedAt' HOT 1
- This hapikey doesn't exist.","correlationId":
- Map date time properties HOT 1
- Create Deals with Line Items HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hubspot.net.