Skip to main content

<a id=“SuperOffice_WebApi_Agents_PersonAgent”></a> Class PersonAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
Person data services.

Inheritance

objectAgentBasePersonAgent

Implements

IPersonAgent, IAgentBase, IDisposable

Inherited Members

AgentBase._json, AgentBase._binary, AgentBase._config, AgentBase._client, AgentBase._disposeClient, AgentBase.Merge(RequestOptions), AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string), AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.ParseAuthorization(IAuthorization), AgentBase.CancelRequest(), AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.SendRequest(HttpRequestMessage, RequestOptions), AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage), AgentBase.ParseResponse<T&gt;(HttpResponseMessage), AgentBase.Finally(RequestOptions), AgentBase.Dispose(), AgentBase.Configuration, AgentBase.Client, AgentBase.HasRunningRequest, AgentBase.ClientCancellationTokenSource, AgentBase.ProgressListener, AgentBase.UploadProgressListener, object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()

Examples

<pre><code class=“lang-csharp”>using SuperOffice.WebApi; using SuperOffice.WebApi.Agents; var mySession = new WebApiOptions(“http://example.com/super/api”); mySession.Authorization = new AuthorizationUsernamePassword(“user”, “pass”); using (PersonAgent agent = new PersonAgent(mySession)) { // call methods on agent here… }</code></pre>

Constructors

<a id=“SuperOffice_WebApi_Agents_PersonAgent__ctor_System_Net_Http_HttpClient_”></a> PersonAgent(HttpClient)

Constructor: Person data services.

Parameters

httpClient HttpClient Use this HTTP client instead of making own HttpClient instance.

<a id=“SuperOffice_WebApi_Agents_PersonAgent__ctor_SuperOffice_WebApi_WebApiOptions_System_Net_Http_HttpClient_”></a> PersonAgent(WebApiOptions, HttpClient)

Constructor: Person data services.

Parameters

options WebApiOptions Base URL and authentication values. httpClient HttpClient Optional: Use this HTTP client instead of making a new one.

Methods

<a id=“SuperOffice_WebApi_Agents_PersonAgent_AddBounceAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> AddBounceAsync(string, RequestOptions)

Add a bounce count on the email address if it exists

Parameters

emailAddress string The email address which we want to add a bounce count to requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_AddBounceWithCountAsync_System_String_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> AddBounceWithCountAsync(string, int, RequestOptions)

Add a number of bounce counts on the email address if it exists

Parameters

emailAddress string The email address which we want to add bounce counts to counts int The number of bounce counts to add requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_AddBounceWithDetailsAsync_System_String_System_Int32_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> AddBounceWithDetailsAsync(string, int, int, string, RequestOptions)

Add a number of bounce counts on the email address if it exists, and with possible bounce code and reason

Parameters

emailAddress string The email address which we want to add bounce counts to counts int The number of bounce counts to add code int A numeric code representing the bounce reason reason string A textual tag representing the bounce reason requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_AddEmailAddressToPersonAsync_System_Int32_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> AddEmailAddressToPersonAsync(int, string, bool, RequestOptions)

Sets the primary email address on person, possibly re-ranking email addresses accordingly.

Parameters

personId int Person id of the person emailAddress string The email address to set as primary email address setAsPrimaryEmail bool True if the address shall be primary email address (have rank == 1) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_ChangeCountryAsync_SuperOffice_WebApi_Data_PersonEntity_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> ChangeCountryAsync(PersonEntity, int, RequestOptions)

Change country regenerates the default values and localized information such as phone number and address format for this entity.

Parameters

personEntity PersonEntity The PersonEntity to change country on toCountryId int The country to switch to requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonEntity&gt; The PersonEntity

<a id=“SuperOffice_WebApi_Agents_PersonAgent_ChangePersonRankAsync_System_Int32_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> ChangePersonRankAsync(int, bool, RequestOptions)

Move one person up or down in the ranking in the Person Archive, if possible.<para/>The person record that has rank = 1 is the primary contact for a company, and is the one used in situations where no person has been explicitly chosen (such as in selections).<para/>This method corresponds to the move up/move down functions in the person archive in the contact panel.<para/>This method always affects two records.

Parameters

personId int Primary key of person record to move up or down. You must have write access both to this record AND to whatever record is adjacent in the direction you want to move. moveUp bool If true, the given person is moved to an earlier rank (lower numeric rank value, down to a limit of 1; up in the GUI if sorted by ascending rank). If false, movement is to later priority (higher numeric rank value). requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<int&gt; If movement occurred, the return value will be the ID of the OTHER person that got moved. A GUI should switch the positions of the original person ID and this return value.<para/>If no movement occurred, for any reason, 0 is returned.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_CheckTemporaryKeyAsync_System_String_SuperOffice_WebApi_RequestOptions_”></a> CheckTemporaryKeyAsync(string, RequestOptions)

Check a temporary key for validity, and in case it is valid, return its domain, targetId and personId

Parameters

temporaryKey string The base64 encoded key value, as returned by CreateTemporaryKey requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<TemporaryKeyInfo&gt; The info about the temporary key. Domain will be Unknown if key is not valid.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_CreateDefaultByContactIdAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultByContactIdAsync(int, RequestOptions)

Creates a PersonEntity with default values based on the contactId.

Parameters

contactId int Contact id of the person requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonEntity&gt;

<a id=“SuperOffice_WebApi_Agents_PersonAgent_CreateDefaultConsentPersonAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultConsentPersonAsync(RequestOptions)

Set default values into a new ConsentPerson. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ConsentPerson&gt; A blank ConsentPerson

<a id=“SuperOffice_WebApi_Agents_PersonAgent_CreateDefaultFromCredentialAsync_System_Int32_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultFromCredentialAsync(int, string, string, string, RequestOptions)

Creates a PersonEntity with default values based on the contactId and credentials.

Parameters

contactId int Contact id of the person credentialType string Type of credentials, corresponding to name of plugin and type in the credentials table. credentialValue string This is the actuall value of the credentials. This will typically be the password or teh users SID in active directory credentialDisplayValue string The value displayed to the user. this will typically be the users login name in active directory. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonEntity&gt;

<a id=“SuperOffice_WebApi_Agents_PersonAgent_CreateDefaultPersonEntityAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultPersonEntityAsync(RequestOptions)

Set default values into a new PersonEntity. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonEntity&gt; A blank PersonEntity

<a id=“SuperOffice_WebApi_Agents_PersonAgent_CreateDefaultPersonImageAsync_SuperOffice_WebApi_RequestOptions_”></a> CreateDefaultPersonImageAsync(RequestOptions)

Set default values into a new PersonImage. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonImage&gt; A blank PersonImage

<a id=“SuperOffice_WebApi_Agents_PersonAgent_CreateOrUpdateUserCandidateAsync_System_Int32_System_String_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> CreateOrUpdateUserCandidateAsync(int, string, bool, RequestOptions)

Creates a Customer Centre User (UserCandidate) for a given Contact (personId) with the supplied parameters. If the Customer Centre User already exists for a given Contact, the user is updated with the supplied parameters.

Parameters

personId int Person to create UserCandidate for. username string Desired username. Username must be unique. If the username is not unique, method will throw an error. accessAllRequests bool Determines if Custom Center User has access to all requests created for all Contacts in the company. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserCandidate&gt; UserCandidate created or updated.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_CreateTemporaryKeyAsync_SuperOffice_WebApi_Data_TemporaryKeyDomain_System_Int32_System_Int32_System_DateTime_SuperOffice_WebApi_RequestOptions_”></a> CreateTemporaryKeyAsync(TemporaryKeyDomain, int, int, DateTime, RequestOptions)

Create a temporary key in the database from the given parameters and return the key string. Used for temporary keys for accessing customer centric functionality, such as UpdateSubscriptions.

Parameters

domain TemporaryKeyDomain The domain this key is for targetId int The primary key of the entity this is for. Depends on domain. personId int The person this key is for. May be null. expires DateTime When the key will expire (servers local time) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; The key as base64, ready to be used e.g. in a URL

<a id=“SuperOffice_WebApi_Agents_PersonAgent_CreateTemporaryKeyWithPayloadAsync_SuperOffice_WebApi_Data_TemporaryKeyDomain_System_Int32_System_Int32_System_DateTime_System_String_SuperOffice_WebApi_RequestOptions_”></a> CreateTemporaryKeyWithPayloadAsync(TemporaryKeyDomain, int, int, DateTime, string, RequestOptions)

Create a temporary key in the database from the given parameters and return the key string. Used for temporary keys for accessing customer centric functionality, such as UpdateSubscriptions.

Parameters

domain TemporaryKeyDomain The domain this key is for targetId int The primary key of the entity this is for. Depends on domain. personId int The person this key is for. May be null. expires DateTime When the key will expire (servers local time) payload string The payload for the temporary key requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; The key as base64, ready to be used e.g. in a URL

<a id=“SuperOffice_WebApi_Agents_PersonAgent_DeleteConsentPersonAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteConsentPersonAsync(int, RequestOptions)

Deletes the ConsentPerson

Parameters

consentPersonId int The identity of the ConsentPerson requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_DeleteExpiredAsync_SuperOffice_WebApi_RequestOptions_”></a> DeleteExpiredAsync(RequestOptions)

Trigger deletion of persons that has been (soft) deleted and have timed out the expiry period (the SoftDeleteRetention preference).

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_DeletePersonEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeletePersonEntityAsync(int, RequestOptions)

Deletes the PersonEntity

Parameters

personEntityId int The identity of the PersonEntity requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_DeleteTemporaryKeysOfDomainAsync_SuperOffice_WebApi_Data_TemporaryKeyDomain_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> DeleteTemporaryKeysOfDomainAsync(TemporaryKeyDomain, int, RequestOptions)

Delete all temporary keys for a given domain and person

Parameters

domain TemporaryKeyDomain The domain type to delete personId int The person for which to delete the keys requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetAddressAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetAddressAsync(int, RequestOptions)

Gets the person’s localized address.

Parameters

personId int The person id requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Address&gt; The address as LocalizedField[][].

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetAddressByCountryAsync_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetAddressByCountryAsync(int, int, RequestOptions)

Gets the person’s localized address.

Parameters

personId int The person id countryId int requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Address&gt; The address as LocalizedField[][].

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetBestSoLanguageForTemplateAsync_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetBestSoLanguageForTemplateAsync(int, int, RequestOptions)

Get the best language for this person on this template

Parameters

personId int The id of the person templateId int The id of the template to find languages on requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<string&gt; The solang code for best language, empty string if no best language found

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetColleaguesAsync_SuperOffice_WebApi_RequestOptions_”></a> GetColleaguesAsync(RequestOptions)

Gets the persons working in the same company as the logged on user.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Person[]&gt; Colleagues.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetColleaguesByDepartmentAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetColleaguesByDepartmentAsync(int, RequestOptions)

Gets the persons working in a specific department in the same company as the logged on user. Departments can be retrieved with the PhoneList.DepartmentList service.

Parameters

departmentId int The department id. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Person[]&gt; PersonList with colleagues.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetColleaguesBySourceAsync_SuperOffice_WebApi_Data_AssociateSourceType_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetColleaguesBySourceAsync(AssociateSourceType, int, RequestOptions)

Gets the persons working in the same company as the logged on user. The list of person could be retrieved from the history list, the diary view list, or from all sources.

Parameters

sourceType AssociateSourceType The “source” the colleagues should be retrieved from. <see cref=“AssociateSourceType”/> for more information. count int requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Person[]&gt; Colleagues.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetConsentInfosAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetConsentInfosAsync(int, RequestOptions)

Get all consent information for a given person. May include withdrawn consents (check

Parameters

personId int The person id to get consents for requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ConsentInfo[]&gt; List of consents recorded on this person

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetConsentPersonAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetConsentPersonAsync(int, RequestOptions)

Gets a specific ConsentPerson object.

Parameters

consentPersonId int The identifier of the ConsentPerson object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ConsentPerson&gt; ConsentPerson

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetCustomerCentrePasswordReplyTemplateAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetCustomerCentrePasswordReplyTemplateAsync(int, RequestOptions)

Gets a parsed Customer Centre password reply template for a particular customer

Parameters

personId int Person/customer id to get the template for. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ReplyTemplateParsed&gt; A parsed Customer Centre password reply template.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetMyOwnerAsync_SuperOffice_WebApi_RequestOptions_”></a> GetMyOwnerAsync(RequestOptions)

Get the owner of the logged in person.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Person&gt; Person

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetMyPersonAsync_SuperOffice_WebApi_RequestOptions_”></a> GetMyPersonAsync(RequestOptions)

Gets the person info belonging to the currently logged on user.

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonEntity&gt; The PersonEntity

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetOwnerOnPersonIdAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetOwnerOnPersonIdAsync(int, RequestOptions)

Get the owner of the person by id.

Parameters

personId int requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Person&gt; Person

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetPersonAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPersonAsync(int, RequestOptions)

Gets a specific Person object.

Parameters

personId int The identifier of the Person object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Person&gt; Person

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetPersonEntityAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPersonEntityAsync(int, RequestOptions)

Gets a specific PersonEntity object.

Parameters

personEntityId int The identifier of the PersonEntity object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonEntity&gt; PersonEntity

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetPersonImageAsync_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetPersonImageAsync(int, string, RequestOptions)

Returns the person image that is displayed in the CRM application.

Parameters

personId int The person id of the person the image belongs to. returnContentType string Accept content-type. Default “application/octet-stream”. Could also be “application/pdf”, “text/plain”, “text/html”, or “multipart/related” requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<byte[]&gt; The person image.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetPersonImagesAsync_System_Int32___System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPersonImagesAsync(int[], int, int, RequestOptions)

Get the image for a set of persons scaled to a specific size. Returned images are in PNG format.

Parameters

personIds int[] List of persons to get images for. scaledWidth int Returned images are scaled to this width scaledHeight int Returned images are scaled to this height requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonImage[]&gt; List of person images. Persons without an image are not present in this list.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetPersonListAsync_System_Int32___SuperOffice_WebApi_RequestOptions_”></a> GetPersonListAsync(int[], RequestOptions)

Gets an array of specific Person objects.

Parameters

personIds int[] The identifiers of the Person object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Person[]&gt; Array of Person objects

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetPersonSummaryAsync_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPersonSummaryAsync(int, int, RequestOptions)

Get summary of person and recent activity.

Parameters

personId int The person id to summarize. limit int Max number of items to include in summary lists. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonSummary&gt; Summary of person, with recent requests, sales, follow-ups, chats.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetPersonsFromContactAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPersonsFromContactAsync(int, RequestOptions)

Returns all the persons belonging to a contact.

Parameters

contactId int The project id requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Person[]&gt; The persons belonging to a contact.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetPersonsFromProjectAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPersonsFromProjectAsync(int, RequestOptions)

Returns all the persons belonging to a project.

Parameters

projectId int The project id requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<Person[]&gt; The persons belonging to a project.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetPhonesAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetPhonesAsync(int, RequestOptions)

Returning all phones that belong to a person, ordered by the phone type.

Parameters

personId int The person id requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<EntityElement[]&gt; An array of Phones

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetSalesRepAsync_System_String_System_String_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> GetSalesRepAsync(string, string, string, string, string, RequestOptions)

Returns the sales representative for an external user. If this method is accessed with anonymous authentication the external user is recognized by contact and name, or by email, or phone number. If the external user is recognized as an CRM5 user (internal or external) the input fields can be left blank.

Parameters

contactName string The company name of the person requesting his sales representative. May be empty if email or phone is provided. personFirstname string The firstname of the person requesting his sales representative. May be empty if email or phone is provided. personLastname string The lastname of the person requesting his sales representative. May be empty if email or phone is provided. emailAddress string The email address of the person requesting his sales representative. May be empty if phone, or contact and person name is provided. phoneNumber string The phone number of the person requesting his sales representative. May be empty if email, or contact and person name is provided. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonEntity&gt; The PersonEntity of the sales rep.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetUserCandidateByPersonAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetUserCandidateByPersonAsync(int, RequestOptions)

Gets user candidate linked to a person.

Parameters

personId int Person related to requested UserCandidate. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UserCandidate&gt; UserCandidate linked to a person.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_GetUtmParametersAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> GetUtmParametersAsync(int, RequestOptions)

Get all UTM parameters for a given person.

Parameters

personId int The person id to get UTM parameters for requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<UtmParameters&gt; UTM parameters recorded on this person

<a id=“SuperOffice_WebApi_Agents_PersonAgent_HasConsentAsync_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> HasConsentAsync(int, string, RequestOptions)

Check if consent has been given by a specified person, for a specific purpose. Withdraw consents return FALSE.

Parameters

personId int The person id purpose string The key of the purpose to check. (e.g. ‘STORE’ or ‘EMARKETING’) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; True if the person has consented to the given purpose.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_IsNumberValidAsync_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> IsNumberValidAsync(int, string, RequestOptions)

Checks if the number is unique or required. The setting is configured from admin under system options.

Parameters

contactId int number string Number to check. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; True if number is ok (passes uniqueness/required checks)

<a id=“SuperOffice_WebApi_Agents_PersonAgent_MergeAsync_System_Int32_System_Int32_System_DateTime_System_Boolean_System_Boolean_SuperOffice_WebApi_RequestOptions_”></a> MergeAsync(int, int, DateTime, bool, bool, RequestOptions)

Merge two persons. The destination person will remain. You must specify the date after which activities will be moved along with the person.

Parameters

sourcePersonId int The identifier for the person which will be merged into the destination person. The source person is deleted/marked retired after the merge. destinationPersonId int The identifier for the person which will remain after the merge. The target person is updated. moveAfterDate DateTime Merge activites after this date. Activities before this date are left alone. deleteSource bool If true, the source person will be deleted after the merge. If false, it will have its retired flag set replaceEmptyFieldsOnDestination bool If true, empty fields on destination will be replaced by values from source. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_MoveAsync_System_Int32_System_Int32_System_DateTime_SuperOffice_WebApi_RequestOptions_”></a> MoveAsync(int, int, DateTime, RequestOptions)

Move a person to a specified contact. You must specify the date after which activities will be moved along with the person.

Parameters

personId int The identifier for the person destinationContactId int The identifier for the contact which the person will be moved to moveAfterDate DateTime Move activites after this date. Activities before this date are left alone. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_NormalizeRanksAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> NormalizeRanksAsync(int, RequestOptions)

Nomralize the ranks for all persons that belong to a contact. This means that the persons will be sorted according to their current rank values, and the ranks will be made monotonically increasing from 1.

Parameters

contactId int Id of contact whose persons are to be rank normalized requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; The reutrn value is true if the operation suceeded, either because all persons were already normalized, or because normalization was done. It is false if Sentry blocks any required changes.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_RemoveConsentAsync_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> RemoveConsentAsync(int, string, RequestOptions)

Turn off consent for a specified person and purpose.

Parameters

personId int The person id purpose string The key of the purpose to remove. (e.g. ‘STORE’ or ‘EMARKETING’) requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_ResolvePersonFromInfoAsync_System_Int32_System_String_System_String___System_String___SuperOffice_WebApi_RequestOptions_”></a> ResolvePersonFromInfoAsync(int, string, string[], string[], RequestOptions)

Get a person from the provided information. If the person does not exist, it will be created on demand.

Parameters

contactId int The contact Id of the contact which the person belongs to. Cannot be 0. personName string The full name of the person to be resolved. Optional. phoneNumbers string[] Phone numbers registered on the person. Optional. emails string[] Email-addresses registered on the person. Optional. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ResolvedPerson&gt; The results of the resolve-operation.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SaveConsentPersonAsync_SuperOffice_WebApi_Data_ConsentPerson_SuperOffice_WebApi_RequestOptions_”></a> SaveConsentPersonAsync(ConsentPerson, RequestOptions)

Updates the existing ConsentPerson or creates a new ConsentPerson if the id parameter is 0.

Parameters

consentPerson ConsentPerson The ConsentPerson that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<ConsentPerson&gt; New or updated ConsentPerson

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SavePersonEntityAsync_SuperOffice_WebApi_Data_PersonEntity_SuperOffice_WebApi_RequestOptions_”></a> SavePersonEntityAsync(PersonEntity, RequestOptions)

Updates the existing PersonEntity or creates a new PersonEntity if the id parameter is 0.

Parameters

personEntity PersonEntity The PersonEntity that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<PersonEntity&gt; New or updated PersonEntity

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SendConsentConfirmationEmailAsync_System_Int32_System_String_System_Int32_System_Int32_System_String_SuperOffice_WebApi_RequestOptions_”></a> SendConsentConfirmationEmailAsync(int, string, int, int, string, RequestOptions)

Send confirmation email to the provided person, email address (id), using the document template

Parameters

personId int The person id emailAddress string The email address to send to. emailTemplateId int The id of the email template (doctmpl_id) cultureLcidId int The id of the culture (LCID) subject string Optional email subject requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SendCustomerCentrePasswordEmailAsync_System_Int32_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> SendCustomerCentrePasswordEmailAsync(int, string, string, string, RequestOptions)

Sends a Customer Centre password email based on the reply template.

Parameters

personId int Person id associated to email’s reply template. from string Sender’s email address. to string Recipient’s email address. subject string Email’s subject. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SendEmailAsync_System_String_System_String_System_String_System_String_System_String_System_Int32___SuperOffice_WebApi_RequestOptions_”></a> SendEmailAsync(string, string, string, string, string, int[], RequestOptions)

Inserts into outbox an email with specified details.

Parameters

from string Sender’s email address. to string Recipient’s email address. subject string Email’s subject. plainBody string Email’s plain body. htmlBody string Email’s html body. attachmentIds int[] Ids of email’s attachments. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SendEmailWithEventNameAsync_System_String_System_String_System_String_System_String_System_String_System_Int32___System_String_SuperOffice_WebApi_RequestOptions_”></a> SendEmailWithEventNameAsync(string, string, string, string, string, int[], string, RequestOptions)

Inserts into outbox an email with specified details and event name.

Parameters

from string Sender’s email address. to string Recipient’s email address. subject string Email’s subject. plainBody string Email’s plain body. htmlBody string Email’s html body. attachmentIds int[] Ids of email’s attachments. eventName string Event name passed to outbound email trigger requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SetConsentAsync_System_Int32_System_String_System_String_System_String_System_String_SuperOffice_WebApi_RequestOptions_”></a> SetConsentAsync(int, string, string, string, string, RequestOptions)

Set a specified type of consent on the person.

Parameters

personId int The person id purpose string The Key of the purpose this affects. e.g. ‘STORE’ or ‘EMARKETING’. source string The Key of the source of this consent. e.g. ‘USER’, ‘WEBFORM’ or ‘API’. legalBase string The Key of the legal base for this consent. e.g. ‘61A’, ‘61B’, ‘61F’ comment string A comment regarding this consent. May be null or empty. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SetPersonImageAsync_System_Int32_System_Byte___SuperOffice_WebApi_RequestOptions_”></a> SetPersonImageAsync(int, byte[], RequestOptions)

Stores the person image that is displayed in the CRM application.

Parameters

personId int The person id of the person the image belongs to. image byte[] The person image. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SetPersonRankAsync_System_Int32_System_Int16_SuperOffice_WebApi_RequestOptions_”></a> SetPersonRankAsync(int, short, RequestOptions)

Directly set the rank field of a person record, adjusting all other person records under the same contact as needed.<para/>This call may affect multiple records, potentially all person records belonging to one contact.<para/>You must have write access for to affected records for this method to succeed.

Parameters

personId int Id of person to change desiredRank short Desired rank to set, legal values are from 1 to the number of person records on this contact. Out of range values will be moved to the closest valid value and processed. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; If movement occurred, or the person already had exactly the desired rank value, then the return value will be true. If movement did not occur, for any other reason, the return value is false.

<a id=“SuperOffice_WebApi_Agents_PersonAgent_SetUtmCreatedPersonContactForFormSubmissionAsync_System_Int32_System_Int32_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> SetUtmCreatedPersonContactForFormSubmissionAsync(int, int, int, RequestOptions)

Set created person and optinally contact on an UTM Parameters row related to a form submission.

Parameters

formSubmissionId int Id of Form submission row related to UTM Parameters row personId int Person id to set contactId int Contact id to set. Can be 0. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_PersonAgent_TryAddPersonsToEmailFlowAsync_System_Int32_System_Int32___SuperOffice_WebApi_RequestOptions_”></a> TryAddPersonsToEmailFlowAsync(int, int[], RequestOptions)

Try to add a participant to the EmailFlow, Same function available in WorkflowAgent

Parameters

emailFlowId int Primary key of EmailFlow personIds int[] Array of Person Ids requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool[]&gt; True if the corresponding participant was successfully added, false if it could not be added because of filter criteria or other reason

<a id=“SuperOffice_WebApi_Agents_PersonAgent_UndeleteAsync_System_Int32_SuperOffice_WebApi_RequestOptions_”></a> UndeleteAsync(int, RequestOptions)

This entity supports Soft Delete. Call this method to Undelete a previously soft-deleted record

Parameters

id int The primary key of the entity to undelete requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_PersonAgent_UpdateInterestsAsync_System_Int32_System_Int32___System_Int32___SuperOffice_WebApi_RequestOptions_”></a> UpdateInterestsAsync(int, int[], int[], RequestOptions)

Update interests on person. Will throw exception if id is in both arrays

Parameters

personId int Person id to update interests for enableInterestIds int[] The interest ids to set on the person. This will set these interests to true and not touch any other interests. disableInterestIds int[] The interest ids to diable on the person. This will set these interests to false and not touch any other interests. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task This method has no return value

<a id=“SuperOffice_WebApi_Agents_PersonAgent_ValidatePersonEntityAsync_SuperOffice_WebApi_Data_PersonEntity_SuperOffice_WebApi_RequestOptions_”></a> ValidatePersonEntityAsync(PersonEntity, RequestOptions)

Check that entity is ready for saving, return error messages by field.

Parameters

personEntity PersonEntity Entity to be checked for errors. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<StringDictionary&gt; Error messages tagged by field.