/// <summary> /// List the accounts having transaction with effect to the given exchange rate. /// </summary> /// <param name="parameters">The parameters is the dictionary object to refine the accounts list by passing the filters as key,value pairs.<br></br> /// The following list shows the possible filter keys and the corespondent allowed values.<br></br> /// <table> /// <tr><td>currency_id</td><td>ID of currency for which we need to post adjustment.</td></tr> /// <tr><td>adjustment_date</td><td>Date of adjustment.</td></tr> /// <tr><td>exchange_rate</td><td>Exchange rate of the currency.</td></tr> /// <tr><td>notes</td><td>Notes for the base currency adjustment.</td></tr> /// </table> /// </param> /// <returns>BaseCurrencyAdjustment object.</returns> public BaseCurrencyAdjustment GetBaseCurrencyAdjustmentAccounts(Dictionary <object, object> parameters) { string url = baseAddress + "/accounts"; var responce = ZohoHttpClient.get(url, getQueryParameters(parameters)); return(BaseCurrencyAdjustmentParser.getBaseCurrencyAdjustment(responce)); }
/// <summary> /// Mark an active user as inactive. /// </summary> /// <param name="user_id">The user_id is the identifier of the user.</param> /// <returns>System.String.<br></br>The success message is "The user has been marked as inactive."</returns> public string MarkAsInactive(string user_id) { var url = baseAddress + "/" + user_id + "/inactive"; var response = ZohoHttpClient.post(url, getQueryParameters()); return(UserParser.getMessage(response)); }
/// <summary> /// Get the list of all users in the organization. /// </summary> /// <param name="parameters"> /// The parameters is the Dictionary object which conrains the filters in the form of key,value pair to refine the /// list.<br></br>The possible filters are listed below<br></br> /// <table> /// <tr> /// <td>filter_by</td> /// <td> /// Filter through users with user status.<br></br>Allowed Values: /// <i>Status.All, Status.Active, Status.Inactive, Status.Invited</i> and <i>Status.Deleted</i> /// </td> /// </tr> /// <tr> /// <td>sort_column</td> /// <td>Sort users.<br></br>Allowed Values: <i>name, email, user_role</i> and <i>status</i></td> /// </tr> /// </table> /// </param> /// <returns>UserList object.</returns> public UserList GetUsers(Dictionary <object, object> parameters) { var url = baseAddress; var response = ZohoHttpClient.get(url, getQueryParameters(parameters)); return(UserParser.getUserList(response)); }
/// <summary> /// Get the details of an organization. /// </summary> /// <param name="organization_id">The organization_id is the identifier of the organization.</param> /// <returns>Organization object.</returns> public Organization Get(string organization_id) { string url = baseAddress + "/" + organization_id; var responce = ZohoHttpClient.get(url, getQueryParameters()); return(OrganizationParser.getOrganization(responce)); }
/// <summary> /// Deletes a user associated to the organization. /// </summary> /// <param name="user_id">The user_id is the identifier of the user.</param> /// <returns>System.String.<br></br>The success message is "The user has been removed from your organization."</returns> public string Delete(string user_id) { var url = baseAddress + "/" + user_id; var response = ZohoHttpClient.delete(url, getQueryParameters()); return(UserParser.getMessage(response)); }
/// <summary> /// Marks a project as inactive. /// </summary> /// <param name="project_id">The project_id is the identifier of the project.</param> /// <returns>System.String.<br></br>The success message is "The selected projects have been marked as inactive."</returns> public string Inactivate(string project_id) { string url = baseAddress + "/" + project_id + "/inactive"; var responce = ZohoHttpClient.post(url, getQueryParameters()); return(ProjectParser.getMessage(responce)); }
/// <summary> /// Gets the details of a task. /// </summary> /// <param name="project_id">The project_id is the identifier of the project.</param> /// <param name="task_id">The task_id is the identifier of the task of specified project.</param> /// <returns>ProjectTask object.</returns> public ProjectTask GetATask(string project_id, string task_id) { string url = baseAddress + "/" + project_id + "/tasks/" + task_id; var responce = ZohoHttpClient.get(url, getQueryParameters()); return(ProjectParser.gettask(responce)); }
/// <summary> /// Deletes the receipt attached to the expense. /// </summary> /// <param name="expense_id">The expense_id is the identifier of the expense.</param> /// <returns>System.String.<br></br>The success message is "The attached expense receipt has been deleted."</returns> public string DeleteReceipt(string expense_id) { string url = baseAddress + "/" + expense_id + "/receipt"; var responce = ZohoHttpClient.delete(url, getQueryParameters()); return(ExpenseParser.getMessage(responce)); }
/// <summary> /// List expenses with pagination. /// </summary> /// <param name="parameters">The parameters is the dictionary object which contains the filters in the form of key,value pairs to refine the list.<br></br>The possible filters are listed below <br></br> /// <table> /// <tr><td>description</td><td>Search expenses by description.<br></br>Variants: <i>description_startswith</i> and <i>description_contains</i></td></tr> /// <tr><td>reference_number</td><td>Search expenses by reference number.<br></br>Variants: <i>reference_number_startswith</i> and <i>reference_number_contains</i></td></tr> /// <tr><td>date</td><td>Search expenses by expense date.<br></br>Variants: <i>date_start, date_end, date_before</i> and <i>date_after</i></td></tr> /// <tr><td>status</td><td>Search expenses by expense status.<br></br>Allowed Values: <i>unbilled, invoiced, reimbursed, non-billable</i> and <i>billable</i></td></tr> /// <tr><td>account_name</td><td>Search expenses by expense account name.<br></br>Variants: <i>account_name_startswith</i> and <i>account_name_contains</i></td></tr> /// <tr><td>amount</td><td>Search expenses by amount.<br></br>Variants: <i>amount_less_than, amount_less_equals, amount_greater_than</i> and <i>amount_greater_equals</i></td></tr> /// <tr><td>customer_name</td><td>Search expenses by customer name.<br></br>Variants: <i>customer_name_startswith</i> and <i>customer_name_contains</i></td></tr> /// <tr><td>vendor_name</td><td>Search expenses by vendor name.<br></br>Variants: <i>vendor_name_startswith</i> and <i>vendor_name_contains</i></td></tr> /// <tr><td>customer_id</td><td>Search expenses by customer id.</td></tr> /// <tr><td>vendor_id</td><td>Search expenses by vendor id.</td></tr> /// <tr><td>recurring_expense_id</td><td>Search expenses by recurring expense id.</td></tr> /// <tr><td>paid_through_account_id</td><td>Search expenses by paid through account id.</td></tr> /// <tr>filter_by<td></td><td>Filter expenses by expense status.<br></br>Allowed Values: <i>Status.All, Status.Billable, Status.Nonbillable, Status.Reimbursed, Status.Invoiced</i> and <i>Status.Unbilled</i></td></tr> /// <tr><td>search_text</td><td>Search expenses by category name or description or customer name or vendor name.</td></tr> /// <tr><td>sort_column</td><td>ort expenses.<br></br>Allowed Values: <i>date, account_name, paid_through_account_name, total, bcy_total, reference_number, customer_name, vendor_name</i> and <i>created_time</i></td></tr> /// </table> /// </param> /// <returns>ExpenseList object.</returns> public ExpenseList GetExpenses(Dictionary <object, object> parameters) { string url = baseAddress; var responce = ZohoHttpClient.get(url, getQueryParameters(parameters)); return(ExpenseParser.getExpenseList(responce)); }
/// <summary> /// Get history and comments of an expense. /// </summary> /// <param name="expense_id">The expense_id is the identifier of the expense.</param> /// <returns>List of Comment object.</returns> public CommentList GetComments(string expense_id) { string url = baseAddress + "/" + expense_id + "/comments";; var responce = ZohoHttpClient.get(url, getQueryParameters()); return(CreditNoteParser.getCommentList(responce)); }
//--------------------------------------------------------------------------------------------------- /// <summary> /// Returns the receipt attached to the expense. /// </summary> /// <param name="expense_id">The expense_id is the identifier of the expense.</param> /// <param name="parameters">The parameters is the dictionary object which contains the preview(bool value) parameter as a key,value pair.</param> /// <returns>System.String.<br></br>The success message is "the selected expense receipt is saved at home directory"</returns> public string GetReceipt(string expense_id, Dictionary <object, object> parameters) { string url = baseAddress + "/" + expense_id + "/receipt"; ZohoHttpClient.getFile(url, getQueryParameters(parameters)); return("the selected expense receipt is saved at home directory"); }
/// <summary> /// Gets the details of a recurring expense. /// </summary> /// <param name="recurring_expense_id">The recurring_expense_id is the identifier of the recurrence expnse.</param> /// <returns>RecurringExpense object.</returns> public RecurringExpense Get(string recurring_expense_id) { string url = baseAddress + "/" + recurring_expense_id; var responce = ZohoHttpClient.get(url, getQueryParameters()); return(RecurringExpenseParser.getRecurringExpense(responce)); }
/// <summary> /// List child expenses created from recurring expense. /// </summary> /// <param name="recurring_expense_id">The recurring_expense_id is the identifier of the recurrence expnse.</param> /// <param name="parameters">The parameters is the Dictionary object which contains the following optional parameter in the form of key,value pair.<br></br> /// <table><tr><td>sort_column</td><td>Sort child expenses created.<br></br>Allowed Values: <i>date, account_name, vendor_name, paid_through_account_name, customer_name</i> and <i>total</i></td></tr></table> /// </param> /// <returns>List of Expense object.</returns> public ExpenseList GetExpensesCreated(string recurring_expense_id, Dictionary <object, object> parameters) { string url = baseAddress + "/" + recurring_expense_id + "/expenses"; var responce = ZohoHttpClient.get(url, getQueryParameters(parameters)); return(RecurringExpenseParser.getExpenseHistory(responce)); }
/// <summary> /// Resume a stopped recurring expense. /// </summary> /// <param name="recurring_expense_id">The recurring_expense_id is the identifier of the recurrence expnse.</param> /// <returns>System.String.<br></br>The success message is "The recurring expense has been activated."</returns> public string Resume(string recurring_expense_id) { string url = baseAddress + "/" + recurring_expense_id + "/status/resume"; var responce = ZohoHttpClient.post(url, getQueryParameters()); return(RecurringExpenseParser.getMessage(responce)); }
/// <summary> /// Gets the details of the current user. /// </summary> /// <returns>User object.</returns> public User GetCurrentUser() { var url = baseAddress + "/me"; var response = ZohoHttpClient.get(url, getQueryParameters()); return(ProjectParser.getUser(response)); }
/// <summary> /// Get the details of an expense. /// </summary> /// <param name="expense_id">The expense_id is the identifier of the expense.</param> /// <returns>Expense object.</returns> public Expense Get(string expense_id) { string url = baseAddress + "/" + expense_id; var responce = ZohoHttpClient.get(url, getQueryParameters()); return(ExpenseParser.getExpense(responce)); }
/// <summary> /// Deletes the existing project. /// </summary> /// <param name="project_id">The project_id is the identifier of the project.</param> /// <returns>System.String.<br></br>The success message is "The project has been deleted".</returns> public string Delete(string project_id) { string url = baseAddress + "/" + project_id; var responce = ZohoHttpClient.delete(url, getQueryParameters()); return(ProjectParser.getMessage(responce)); }
/// <summary> /// Get the list of organizations. /// </summary> /// <returns>List of Organization objects.</returns> public OrganizationList GetOrganizations() { string url = baseAddress; var response = ZohoHttpClient.get(url, getQueryParameters()); return(OrganizationParser.getOrganizationList(response)); }
//-------------------------------------------------------------------------------------- /// <summary> /// Get list of tasks added to a project. /// </summary> /// <param name="project_id">The project_id is the identifier of the project.</param> /// <param name="parameters">The parameters is the Dictionary object which contains the filters in the form of key,value pair to refine the list.<br></br>The possible filters are listed below<br></br> /// <table> /// <tr><td>sort_column</td><td>Sort tasks<br></br>Allowed Values: <i>task_name, billed_hours, log_time</i> and <i>un_billed_hours</i></td></tr> /// </table> /// </param> /// <returns>TasksList object.</returns> public TaskList GetTasks(string project_id, Dictionary <object, object> parameters) { string url = baseAddress + "/" + project_id + "/tasks"; var responce = ZohoHttpClient.get(url, getQueryParameters(parameters)); return(ProjectParser.gatTaskList(responce)); }
/// <summary> /// Gets the details of a user. /// </summary> /// <param name="user_id">The user_id is the identifier of the user.</param> /// <returns>User object.</returns> public User Get(string user_id) { var url = baseAddress + "/" + user_id; var response = ZohoHttpClient.get(url, getQueryParameters()); return(ProjectParser.getUser(response)); }
/// <summary> /// Gets the specified base currency adjustment details. /// </summary> /// <param name="base_currency_adjustment_id">The base_currency_adjustment_id is the identifier of the base currency adjustment.</param> /// <returns>BaseCurrencyAdjustment object.</returns> public BaseCurrencyAdjustment Get(string base_currency_adjustment_id) { string url = baseAddress + "/" + base_currency_adjustment_id; var responce = ZohoHttpClient.get(url, getQueryParameters()); return(BaseCurrencyAdjustmentParser.getBaseCurrencyAdjustment(responce)); }
/// <summary> /// Gets the matching transactions based on the provided criteria. /// </summary> /// <param name="transaction_id">The transaction_id is the transaction identifier to get the matching transactions of it.</param> /// <param name="parameters"> /// The parameters is the dictionary object,it contains the match criteria in the form of key value pairs.<br></br> /// The parameters contains the below listed possible keys and the corespondent values /// <table> /// <tr> /// <td>transaction_type</td> /// <td> /// The type of transaction.<br></br>Allowed Values: /// <i> /// expense, deposit, refund, transfer_fund, card_payment, sales_without_invoices, expense_refund, /// owner_contribution, interest_income, other_income, owner_drawings, invoice, bill, credit_notes, /// creditnote_refund, customer_payment /// </i> /// and <i>vendor_payment</i> /// </td> /// </tr> /// <tr> /// <td>date</td> /// <td> /// Start and end date, to provide a range within which the transaction date exist.<br></br>Variants: /// date_start and date_end /// </td> /// </tr> /// <tr> /// <td>amount</td> /// <td> /// Initial and final amount range within which the search amount exists.<br></br>Variants: amount_start /// and amount_end /// </td> /// </tr> /// <tr> /// <td>contact</td><td>Contact person name, involved in the transaction.</td> /// </tr> /// <tr> /// <td>reference_number</td><td>Reference Number of the transaction.</td> /// </tr> /// </table> /// </param> /// <returns>MatchingTransactions object.</returns> public MatchingTransactions GetMatchingTransactions(string transaction_id, Dictionary <object, object> parameters) { var url = baseAddress + "/uncategorized/" + transaction_id + "/match"; var responce = ZohoHttpClient.get(url, getQueryParameters(parameters)); return(BankTransactionParser.getMatchingTransactions(responce)); }
/// <summary> /// Unmatches the transaction that was previously matched and make it uncategorized.. /// </summary> /// <param name="transaction_id">The transaction_id is the identifer of the transaction which is going to be uncatogirised.</param> /// <returns>System.String.<br></br>The success message is "The transaction has been unmatched."</returns> public string UnmatchTransaction(string transaction_id) { var url = baseAddress + "/" + transaction_id + "/unmatch"; var responce = ZohoHttpClient.post(url, getQueryParameters()); ; return(BankTransactionParser.getMessage(responce)); }
/// <summary> /// List all involved transactions for the given account. /// </summary> /// <param name="parameters">The parameters is dictionary object which is containg the filters to refine the list in the form of key,value pairs.<br></br>The possible filter keys and coresponded allowed values are listed below<br></br> /// <table> /// <tr><td>account_id</td><td>ID of the account. List all transactions involved this account.</td></tr> /// <tr><td>date</td><td>Search account transactions with the given date range. Default date format is yyyy-mm-dd.<br></br>Variants: <i>date.start, date.end, date.before</i> and <i>date.after</i></td></tr> /// <tr><td>amount</td><td>Search account transactions with given amount range.<br></br>Variants: <i>amount.less_than, amount.less_equals, amount.greater_than</i> and <i>amount.greater_equals</i></td></tr> /// <tr><td>filter_by</td><td>Filter transactions based on its type.<br></br>Allowed Values: <i>TransactionType.All, TransactionType.BaseCurrencyAdjustment, TransactionType.Bills, TransactionType.VendorPayment, TransactionType.CardPayment, TransactionType.CreditNotes, TransactionType.CreditNoteRefund, TransactionType.Deposit, TransactionType.Expense, TransactionType.Invoice, TransactionType.Journal, TransactionType.CustomerPayment, TransactionType.TransferFund</i> and <i>TransactionType.OpeningBalance</i></td></tr> /// <tr><td>transaction_type</td><td>Search transactions based on the given transaction type.<br></br>Allowed Values: <i>invoice, customer_payment, bills, vendor_payment, credit_notes, creditnote_refund, expense, card_payment, purchase_or_charges, journal, deposit, refund, transfer_fund, base_currency_adjustment, opening_balance, sales_without_invoices, expense_refund, tax_refund, receipt_from_initial_debtors, owner_contribution, interest_income, other_income, owner_drawings</i> and <i>payment_to_initial_creditors</i></td></tr> /// <tr><td>sort_column</td><td>Sort transactions.<br></br>Allowed Values: <i>transaction_date, payee, glname, transaction_type_formatted, reconcile_status, debit_amount</i> and <i>credit_amount</i></td></tr> /// </table> /// </param> /// <returns>TransactionList object.</returns> public TransactionList GetTransactions(Dictionary <object, object> parameters) { string url = getBaseAddress() + "/transactions"; var responce = ZohoHttpClient.get(url, getQueryParameters(parameters)); Console.WriteLine(responce.Content.ReadAsStringAsync().Result); return(ChartofaccountParser.getTransactionList(responce)); }
/// <summary> /// Deletes the transaction. /// </summary> /// <param name="transaction_id">The transaction_id is the identifier of the specified transaction.</param> /// <returns>System.String.<br></br>The success message is "The transaction has been deleted."</returns> public string DeleteATransaction(string transaction_id) { string url = getBaseAddress() + "/transactions/" + transaction_id; var responce = ZohoHttpClient.delete(url, getQueryParameters()); Console.WriteLine(responce.Content.ReadAsStringAsync().Result); return(ChartofaccountParser.getMessage(responce)); }
/// <summary> /// Gets the contact person details. /// </summary> /// <param name="contact_person_id">The contact_person_id is the identifier of the contact person.</param> /// <returns>ContactPerson object.</returns> public ContactPerson GetContactPerson(string contact_id, string contact_person_id) { var url = baseAddress + "/" + contact_id + "/contactpersons/" + contact_person_id; var responce = ZohoHttpClient.get(url, getQueryParameters()); Console.WriteLine(responce.Content.ReadAsStringAsync().Result); return(ContactParser.getContactPerson(responce)); }
/// <summary> /// Deletes an estimate comment. /// </summary> /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param> /// <param name="comment_id">The comment_id is the identifier of the comment.</param> /// <returns>System.String.<br></br>The success message is "The comment has been deleted."</returns> public string DeleteComment(string estimate_id, string comment_id) { string url = baseAddress + "/" + estimate_id + "/comments/" + comment_id;; var responce = ZohoHttpClient.delete(url, getQueryParameters()); StringBuilder queryString = new StringBuilder(); return(EstimateParser.getMessage(responce)); }
/// <summary> /// Mark a sent estimate as declined if the customer has rejected it. /// </summary> /// <param name="estimate_id">The estimate_id is the identifier of the estimate.</param> /// <returns>System.String.<br></br>The success message is "Estimate status has been changed to Declined."</returns> public string MarkAsDeclined(string estimate_id) { string url = baseAddress + "/" + estimate_id + "/status/declined"; var responce = ZohoHttpClient.post(url, getQueryParameters()); var responceContent = responce.Content.ReadAsStringAsync().Result; return(EstimateParser.getMessage(responce)); }
/// <summary> /// Deletes the comment. /// </summary> /// <param name="purchaseorder_id">The purchaseorder_id.</param> /// <param name="comment_id">The comment_id.</param> /// <returns>System.String.</returns> public string DeleteComment(string purchaseorder_id, string comment_id) { var url = baseAddress + "/" + purchaseorder_id + "/comments/" + comment_id; var response = ZohoHttpClient.delete(url, getQueryParameters()); Console.WriteLine(response.Content.ReadAsStringAsync().Result); return(PurchaseorderParser.getMessage(response)); }
//-------------------------------------------------------------------------------------- /// <summary> /// Gets the comments. /// </summary> /// <param name="purchaseorder_id">The purchaseorder_id.</param> /// <returns>CommentList.</returns> public CommentList GetComments(string purchaseorder_id) { var url = baseAddress + "/" + purchaseorder_id + "/comments"; var response = ZohoHttpClient.get(url, getQueryParameters()); Console.WriteLine(response.Content.ReadAsStringAsync().Result); return(PurchaseorderParser.getCommentList(response)); }