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()
80
80
api . Contact . Delete ( contact . Id . Value ) ;
81
81
82
82
/**
83
- * Get all contacts
83
+ * Get all contacts with specific properties
84
+ * By default only a few properties are returned
84
85
*/
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
+ } ) ;
86
92
}
87
93
}
88
94
}
Original file line number Diff line number Diff line change @@ -60,10 +60,11 @@ public HubSpotContactApi(IHubSpotClient client)
60
60
/// <summary>
61
61
/// List all available contacts
62
62
/// </summary>
63
+ /// <param name="properties">List of properties to fetch for each contact</param>
63
64
/// <param name="opts">Request options - used for pagination etc.</param>
64
65
/// <typeparam name="T">Implementation of ContactHubSpotModel</typeparam>
65
66
/// <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 ( )
67
68
{
68
69
if ( opts == null )
69
70
{
@@ -78,6 +79,11 @@ public HubSpotContactApi(IHubSpotClient client)
78
79
path = path . SetQueryParam ( "vidOffset" , opts . Offset ) ;
79
80
}
80
81
82
+ if ( properties != null && properties . Any ( ) )
83
+ {
84
+ path = path . SetQueryParam ( "property" , properties ) ;
85
+ }
86
+
81
87
var data = _client . ExecuteList < T > ( path , opts ) ;
82
88
83
89
return data ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ public interface IHubSpotContactApi
11
11
void Batch < T > ( List < T > entities ) where T : ContactHubSpotModel , new ( ) ;
12
12
T GetByEmail < T > ( string email ) where T : ContactHubSpotModel , new ( ) ;
13
13
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 ( ) ;
15
15
void Update < T > ( T contact ) where T : ContactHubSpotModel , new ( ) ;
16
16
}
17
17
}
Original file line number Diff line number Diff line change 3
3
<PropertyGroup >
4
4
<TargetFrameworks >net46;net451</TargetFrameworks >
5
5
<GeneratePackageOnBuild >true</GeneratePackageOnBuild >
6
- <Version >0.5.0 </Version >
6
+ <Version >0.5.1 </Version >
7
7
<Authors >Squared Up Ltd.</Authors >
8
8
<Company >Squared Up Ltd.</Company >
9
9
<Description >C# .NET Wrapper around the common HubSpot APIs.</Description >
12
12
<PackageProjectUrl >https://github.com/squaredup/HubSpot.NET</PackageProjectUrl >
13
13
<RepositoryUrl >https://github.com/squaredup/HubSpot.NET</RepositoryUrl >
14
14
<PackageTags >hubspot api wrapper c# contact company deal engagement properties crm</PackageTags >
15
- <PackageReleaseNotes >0.5</PackageReleaseNotes >
15
+ <PackageReleaseNotes >0.5.1 </PackageReleaseNotes >
16
16
<PackageId >SquaredUp.HubSpot.NET</PackageId >
17
17
</PropertyGroup >
18
18
<PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Release|AnyCPU'" >
You can’t perform that action at this time.
0 commit comments