/// <summary> /// Get Single Group /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Group entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Group request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an Group entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your Group request to be accepted. /// Agent ID for your Group request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="moxiWorksGroupId">This is the name of a Group to be shown</param> /// <returns></returns> public async Task <Response <Group> > GetGroupAsync(string agentId, AgentIdType agentIdType, string moxiWorksGroupId) { var builder = new UriBuilder($"groups/{moxiWorksGroupId}") .AddQueryPerameterAgentId(agentId, agentIdType); return(await Client.GetRequestAsync <Group>(builder.GetUrl())); }
/// <summary> /// Delete an existing event /// </summary> /// <param name="agentId"> /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Event entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Event entry request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an Event entry entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or MoxiWorksAgentID is required /// and must reference a valid Moxi Works Agent ID for your Event entry request to be accepted. /// Agent ID for your Buyer Transaction entry request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="eventId">This is the unique identifer you use in your system that has been associated with the Event. This data is required and must reference a previously created Event you have created on The Moxi Works Platform.</param> /// <returns> if the delete was successful.</returns> public async Task <Response <EventDeleteResult> > DeleteEventAsync(string agentId, AgentIdType agentIdType, string eventId) { var builder = new UriBuilder($"events/{eventId}") .AddQueryPerameterAgentId(agentId, agentIdType); return(await Client.DeleteRequestAsync <EventDeleteResult>(builder.GetUrl())); }
/// <summary> /// Gets a Brockerages office /// </summary> /// <param name="moxiWorksOfficeId">A valid Moxi Works Office ID. /// Use Office Index Endpoint for a list of all Office objects associated with a Company or use the moxi_works_office_id attribute returned in an Agent response. /// </param> /// <param name="moxiWorksCompanyId"> /// A valid Moxi Works Company ID. Use Company Endpoint to determine what moxi_works_company_id you can use. /// </param> /// <returns>Office response or an empty office if nothing is found</returns> public async Task <Response <Office> > GetOfficeAsync(string moxiWorksOfficeId, string moxiWorksCompanyId) { var builder = new UriBuilder($"offices/{moxiWorksOfficeId}") .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId); return(await Client.GetRequestAsync <Office>(builder.GetUrl())); }
/// <summary> /// Get a Team in a company. /// </summary> /// <param name="moxiWorksTeamId">A valid Moxi Works Team ID. Use Team Index Endpoint for a list of all Team objects associated with a Company or use the moxi_works_team_id attribute returned in an Agent response.</param> /// <param name="moxiWorksCompanyId">A valid Moxi Works Company ID. Use Company Endpoint to determine what moxi_works_company_id you can use. ///</param> /// <returns>Returns the team in the compang if it exists.</returns> public async Task <Response <Team> > GetTeamAsync(string moxiWorksTeamId, string moxiWorksCompanyId) { var builder = new UriBuilder($"teams/{moxiWorksTeamId}"). AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId); return(await Client.GetRequestAsync <Team>(builder.GetUrl())); }
/// <summary> /// Return a single sold listing /// </summary> /// <param name="moxiWorksListingId"> /// This is the Moxi Works Platform ID of the SoldListing which you are requesting to Show. /// This data is required and must reference a valid Moxi Works Sold Listing ID for your Show request to be accepted. /// </param> /// <param name="moxiWorksCompanyId"> /// A valid Moxi Works Company ID. Use Company Endpoint to determine what moxi_works_company_id you can use. /// </param> /// <returns>SoldListing or a empty SoldListing</returns> public async Task <Response <SoldListing> > GetSoldListingAsync(string moxiWorksListngId, string moxiWorksCompanyId) { var builder = new UriBuilder($"sold_listings/{moxiWorksListngId}") .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId); return(await Client.GetRequestAsync <SoldListing>(builder.GetUrl())); }
/// <summary> /// Returns the specified Contact if it exist. /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Contact entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Contact request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an Contact entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your Contact request to be accepted. /// Agent ID for your Contact request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="partnerContactId"> /// This is the unique identifer you use in your system that has been associated /// with the Contact that you are finding. /// </param> /// <returns> Conact Response empty if contact not found</returns> public async Task <Response <Contact> > GetContactAsync(string agentId, AgentIdType agentIdType, string partnerContactId) { var builder = new UriBuilder($"contacts/{partnerContactId}") .AddQueryPerameterAgentId(agentId, agentIdType); return(await Client.GetRequestAsync <Contact>(builder.GetUrl())); }
/// <summary> /// When finding an Agent using the Moxi Works platform API and optionaly include an agents gci goals. /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an ActionLog entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your ActionLog request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an ActionLog entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your ActionLog request to be accepted. /// Agent ID for your ActionLog request to be accepted. /// </param> /// <param name="moxiWorksCompanyId"> /// A valid Moxi Works Company ID. Use Company Endpoint to determine what /// moxi_works_company_id you can use /// </param> /// <param name="includeGciGoals"> /// Whether to include agent’s GCI goals and commissions data in the response data. /// </param> /// <returns> the Agent if exists or an empty Agent Object </returns> public async Task <Response <Agent> > GetAgentWithGoalsAsync(string agentId, string moxiWorksCompanyId, bool includeGciGoals) { var builder = new UriBuilder($"agents/{agentId}") .AddQueryParameter("include_gci_goals", includeGciGoals) .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId); return(await Client.GetRequestAsync <Agent>(builder.GetUrl())); }
/// <summary> /// Get a list of Offices for a brockerage. /// </summary> /// <param name="moxiWorksCompanyId">A valid Moxi Works Company ID. /// Use Company Endpoint to determine what moxi_works_company_id you can use.</param> /// <param name="pageNumber">For queries with multi-page responses, /// use the page_number parameter to return data for specific pages. Data for page 1 is returned /// if this parameter is not included. Use this parameter if total_pages indicates that /// there is more than one page of data available.</param> /// <returns>List of offices for a brockerage.</returns> public async Task <Response <OfficeResults> > GetCompanyOfficesAsync(string moxiWorksCompanyId, int pageNumber = 1) { var builder = new UriBuilder("offices") .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId) .AddQueryParameter("page_number", pageNumber); return(await Client.GetRequestAsync <OfficeResults>(builder.GetUrl())); }
/// <summary> /// Returns BrandResults that contains associated Brands for the request query /// </summary> /// <param name="moxiWorksAgentId"> /// This is the Moxi Works Platform ID of the Agent. /// This will be a string that may take the form of an email address, or a unique identification string. /// agent_uuid or moxi_works_agent_id is required and must reference a valid Moxi Works Agent ID /// for your Agent request to be accepted. /// </param> /// <param name="moxiWorksCompanyId"> /// A valid Moxi Works Company ID. Use Company Endpoint to /// determine what MoxiWorksCompanyID you can use. /// </param> /// <returns>List of brands associated with the requested Agent or Company</returns> public async Task <Response <BrandResults> > GetBrandsAsync(string moxiWorksCompanyId, string agentId = null) { var builder = new UriBuilder($"brands") .AddQueryPerameterAgentId(agentId, AgentIdType.MoxiWorksagentId) .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId); return(await Client.GetRequestAsync <BrandResults>(builder.GetUrl())); }
/// <summary> /// Get a BuyerTransaction /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Buyer Transaction entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Buyer Transaction entry request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an Buyer Transaction entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your Buyer Transaction request to be accepted. /// Agent ID for your Buyer Transaction request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="moxiWorksTransactionId"> /// This is the Moxi Works Platform ID of the BuyerTransaction. /// This will be an RFC 4122 compliant UUID. /// </param> /// <returns>Response containing the expected BuyerTransaction of an empty transaction object </returns> public async Task <Response <BuyerTransaction> > GetBuyerTransactionAsync(string agentId, AgentIdType agentIdType, string moxiWorksTransactionId) { var builder = new UriBuilder($"buyer_transactions/{moxiWorksTransactionId}") .AddQueryPerameterAgentId(agentId, agentIdType); return(await Client.GetRequestAsync <BuyerTransaction>(builder.GetUrl())); }
/// <summary> /// Moxi Works Platform Gallery entities are groups of photos an agent has associated with a listing. /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Gallery is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Gallery request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an Gallery is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your Gallery request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="agentId"></param> /// <param name="agentIdType"></param> /// <param name="moxiWorksCompanyId">A valid Moxi Works Company ID. Use Company Endpoint to determine what moxi_works_company_id you can use.</param> /// <returns></returns> public async Task <Response <GalleryResults> > GetAgentGalleries(string agentId, AgentIdType agentIdType, string moxiWorksCompanyId) { var builder = new UriBuilder("gallery") .AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId); return(await Client.GetRequestAsync <GalleryResults>(builder.GetUrl())); }
/// <summary> /// Returns the specified Task if it exist. /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Group entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Group request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an Group entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your Group request to be accepted. /// Agent ID for your Group request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="partnerContactId"> /// This is the unique identifer you use in your system that has been associated with the Contact that this Task regards. /// </param> /// <param name="partnerTaskId"></param> /// <returns>Task Response empty if task does not exist</returns> public async Task <Response <Task> > GetTaskAsync(string agentId, AgentIdType agentIdType, string partnerContactId, string partnerTaskId) { var builder = new UriBuilder($"task/{partnerTaskId}") .AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("partner_contact_id", partnerContactId); return(await Client.GetRequestAsync <Task>(builder.GetUrl())); }
/// <summary> /// Updates the listing data specified in ListingUpdatableData of the ListingUpdate object /// </summary> /// <param name="listingUpdate"></param> /// <returns>ListingResu</returns> public async Task <Response <ListingResults> > UpdateListingDataAsync(ListingUpdate listingUpdate) { var builder = new UriBuilder($"listings/{listingUpdate.MoxWorksListingId}") .AddQueryParameter("moxi_works_company_id", listingUpdate.MoxiWorksCompanyId); return(await Client.PutRequestAsync <ListingResults, ListingUpdate>(builder.GetUrl(), listingUpdate)); }
/// <summary> /// Returns a ActionLogResult that contains the contacts ActionLogs /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an ActionLog entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your ActionLog request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an ActionLog entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your ActionLog request to be accepted. /// Agent ID for your ActionLog request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="moxiWorksContactId">This is the Moxi Works Platform ID of the Contact /// which the ActionLog objects are associated with. This will be an RFC 4122 compliant UUID. /// This data is required and must reference a valid Moxi Works Contact ID for your /// ActionLog Index request to be accepted. This is the same as the moxi_works_contact_id /// attribute of the Contact response. /// </param> /// <param name="partnerContactId"> /// This is the unique identifer you use in your system that has been associated /// with the Contact that you are creating an ActionLog entry about. /// You should have already created the Contact record on the Moxi Works Platform /// using Contact Create before attempting to use your system’s contact ID to show /// ActionLog entries for the Contact. Your request will be rejected if the Contact /// record does not exist. /// </param> /// <returns>List of contact's logged actions</returns> public async Task <Response <ActionLogResults> > GetActionLogsAsync(string agentId, AgentIdType agentIdType, string moxiWorksContactId, string partnerContactId) { var builder = new UriBuilder("action_logs") .AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("moxi_works_contact_id", moxiWorksContactId) .AddQueryParameter("partner_contact_id", partnerContactId); return(await Client.GetRequestAsync <ActionLogResults>(builder.GetUrl())); }
/// <summary> /// Request a list of seller transactions /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an SellerTransaction entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your SellerTransaction request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an SellerTransaction entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your SellerTransaction request to be accepted. /// Agent ID for your Group request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="moxiworksContactId">This is the Moxi Works Platform ID of the Contact which this /// SellerTransaction has been associated with. This will be an RFC 4122 compliant UUID. /// </param> /// <param name="partnerContactId"> /// If this Contact was created by your sytem in the Moxi Works Platform, then this is the unique identifer /// you use in your system that has been associated with the Contact that you are creating this /// SellerTransaction for. If the Contact was not created by you, then partner_contact_id will be empty. /// </param> /// <param name="pageNumber">Page of SellerTransaction records to return. Use if total_pages indicates /// that there is more than one page of data available.</param> /// <returns>List of SellerTransactions</returns> public async Task <Response <SellerTransactionResults> > GetSellerTransactionsAsync(string agentId, AgentIdType agentIdType, string moxiworksContactId = null, string partnerContactId = null, int pageNumber = 1) { var builder = new UriBuilder("seller_transactions") .AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("partner_contact_id", partnerContactId) .AddQueryParameter("moxi_works_contact_id", moxiworksContactId) .AddQueryParameter("page_number", pageNumber); return(await Client.GetRequestAsync <SellerTransactionResults>(builder.GetUrl())); }
/// <summary> /// When searching for Agent entities using the Moxi Works platform API /// </summary> /// <param name="moxiWorksCompanyId">A valid Moxi Works Company ID. Use Company Endpoint to /// determine what moxi_works_company_id you can use. /// </param> /// <param name="moxiWorksOfficeId"> /// A valid Moxi Works Office ID. Use Office Endpoint to determine what /// moxiWorksOfficeId you can use. /// </param> /// <param name="updatedSince"> /// any Agent objects updated after this Unix timestamp will be returned in the response. /// If no updated_since parameter is included in the request, only Agent objects /// updated in the last seven days will be returned. /// </param> /// <param name="pageNumber"> /// For queries with multi-page responses, use the page_number parameter to return data /// for specific pages. Data for page 1 is returned if this parameter is not included. /// Use this parameter if total_pages indicates that there is more than one page of data /// available. /// </param> /// <returns>Returns a Result containing list of agent meeting the criteria.</returns> public async Task <Response <AgentResults> > GetAgentsAsync(string moxiWorksCompanyId, string moxiWorksOfficeId = null, DateTime?updatedSince = null, int?pageNumber = 1) { var builder = new UriBuilder("agents") .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId) .AddQueryParameter("moxi_works_office_id", moxiWorksOfficeId) .AddQueryParameter("updated_since", updatedSince) .AddQueryParameter("page_number", pageNumber); return(await Client.GetRequestAsync <AgentResults>(builder.GetUrl())); }
/// <summary> /// Index will return a paged response of listings that have been updated since a given timestamp for a specified company. /// For a list of company IDs that you can request listings for, use the Company Endpoint. /// </summary> /// <param name="moxiWorksCompanyId"> /// A valid Moxi Works Company ID. Use Company Endpoint to determine what moxi_works_company_id you can use. /// </param> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Listing entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Listing request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an Listing entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your Listing request to be accepted. /// Agent ID for your Listing request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="updatedSince"> /// Paged responses of all Listing objects updated after this Unix timestamp will be returned in the response. If no updated_since parameter is included in the request, /// only Listing objects updated in the last seven days will be returned. /// </param> /// <param name="lastMoxiWorksListingId"> /// If fetching a multi-page response, this should be the MoxiWorksListingId found in the last Listing object of the previously fetched page.</param> /// <returns></returns> public async Task <Response <ListingResults> > GetListingsUpdatedSinceAsync(string moxiWorksCompanyId , AgentIdType agentIdType, string agentId = null, DateTime?updatedSince = null , string lastMoxiWorksListingId = null) { var builder = new UriBuilder("listings/") .AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId) .AddQueryParameter("updated_since", updatedSince) .AddQueryParameter("last_moxi_works_listing_id", lastMoxiWorksListingId); return(await Client.GetRequestAsync <ListingResults>(builder.GetUrl())); }
/// <summary> /// Create new SellerTransaction /// </summary> /// <param name="sellerTransaction">The SellerTransaction to be created.</param> /// <returns>Created SellerTransaction</returns> public async Task <Response <SellerTransaction> > CreateSellerTransactionAsync(SellerTransaction sellerTransaction) { sellerTransaction.Validate(); if (sellerTransaction.HasErrors) { return(BuilderErrorResponse(sellerTransaction)); } var builder = new UriBuilder("seller_transactions"); return(await Client.PostRequestAsync(builder.GetUrl(), sellerTransaction)); }
/// <summary> /// Return a list of agents tasks based on multople parameters. /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Group entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Group request to be accepted. /// This is the Moxi Works Platform ID of the agent which an Group entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your Group request to be accepted. /// Agent ID for your Group request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="startDate">Date to start Searching</param> /// <param name="endDate">Date to end Search</param> /// <param name="partnerContactId"> /// This is the unique identifer you use in your system that has been associated with the Contact that this Task regards. /// </param> /// <param name="pageNumber">The page you want to view.</param> /// <returns>Response with a list of Task in a Task Response object </returns> public async Task <Response <TaskResponse> > GetTasksAsync(string agentId, AgentIdType agentIdType, DateTime?startDate, DateTime?endDate, string partnerContactId, int pageNumber = 1) { var builder = new UriBuilder($"tasks") .AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("date_due_start", startDate) .AddQueryParameter("date_due_end", endDate) .AddQueryParameter("partner_contact_id", partnerContactId) .AddQueryParameter("page_number", pageNumber); return(await Client.GetRequestAsync <TaskResponse>(builder.GetUrl())); }
/// <summary> /// When searching for Group objects using the Moxi Works platform API, format your data using the following parameters. /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Group entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Group request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an Group entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your Group request to be accepted. /// Agent ID for your Group request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="name">This is the name of a Group to be searched for.</param> /// <returns></returns> public async Task <Response <ICollection <GroupItem> > > GetGroupsAsync(string agentId, AgentIdType agentIdType, string name = null) { var builder = new UriBuilder("groups") .AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("name", name); var results = await Client.GetRequestAsync <List <GroupItem> >(builder.GetUrl()); return(new Response <ICollection <GroupItem> > { Errors = results.Errors, Item = results.Item }); }
/// <summary> /// Get a List of Teams in a company. /// </summary> /// <param name="moxiWorksCompanyId"></param> /// <returns>Response of Teams</returns> public async Task <Response <List <Team> > > GetCompanyTeamsAync(string moxiWorksCompanyId) { var builder = new UriBuilder("teams") .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId); var results = await Client.GetRequestAsync <List <Team> >(builder.GetUrl()); return(new Response <List <Team> > { Errors = results.Errors, Item = results.Item }); }
/// <summary> /// Update existing Seller Transaction /// </summary> /// <param name="sellerTransaction">The Seller Transaction to be updated.</param> /// <returns>Updated SellerTransaction</returns> public async Task <Response <SellerTransaction> > UpdateSellerTransactionAsync(SellerTransaction sellerTransaction) { sellerTransaction.Validate(); if (sellerTransaction.HasErrors) { return(BuilderErrorResponse(sellerTransaction)); } var builder = new UriBuilder( $"seller_transactions/{sellerTransaction.MoxiWorksTransactionId}"); return(await Client.PutRequestAsync(builder.GetUrl(), sellerTransaction)); }
public async Task <Response <PresentationLogResults> > GetPresentationLogsAsync( string moxiWorksCompanyId, DateTime?createdAfter = null, DateTime?createdBefore = null, DateTime?updatedAfter = null, DateTime?updatedBefore = null, int page_number = 1) { var builder = new UriBuilder("presentation_logs/") .AddQueryParameter("moxi_works_company_id", moxiWorksCompanyId) .AddQueryParameter("created_before", createdBefore) .AddQueryParameter("create_after", createdAfter) .AddQueryParameter("updated_before", updatedBefore) .AddQueryParameter("updated_after", updatedAfter) .AddQueryParameter("page_number", page_number); return(await Client.GetRequestAsync <PresentationLogResults>(builder.GetUrl())); }
/// <summary> /// Gets Contact either through the AgentUuid or MoxiWorksAgentId. /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an ActionLog entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your ActionLog request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an ActionLog entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your ActionLog request to be accepted. /// Agent ID for your ActionLog request to be accepted. /// </param> /// <param name="emailAddress">An email address associated with the Contact record. May be primary or secondary.</param> /// <param name="contactName">The full name of the contact which you are trying to find the Contact record for.</param> /// <param name="phoneNumber">A phone number associated with the Contact record. May be primary or secondary.</param> /// <param name="updatedSince">Paged responses of all Contact objects updated after this Unix timestamp will be returned in the response.</param> /// <param name="pageNumber">Page of Contact records to return. Use if total_pages indicates that there is more than one page of data available.</param> /// <returns>response of contacts</returns> public async Task <Response <ContactResults> > GetContactsUpdatedSinceAsync(string agentId, AgentIdType agentIdType, string emailAddress = null, string contactName = null, string phoneNumber = null, DateTime?updatedSince = null, int pageNumber = 1) { var builder = new UriBuilder("contacts"); builder.AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("email_address", emailAddress) .AddQueryParameter("contact_name", contactName) .AddQueryParameter("phone_number", phoneNumber) .AddQueryParameter("page_number", pageNumber); if (updatedSince != null) { builder.AddQueryParameter("updated_since", updatedSince.Value); } return(await Client.GetRequestAsync <ContactResults>(builder.GetUrl())); }
/// <summary> /// /// </summary> /// <param name="agentId"> /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an Event entry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your Event entry request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an Event entry entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or MoxiWorksAgentID is required /// and must reference a valid Moxi Works Agent ID for your Event entry request to be accepted. /// Agent ID for your Buyer Transaction entry request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="eventStart">This is the earliest time that you are searching /// for an Event to be in. This data is required and must be a /// Unix timestamp before eventEnd.</param> /// <param name="eventEnd"> /// This is the latest time that you are searching for an Event to be in. /// This data is required and must be a Unix timestamp after evntStart.</param> /// <returns>List of event within the date params</returns> public async Task <Response <EventResults> > GetEventsByDateAsync(string agentId, AgentIdType agentIdType, int eventStart, int eventEnd) { var builder = new UriBuilder("events") .AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("date_start", eventStart) .AddQueryParameter("date_end", eventEnd); var resultsList = await Client.GetRequestAsync <List <EventDateList> >(builder.GetUrl()); var results = new EventResults { EventListDates = resultsList.Item }; return(new Response <EventResults> { Errors = resultsList.Errors, Item = results }); }
/// <summary> /// Searches Moxi Works platform API for EmailCampaign entities. /// </summary> /// <param name="agentId"> /// Must include either: /// AgentUuid /// This is the Moxi Works Platform ID of the agent which an EmailCampaignentry is associated /// with. This will be an RFC 4122 compliant UUID. /// agent_uuid or moxi_works_agent_id is required and must reference a /// valid Moxi Works Agent ID for your EmailCampaignentry request to be accepted. /// /// MoxiWorksAgentId /// This is the Moxi Works Platform ID of the agent which an EmailCampaign entry is associated /// with. This will be a string that may take the form of an email address, /// or a unique identification string. agent_uuid or moxi_works_agent_id is required /// and must reference a valid Moxi Works Agent ID for your EmailCampaign request to be accepted. /// Agent ID for your EmailCampaign request to be accepted. /// </param> /// <param name="agentIdType">What agentId type you are using.</param> /// <param name="partnerContactId"> /// This is the unique identifer you use in your system that has been associated /// with the w that you are creating an EmailCampaign entry about. /// You should have already created the Contact record on the Moxi Works /// Platform using Contact Create before attempting to use your system’s contact ID /// to show EmailCampaign entries for the Contact. Your request will be rejected if /// the Contact record does not exist. /// </param> /// <returns></returns> public async Task <Response <EmailCampaignResults> > GetEmailCampaignsAsync(string agentId, AgentIdType agentIdType, string partnerContactId) { var builder = new UriBuilder("email_campaigns") .AddQueryPerameterAgentId(agentId, agentIdType) .AddQueryParameter("partner_contact_id", partnerContactId); var res = await Client.GetRequestAsync <List <EmailCampaign> >(builder.GetUrl()); var campaigns = new EmailCampaignResults { EmailCampaigns = res.Item }; var response = new Response <EmailCampaignResults> { Errors = res.Errors, Item = campaigns }; return(response); }
/// <summary> /// update an existing task /// </summary> /// <param name="task"> /// The Task you want to update /// </param> /// <returns>The Response containing the update Task </returns> public async Task <Response <Task> > UpdateTaskAsync(Task task) { var builder = new UriBuilder($"task/{task.PartnerTaskId}"); return(await Client.PutRequestAsync(builder.GetUrl(), task)); }
/// <summary> /// Create New Action Log. /// </summary> /// <param name="actionLog"> the ActionLog you want to create.</param> /// <returns>The ActionLog created.</returns> public async Task <Response <ActionLog> > CreateActionLogAsync(ActionLog actionLog) { var builder = new UriBuilder("action_logs"); return(await Client.PostRequestAsync(builder.GetUrl(), actionLog)); }
/// <summary> /// /// </summary> /// <param name="task">the task you want to create.</param> /// <returns>The Response containing the created Task </returns> public async Task <Response <Task> > CreateTaskAsync(Task task) { var builder = new UriBuilder("task"); return(await Client.PostRequestAsync(builder.GetUrl(), task)); }
/// <summary> /// Update an existing contact /// </summary> /// <param name="contact"> /// Contact to update /// </param> /// <returns>a Contact response.</returns> public async Task <Response <Contact> > UpdateContactAsync(Contact contact) { var builder = new UriBuilder($"contacts/{contact.PartnerContactId}"); return(await Client.PutRequestAsync(builder.GetUrl(), contact)); }