File tree Expand file tree Collapse file tree 4 files changed +18
-6
lines changed
Expand file tree Collapse file tree 4 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -80,9 +80,15 @@ public static void Example()
8080 api . Contact . Delete ( contact . Id . Value ) ;
8181
8282 /**
83- * Get all contacts
83+ * Get all contacts with specific properties
84+ * By default only a few properties are returned
8485 */
85- var contacts = api . Contact . List < ContactListHubSpotModel > ( ) ;
86+ var contacts = api . Contact . List < ContactListHubSpotModel > ( new List < string >
87+ {
88+ "firstname" ,
89+ "lastname" ,
90+ "email"
91+ } ) ;
8692 }
8793 }
8894}
Original file line number Diff line number Diff line change @@ -60,10 +60,11 @@ public HubSpotContactApi(IHubSpotClient client)
6060 /// <summary>
6161 /// List all available contacts
6262 /// </summary>
63+ /// <param name="properties">List of properties to fetch for each contact</param>
6364 /// <param name="opts">Request options - used for pagination etc.</param>
6465 /// <typeparam name="T">Implementation of ContactHubSpotModel</typeparam>
6566 /// <returns>A list of contacts</returns>
66- public T List < T > ( ListRequestOptions opts = null ) where T : ContactListHubSpotModel , new ( )
67+ public T List < T > ( List < string > properties , ListRequestOptions opts = null ) where T : ContactListHubSpotModel , new ( )
6768 {
6869 if ( opts == null )
6970 {
@@ -78,6 +79,11 @@ public HubSpotContactApi(IHubSpotClient client)
7879 path = path . SetQueryParam ( "vidOffset" , opts . Offset ) ;
7980 }
8081
82+ if ( properties != null && properties . Any ( ) )
83+ {
84+ path = path . SetQueryParam ( "property" , properties ) ;
85+ }
86+
8187 var data = _client . ExecuteList < T > ( path , opts ) ;
8288
8389 return data ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public interface IHubSpotContactApi
1111 void Batch < T > ( List < T > entities ) where T : ContactHubSpotModel , new ( ) ;
1212 T GetByEmail < T > ( string email ) where T : ContactHubSpotModel , new ( ) ;
1313 T GetById < T > ( long contactId ) where T : ContactHubSpotModel , new ( ) ;
14- T List < T > ( ListRequestOptions opts = null ) where T : ContactListHubSpotModel , new ( ) ;
14+ T List < T > ( List < string > properties , ListRequestOptions opts = null ) where T : ContactListHubSpotModel , new ( ) ;
1515 void Update < T > ( T contact ) where T : ContactHubSpotModel , new ( ) ;
1616 }
1717}
Original file line number Diff line number Diff line change 33 <PropertyGroup >
44 <TargetFrameworks >net46;net451</TargetFrameworks >
55 <GeneratePackageOnBuild >true</GeneratePackageOnBuild >
6- <Version >0.5.0 </Version >
6+ <Version >0.5.1 </Version >
77 <Authors >Squared Up Ltd.</Authors >
88 <Company >Squared Up Ltd.</Company >
99 <Description >C# .NET Wrapper around the common HubSpot APIs.</Description >
1212 <PackageProjectUrl >https://github.com/squaredup/HubSpot.NET</PackageProjectUrl >
1313 <RepositoryUrl >https://github.com/squaredup/HubSpot.NET</RepositoryUrl >
1414 <PackageTags >hubspot api wrapper c# contact company deal engagement properties crm</PackageTags >
15- <PackageReleaseNotes >0.5</PackageReleaseNotes >
15+ <PackageReleaseNotes >0.5.1 </PackageReleaseNotes >
1616 <PackageId >SquaredUp.HubSpot.NET</PackageId >
1717 </PropertyGroup >
1818 <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Release|AnyCPU'" >
You can’t perform that action at this time.
0 commit comments