File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,19 @@ public HubSpotContactApi(IHubSpotClient client)
5656 var data = _client . Execute < T > ( path , Method . GET ) ;
5757 return data ;
5858 }
59+
60+ /// <summary>
61+ /// Gets a contact by their user token
62+ /// </summary>
63+ /// <param name="userToken">User token to search for from hubspotutk cookie</param>
64+ /// <typeparam name="T">Implementation of ContactHubSpotModel</typeparam>
65+ /// <returns>The contact entity</returns>
66+ public T GetByUserToken < T > ( string userToken ) where T : ContactHubSpotModel , new ( )
67+ {
68+ var path = $ "{ new T ( ) . RouteBasePath } /contact/utk/{ userToken } /profile";
69+ var data = _client . Execute < T > ( path , Method . GET ) ;
70+ return data ;
71+ }
5972
6073 /// <summary>
6174 /// List all available contacts
@@ -214,4 +227,4 @@ public void Delete(long contactId)
214227 return data ;
215228 }
216229 }
217- }
230+ }
Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ 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 GetByUserToken < T > ( string userToken ) where T : ContactHubSpotModel , new ( ) ;
1415 ContactListHubSpotModel < T > List < T > ( ListRequestOptions opts = null ) where T : ContactHubSpotModel , new ( ) ;
1516 void Update < T > ( T contact ) where T : ContactHubSpotModel , new ( ) ;
1617 ContactListHubSpotModel < T > RecentlyCreated < T > ( ListRecentRequestOptions opts = null ) where T : ContactHubSpotModel , new ( ) ;
1718 ContactListHubSpotModel < T > RecentlyUpdated < T > ( ListRecentRequestOptions opts = null ) where T : ContactHubSpotModel , new ( ) ;
1819 }
19- }
20+ }
You can’t perform that action at this time.
0 commit comments