API – Export EFT File

General

This article assumes that you have read API – Creating Autopay Query Objects.

Format

The URL to export an EFT file is as follows:

https://loanpro.simnang.com/api/public/api/1/Autopal.ExportEFTFile/1?$autopalInstanceId=<autopal instance id>&query=<query>

Replace <autopal instance id> with your Autopal instance ID. Next, replace <query> with the desired query object (remove extra whitespace and replace any remaining spaces with %20 to make it URL safe).

Examples

For example, to do an export with the query object:

{
  "aggs": {
    "avg_amount": {
      "avg": {
        "field": "amount"
      }
    },
    "sum_amount": {
      "sum": {
        "field": "amount"
      }
    }
  },
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "status": "autopay.status.cancelled"
          }
        }
      ]
    }
  }
}

The URL would look like this:

https://loanpro.simnang.com/api/public/api/1/Autopal.ExportEFTFile/1?$autopalInstanceId=myId&query={"aggs":{"avg_amount":{"avg":{"field":"amount"}},"sum_amount":{"sum":{"field":"amount"}}},"query":{"bool":{"must":[{"match":{"status":"autopay.status.cancelled"}}]}}}

To perform a request with the following query object:

{
  "aggs": {
    "avg_amount": {
      "avg": {
        "field": "amount"
      }
    },
    "sum_amount": {
      "sum": {
        "field": "amount"
      }
    }
  },
  "query": {
    "filtered": {
      "filter": {
        "range": {
          "processDateTime": {
            "gte": "2015-02-08%2000:00:00",
            "lte": "2016-05-03%2023:59:59"
          }
        }
      },
      "query": {
        "bool": {
          "must": [
            {
              "bool": {
                "should": [
                  {
                    "match": {
                      "status": "autopay.status.pending"
                    }
                  },
                  {
                    "match": {
                      "status": "autopay.status.failed"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
  }
}

The URL would be formatted as follows:

https://loanpro.simnang.com/api/public/api/1/Autopal.ExportEFTFile/1?$autopalInstanceId=myId&query={"aggs":{"avg_amount":{"avg":{"field":"amount"}},"sum_amount":{"sum":{"field":"amount"}}},"query":{"filtered":{"filter":{"range":{"processDateTime":{"gte":"2015-02-08%2000:00:00","lte":"2016-05-03%2023:59:59"}}},"query":{"bool":{"must":[{"bool":{"should":[{"match":{"status":"autopay.status.pending"}},{"match":{"status":"autopay.status.failed"}}]}}]}}}}}

Note: the gte date will end up looking like YYYY-DD-MM%2000:00:00 and the lte date will end up looking like YYYY-DD-MM%2023:59:59


How did we do?


Powered by HelpDocs (opens in a new tab)