# NOTE: This file is auto generated by OpenAPI Generator 7.12.0 (https://openapi-generator.tech). # Do not edit this file manually. defmodule DocuSign.Api.PowerFormData do @moduledoc """ API calls for all endpoints tagged `PowerFormData`. """ import DocuSign.RequestBuilder alias DocuSign.Connection alias DocuSign.Model.ErrorDetails alias DocuSign.Model.PowerFormsFormDataResponse @doc """ Returns the data that users entered in a PowerForm. This method enables Powerform Administrators or the sender of a PowerForm to download the data that recipients have entered into a PowerForm. You specify the format in which you want to retrieve the data in the `Accept` header. This header accepts the following values: - `application/json`: JSON format - `application/xml`: XML format - `text/csv`: Comma-separated value (CSV) format You can further specify the type of CSV format in the `data_layout` query parameter. **Note:** Only PowerForm Administrators or the PowerForm Sender can download the data associated with a PowerForm. ### Parameters - `connection` (DocuSign.Connection): Connection to server - `account_id` (String.t): The external account number (int) or account ID GUID. - `power_form_id` (String.t): The ID of the PowerForm. - `opts` (keyword): Optional parameters - `:data_layout` (String.t): The layout in which to return the PowerForm data. For each of the following layouts, set the `Accept` header to the corresponding value. Valid values are: - `Native` (Set `Accept` header to `application/json`) - `Csv_Classic` (Set `Accept` header to `application/csv`) - `Csv_One_Envelope_Per_Line` (Set `Accept` header to `text/csv`) - `Xml_Classic` (Set `Accept` header to `application/xml`) - `:from_date` (String.t): The start date for a date range in UTC DateTime format. **Note:** If this property is null, no date filtering is applied. - `:to_date` (String.t): The end date of a date range in UTC DateTime format. The default value is `UtcNow`. ### Returns - `{:ok, DocuSign.Model.PowerFormsFormDataResponse.t}` on success - `{:error, Tesla.Env.t}` on failure """ @spec power_forms_get_power_form_form_data( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, ErrorDetails.t()} | {:ok, PowerFormsFormDataResponse.t()} | {:error, Tesla.Env.t()} def power_forms_get_power_form_form_data(connection, account_id, power_form_id, opts \\ []) do optional_params = %{ :data_layout => :query, :from_date => :query, :to_date => :query } request = %{} |> method(:get) |> url("/v2.1/accounts/#{account_id}/powerforms/#{power_form_id}/form_data") |> add_optional_params(optional_params, opts) |> Enum.to_list() connection |> Connection.request(request) |> evaluate_response([ {200, PowerFormsFormDataResponse}, {400, ErrorDetails} ]) end end