MPDX Developers
HomeHelp
Production
Production
  • Changelog
  • README
  • org_data_transfer
  • README
    • README
      • Account Lists
        • :Account List
        • Analytics
        • Chalkline Mail
        • Coaches
        • Designation Accounts
        • Donations
        • Donor Accounts
        • Entries
        • Financial Accounts
        • Imports
          • Csv
          • Google
          • Tnt
          • Tnt Data Sync
        • Invites
        • Mail Chimp Account
        • Merge
        • Notification Preferences
          • Bulk
        • Notifications
        • Pledges
        • Prayer Letters Account
        • Users
        • :account_list_id
          • Donations
        • :account_list_id
          • donations
            • Bulk
      • README
        • Impersonation
        • Organizations
        • Resets
      • Announcements
      • Appeals
        • Appeal Contacts
          • Bulk
        • Excluded Appeal Contacts
          • Bulk
      • Background Batches
      • Batch
      • Coaching
        • Answer Sets
        • Answers
        • Questions
      • Constants
      • Contacts
        • Addresses
        • Alma Mater Names
        • Analytics
        • Bulk
        • Church Names
        • Duplicates
        • README
        • Exports
          • Mailing
        • Filters
        • Merges
        • Partner Giving Analysis Filters
        • People
          • Bulk
          • Email Addresses
          • Facebook Accounts
          • Linkedin Accounts
          • Merges
          • Phones
          • Relationships
          • Twitter Accounts
          • Websites
        • Referrals
        • Referrers
        • Tags
          • Bulk
      • Deleted Records
      • Organizations
        • Account Lists
          • Account List Coaches
          • Account List Users
          • Invites
        • Admins
        • Contacts
        • Impersonation
        • Invites
      • Public
        • Designation Accounts
          • Subscriptions
      • README
        • Activity Results
        • Appointment Results
        • Donation Histories
        • Donation Monthly Totals
        • Donor Currency Donations
        • Entry Histories
        • Expected Monthly Totals
        • Goal Progress
        • Monthly Giving Graph
        • Monthly Losses Graphs
        • Partner Giving Analysis
        • People With Anniversaries
        • People With Birthdays
        • Pledge Histories
        • Salary Currency Donations
        • Tag Histories
        • Year Donations
      • Tasks
        • Analytics
        • Comments
        • Filters
        • Tags
      • README
        • Analytics
      • User
        • Account List Coaches
        • Announcements
        • Authenticate
        • Devices
        • Google Accounts
          • Google Integrations
        • Key Accounts
        • Notifications
        • Options
        • Organization Accounts
Powered by GitBook
On this page
  • CSV Import [LIST]
  • Request
  • Response
  • CSV Import [GET]
  • Request
  • Response
  • CSV Import [CREATE]
  • Request
  • Response
  • CSV Import [UPDATE]
  • Request
  • Response
  1. README
  2. README
  3. Account Lists
  4. Imports

Csv

Csv Documentation

CSV Import [LIST]

List of CSV Imports associated with the Account List

Request

Endpoint

GET /api/v2/account_lists/2c790005-2b66-4a82-a285-a2df94703a17/imports/csv
Content-Type: multipart/form-data

Body

Response

Headers

Content-Type: application/vnd.api+json; charset=utf-8
200 OK

Body

{
  "data": [
    {
      "id": "7a307798-c5bb-450b-bf50-46d6b99926d7",
      "type": "imports",
      "attributes": {
        "account_list_id": "2c790005-2b66-4a82-a285-a2df94703a17",
        "created_at": "2022-01-12T17:18:35Z",
        "file_constants": {
        },
        "file_constants_mappings": {
          "status": [
            {
              "id": "Partner - Financial",
              "values": [
                "Praying and giving"
              ]
            }
          ],
          "pledge_frequency": [
            {
              "id": "1.0",
              "values": [
                "Monthly"
              ]
            }
          ],
          "newsletter": [
            {
              "id": "Both",
              "values": [
                "Both"
              ]
            }
          ]
        },
        "file_headers": {
        },
        "file_headers_mappings": {
          "city": "city",
          "pledge_amount": "amount",
          "pledge_frequency": "frequency",
          "contact_name": "fname",
          "country": "country",
          "email_1": "email_address",
          "envelope_greeting": "envelope_greeting",
          "first_name": "fname",
          "greeting": "greeting",
          "last_name": "lname",
          "newsletter": "newsletter",
          "notes": "extra_notes",
          "phone_1": "phone",
          "spouse_email": "spouse_email_address",
          "spouse_first_name": "spouse_fname",
          "spouse_last_name": "spouse_lname",
          "spouse_phone": "spouse_phone_number",
          "state": "province",
          "status": "status",
          "street": "street",
          "zip": "zip_code"
        },
        "file_url": "http://api.mpdx.test/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhkV0oxWkhGbWQzazFOVFZtWW5Kc00zWXlNbXRxTURObU16SnliZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWDJGMGRHRmphRzFsYm5RN0lHWnBiR1Z1WVcxbFBTSnpZVzF3YkdWZlkzTjJYM1J2WDJsdGNHOXlkQzVqYzNZaU95Qm1hV3hsYm1GdFpTbzlWVlJHTFRnbkozTmhiWEJzWlY5amMzWmZkRzlmYVcxd2IzSjBMbU56ZGdZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraUQzUmxlSFF2Y0d4aGFXNEdPd1pVT2hGelpYSjJhV05sWDI1aGJXVTZDWFJsYzNRPSIsImV4cCI6IjIwMjItMDEtMTJUMTc6MjM6MzVaIiwicHVyIjoiYmxvYl9rZXkifX0=--a4db7aa9ca1378192c5435f24e843b44061defe2/sample_csv_to_import.csv",
        "group_tags": null,
        "groups": [

        ],
        "import_by_group": false,
        "in_preview": true,
        "override": false,
        "source": "csv",
        "tag_list": null,
        "updated_at": "2022-01-12T17:18:35Z",
        "updated_in_db_at": "2022-01-12T17:18:35Z"
      },
      "relationships": {
        "user": {
          "data": {
            "id": "2c34a842-4b04-47fd-9399-d558c7322a7f",
            "type": "users"
          }
        },
        "sample_contacts": {
          "data": [

          ]
        }
      }
    },
    {
      "id": "1dc92edd-28e9-4d7e-a539-dfe37416058d",
      "type": "imports",
      "attributes": {
        "account_list_id": "2c790005-2b66-4a82-a285-a2df94703a17",
        "created_at": "2022-01-12T17:18:35Z",
        "file_constants": {
        },
        "file_constants_mappings": {
          "status": [
            {
              "id": "Partner - Financial",
              "values": [
                "Praying and giving"
              ]
            }
          ],
          "pledge_frequency": [
            {
              "id": "1.0",
              "values": [
                "Monthly"
              ]
            }
          ],
          "newsletter": [
            {
              "id": "Both",
              "values": [
                "Both"
              ]
            }
          ]
        },
        "file_headers": {
        },
        "file_headers_mappings": {
          "city": "city",
          "pledge_amount": "amount",
          "pledge_frequency": "frequency",
          "contact_name": "fname",
          "country": "country",
          "email_1": "email_address",
          "envelope_greeting": "envelope_greeting",
          "first_name": "fname",
          "greeting": "greeting",
          "last_name": "lname",
          "newsletter": "newsletter",
          "notes": "extra_notes",
          "phone_1": "phone",
          "spouse_email": "spouse_email_address",
          "spouse_first_name": "spouse_fname",
          "spouse_last_name": "spouse_lname",
          "spouse_phone": "spouse_phone_number",
          "state": "province",
          "status": "status",
          "street": "street",
          "zip": "zip_code"
        },
        "file_url": "http://api.mpdx.test/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhiV0Z2WVhkeGNIZDBNemg0YVdWMmJERmxiM0pqYjJKNU5IVnRNZ1k2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWDJGMGRHRmphRzFsYm5RN0lHWnBiR1Z1WVcxbFBTSnpZVzF3YkdWZlkzTjJYM1J2WDJsdGNHOXlkQzVqYzNZaU95Qm1hV3hsYm1GdFpTbzlWVlJHTFRnbkozTmhiWEJzWlY5amMzWmZkRzlmYVcxd2IzSjBMbU56ZGdZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraUQzUmxlSFF2Y0d4aGFXNEdPd1pVT2hGelpYSjJhV05sWDI1aGJXVTZDWFJsYzNRPSIsImV4cCI6IjIwMjItMDEtMTJUMTc6MjM6MzVaIiwicHVyIjoiYmxvYl9rZXkifX0=--a9b9a96abf34202736823219d00e9f9d82477ff1/sample_csv_to_import.csv",
        "group_tags": null,
        "groups": [

        ],
        "import_by_group": false,
        "in_preview": true,
        "override": false,
        "source": "csv",
        "tag_list": null,
        "updated_at": "2022-01-12T17:18:35Z",
        "updated_in_db_at": "2022-01-12T17:18:35Z"
      },
      "relationships": {
        "user": {
          "data": {
            "id": "2c34a842-4b04-47fd-9399-d558c7322a7f",
            "type": "users"
          }
        },
        "sample_contacts": {
          "data": [

          ]
        }
      }
    }
  ],
  "meta": {
    "pagination": {
      "page": 1,
      "per_page": 25,
      "total_count": 2,
      "total_pages": 1
    },
    "sort": null,
    "filter": {
    }
  }
}

CSV Import [GET]

The Import with the given ID

Request

Endpoint

GET /api/v2/account_lists/d9485262-18d3-4120-9e55-983a823d1850/imports/csv/80e6e826-6fc7-436a-ac03-ab8dbc7f5a51
Content-Type: multipart/form-data

Body

Response

Headers

Content-Type: application/vnd.api+json; charset=utf-8
200 OK

Body

{
  "data": {
    "id": "80e6e826-6fc7-436a-ac03-ab8dbc7f5a51",
    "type": "imports",
    "attributes": {
      "account_list_id": "d9485262-18d3-4120-9e55-983a823d1850",
      "created_at": "2022-01-12T17:18:36Z",
      "file_constants": {
      },
      "file_constants_mappings": {
        "status": [
          {
            "id": "Partner - Financial",
            "values": [
              "Praying and giving"
            ]
          }
        ],
        "pledge_frequency": [
          {
            "id": "1.0",
            "values": [
              "Monthly"
            ]
          }
        ],
        "newsletter": [
          {
            "id": "Both",
            "values": [
              "Both"
            ]
          }
        ]
      },
      "file_headers": {
      },
      "file_headers_mappings": {
        "city": "city",
        "pledge_amount": "amount",
        "pledge_frequency": "frequency",
        "contact_name": "fname",
        "country": "country",
        "email_1": "email_address",
        "envelope_greeting": "envelope_greeting",
        "first_name": "fname",
        "greeting": "greeting",
        "last_name": "lname",
        "newsletter": "newsletter",
        "notes": "extra_notes",
        "phone_1": "phone",
        "spouse_email": "spouse_email_address",
        "spouse_first_name": "spouse_fname",
        "spouse_last_name": "spouse_lname",
        "spouse_phone": "spouse_phone_number",
        "state": "province",
        "status": "status",
        "street": "street",
        "zip": "zip_code"
      },
      "file_url": "http://api.mpdx.test/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhiV2h3TjNWbmQyUnJiVEZyYzNad01XdHFNRGxrY21Wdk9EVm9aUVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpWDJGMGRHRmphRzFsYm5RN0lHWnBiR1Z1WVcxbFBTSnpZVzF3YkdWZlkzTjJYM1J2WDJsdGNHOXlkQzVqYzNZaU95Qm1hV3hsYm1GdFpTbzlWVlJHTFRnbkozTmhiWEJzWlY5amMzWmZkRzlmYVcxd2IzSjBMbU56ZGdZN0JsUTZFV052Ym5SbGJuUmZkSGx3WlVraUQzUmxlSFF2Y0d4aGFXNEdPd1pVT2hGelpYSjJhV05sWDI1aGJXVTZDWFJsYzNRPSIsImV4cCI6IjIwMjItMDEtMTJUMTc6MjM6MzZaIiwicHVyIjoiYmxvYl9rZXkifX0=--2c587d7aea3dadd6e4e2b5f95d9b3c51bc233103/sample_csv_to_import.csv",
      "group_tags": null,
      "groups": [

      ],
      "import_by_group": false,
      "in_preview": true,
      "override": false,
      "source": "csv",
      "tag_list": null,
      "updated_at": "2022-01-12T17:18:36Z",
      "updated_in_db_at": "2022-01-12T17:18:36Z"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "1ce92a9e-833c-4bda-a297-38c7f2b5743e",
          "type": "users"
        }
      },
      "sample_contacts": {
        "data": [

        ]
      }
    }
  }
}

CSV Import [CREATE]

Creates a new CSV Import associated with the Account List. This endpoint expects a CSV file to be uploaded using Content-Type "multipart/form-data", this makes the endpoint unique in that it does not expect only JSON content. Unless otherwise specified, the Import will be created with "in_preview" set to true.

A CSV Import is expected to take multiple steps to setup:

1. The first step is to create a new Import via a POST request, the client can upload the CSV file in the POST request using "multipart/form-data". If the file upload is successful then the file_headers and file_constants will be returned to the client in the response.

2. In the second step the client is expected to update (via PUT) the file_headers_mappings according to the user's desire (based on the file_headers). This step could take several attempts.

3. In the third step the client is expected to update (via PUT) the file_constants_mappings according to the user's desire (based on the file_constants). This step could take several attempts.

4. The fourth step is to show a sample of the import to the user. The sample_contacts relationship should be used.

5. The fifth step is to start the import. The client is expected to update (via PUT) the "in_preview" attribute to "false", which will trigger the import to begin (as a background job). If the mappings are incorrect or incomplete, or the record is otherwise invalid, then the import will not begin and an error object will be returned instead.

Request

Endpoint

POST /api/v2/account_lists/c6e6aed5-3bae-48ca-bdae-7cfa0763b492/imports/csv
Content-Type: multipart/form-data; boundary=----------XnJLe9ZIbbGUYtzPQJ16u1

Body

------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][city]"

city
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][pledge_amount]"

amount
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][pledge_frequency]"

frequency
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][contact_name]"

fname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][country]"

country
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][email_1]"

email_address
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][envelope_greeting]"

envelope_greeting
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][first_name]"

fname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][greeting]"

greeting
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][last_name]"

lname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][newsletter]"

newsletter
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][notes]"

extra_notes
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][phone_1]"

phone
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][spouse_email]"

spouse_email_address
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][spouse_first_name]"

spouse_fname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][spouse_last_name]"

spouse_lname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][spouse_phone]"

spouse_phone_number
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][state]"

province
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][status]"

status
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][street]"

street
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][zip]"

zip_code
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][status][][id]"

Partner - Financial
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][status][][values][]"

Praying and giving
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][pledge_frequency][][id]"

1.0
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][pledge_frequency][][values][]"

Monthly
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][newsletter][][id]"

Both
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][newsletter][][values][]"

Both
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][created_at]"

2022-01-12 17:18:36 UTC
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][error]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file]"; filename="sample_csv_with_custom_headers.csv"
Content-Type: text/plain
Content-Length: 1056

[uploaded data]
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][group_tags]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][import_by_group]"

false
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][import_completed_at]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][import_started_at]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][importing]"

false
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][override]"

false
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][queued_for_import_at]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][source]"

csv
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][tags]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][updated_at]"

2022-01-12 17:18:36 UTC
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][updated_in_db_at]"

2022-01-12 17:18:36 UTC
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[type]"

imports
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[relationships][account_list][data][type]"

account_lists
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[relationships][account_list][data][id]"

c6e6aed5-3bae-48ca-bdae-7cfa0763b492
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[relationships][user][data][type]"

users
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[relationships][user][data][id]"

98250590-fa83-4b0b-a656-f6e909456d8d
------------XnJLe9ZIbbGUYtzPQJ16u1--

Response

Headers

Content-Type: application/vnd.api+json; charset=utf-8
201 Created

Body

{
  "data": {
    "id": "325b8f22-3496-4b41-bb0b-001a70d42be1",
    "type": "imports",
    "attributes": {
      "account_list_id": "c6e6aed5-3bae-48ca-bdae-7cfa0763b492",
      "created_at": "2022-01-12T17:18:36Z",
      "file_constants": {
        "greeting": [
          "Hi John and Jane",
          "Hello!",
          ""
        ],
        "status": [
          "Praying",
          "Praying and giving"
        ],
        "amount": [
          "50",
          "10",
          ""
        ],
        "frequency": [
          "Monthly",
          ""
        ],
        "currency": [
          "CAD",
          ""
        ],
        "newsletter": [
          "Both"
        ],
        "skip": [
          "No",
          "Yes",
          ""
        ],
        "likely_giver": [
          "Yes",
          "No"
        ],
        "appeals": [
          "Yes",
          "No"
        ]
      },
      "file_constants_mappings": {
        "status": [
          {
            "id": "Partner - Financial",
            "values": [
              "Praying and giving"
            ]
          }
        ],
        "pledge_frequency": [
          {
            "id": "1.0",
            "values": [
              "Monthly"
            ]
          }
        ],
        "newsletter": [
          {
            "id": "Both",
            "values": [
              "Both"
            ]
          }
        ]
      },
      "file_headers": {
        "fullname": "fullname",
        "fname": "fname",
        "lname": "lname",
        "spouse_fname": "Spouse-fname",
        "spouse_lname": "Spouse-lname",
        "greeting": "greeting",
        "mailing_greeting": "mailing-greeting",
        "church": "church",
        "street": "street",
        "city": "city",
        "province": "province",
        "zip_code": "zip-code",
        "country": "country",
        "status": "status",
        "amount": "amount",
        "frequency": "frequency",
        "currency": "currency",
        "newsletter": "newsletter",
        "tags": "tags",
        "email_address": "email-address",
        "spouse_email_address": "Spouse-email-address",
        "phone": "phone",
        "spouse_phone_number": "Spouse-phone-number",
        "extra_notes": "extra-notes",
        "skip": "skip",
        "likely_giver": "likely-giver",
        "metro": "metro",
        "region": "region",
        "appeals": "appeals",
        "website": "website",
        "referred_by": "referred_by",
        "relationship_code": "relationship_code"
      },
      "file_headers_mappings": {
        "city": "city",
        "pledge_amount": "amount",
        "pledge_frequency": "frequency",
        "contact_name": "fname",
        "country": "country",
        "email_1": "email_address",
        "envelope_greeting": "envelope_greeting",
        "first_name": "fname",
        "greeting": "greeting",
        "last_name": "lname",
        "newsletter": "newsletter",
        "notes": "extra_notes",
        "phone_1": "phone",
        "spouse_email": "spouse_email_address",
        "spouse_first_name": "spouse_fname",
        "spouse_last_name": "spouse_lname",
        "spouse_phone": "spouse_phone_number",
        "state": "province",
        "status": "status",
        "street": "street",
        "zip": "zip_code"
      },
      "file_url": "http://api.mpdx.test/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhkamQzTVRoeE9HZG1NWFpxTURod2FuRnhkR1E0Y0hNeWJXcDNOUVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpYzJGMGRHRmphRzFsYm5RN0lHWnBiR1Z1WVcxbFBTSnpZVzF3YkdWZlkzTjJYM2RwZEdoZlkzVnpkRzl0WDJobFlXUmxjbk11WTNOMklqc2dabWxzWlc1aGJXVXFQVlZVUmkwNEp5ZHpZVzF3YkdWZlkzTjJYM2RwZEdoZlkzVnpkRzl0WDJobFlXUmxjbk11WTNOMkJqc0dWRG9SWTI5dWRHVnVkRjkwZVhCbFNTSVBkR1Y0ZEM5d2JHRnBiZ1k3QmxRNkVYTmxjblpwWTJWZmJtRnRaVG9KZEdWemRBPT0iLCJleHAiOiIyMDIyLTAxLTEyVDE3OjIzOjM2WiIsInB1ciI6ImJsb2Jfa2V5In19--a160fe1b3486bf0f88fc495a3be11d125189a8a8/sample_csv_with_custom_headers.csv",
      "group_tags": null,
      "groups": [

      ],
      "import_by_group": false,
      "in_preview": true,
      "override": false,
      "source": "csv",
      "tag_list": null,
      "updated_at": "2022-01-12T17:18:36Z",
      "updated_in_db_at": "2022-01-12T17:18:36Z"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "98250590-fa83-4b0b-a656-f6e909456d8d",
          "type": "users"
        }
      },
      "sample_contacts": {
        "data": [
          {
            "id": "14456e33-303d-40d7-ae73-711fa879d225",
            "type": "contacts"
          },
          {
            "id": "7edfbaeb-2f14-42ee-9dc0-81fb48292fd3",
            "type": "contacts"
          },
          {
            "id": "8955aceb-2e7a-4c7a-82f8-182ebb1601bc",
            "type": "contacts"
          }
        ]
      }
    }
  }
}

CSV Import [UPDATE]

Update a CSV Import associated with the Account List. For more details regarding the CSV Import see the description on the create request.

Request

Endpoint

PUT /api/v2/account_lists/0ef35971-210d-48ec-9e09-abd619fbc530/imports/csv/cdc86b7c-0ba9-4934-ba30-3866feebeb8f
Content-Type: multipart/form-data; boundary=----------XnJLe9ZIbbGUYtzPQJ16u1

Body

------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][city]"

city
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][pledge_amount]"

amount
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][pledge_frequency]"

frequency
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][contact_name]"

fname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][country]"

country
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][email_1]"

email_address
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][envelope_greeting]"

envelope_greeting
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][first_name]"

fname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][greeting]"

greeting
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][last_name]"

lname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][newsletter]"

newsletter
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][notes]"

extra_notes
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][phone_1]"

phone
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][spouse_email]"

spouse_email_address
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][spouse_first_name]"

spouse_fname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][spouse_last_name]"

spouse_lname
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][spouse_phone]"

spouse_phone_number
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][state]"

province
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][status]"

status
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][street]"

street
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_headers_mappings][zip]"

zip_code
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][status][][id]"

Partner - Financial
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][status][][values][]"

Praying and giving
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][pledge_frequency][][id]"

1.0
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][pledge_frequency][][values][]"

Monthly
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][newsletter][][id]"

Both
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file_constants_mappings][newsletter][][values][]"

Both
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][created_at]"

2022-01-12 17:18:35 UTC
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][error]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][file]"; filename="sample_csv_with_custom_headers.csv"
Content-Type: text/plain
Content-Length: 1056

[uploaded data]
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][group_tags]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][import_by_group]"

false
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][import_completed_at]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][import_started_at]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][importing]"

false
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][override]"

false
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][queued_for_import_at]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][source]"

csv
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][tags]"


------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][updated_at]"

2022-01-12 17:18:35 UTC
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[attributes][updated_in_db_at]"

2022-01-12 17:18:35 UTC
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[type]"

imports
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[relationships][account_list][data][type]"

account_lists
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[relationships][account_list][data][id]"

0ef35971-210d-48ec-9e09-abd619fbc530
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[relationships][user][data][type]"

users
------------XnJLe9ZIbbGUYtzPQJ16u1
Content-Disposition: form-data; name="data[relationships][user][data][id]"

7671592c-bb11-460b-adf6-69197e0c45f9
------------XnJLe9ZIbbGUYtzPQJ16u1--

Response

Headers

Content-Type: application/vnd.api+json; charset=utf-8
200 OK

Body

{
  "data": {
    "id": "cdc86b7c-0ba9-4934-ba30-3866feebeb8f",
    "type": "imports",
    "attributes": {
      "account_list_id": "0ef35971-210d-48ec-9e09-abd619fbc530",
      "created_at": "2022-01-12T17:18:35Z",
      "file_constants": {
        "greeting": [
          "Hi John and Jane",
          "Hello!",
          ""
        ],
        "status": [
          "Praying",
          "Praying and giving"
        ],
        "amount": [
          "50",
          "10",
          ""
        ],
        "frequency": [
          "Monthly",
          ""
        ],
        "currency": [
          "CAD",
          ""
        ],
        "newsletter": [
          "Both"
        ],
        "skip": [
          "No",
          "Yes",
          ""
        ],
        "likely_giver": [
          "Yes",
          "No"
        ],
        "appeals": [
          "Yes",
          "No"
        ]
      },
      "file_constants_mappings": {
        "status": [
          {
            "id": "Partner - Financial",
            "values": [
              "Praying and giving"
            ]
          }
        ],
        "pledge_frequency": [
          {
            "id": "1.0",
            "values": [
              "Monthly"
            ]
          }
        ],
        "newsletter": [
          {
            "id": "Both",
            "values": [
              "Both"
            ]
          }
        ]
      },
      "file_headers": {
        "fullname": "fullname",
        "fname": "fname",
        "lname": "lname",
        "spouse_fname": "Spouse-fname",
        "spouse_lname": "Spouse-lname",
        "greeting": "greeting",
        "mailing_greeting": "mailing-greeting",
        "church": "church",
        "street": "street",
        "city": "city",
        "province": "province",
        "zip_code": "zip-code",
        "country": "country",
        "status": "status",
        "amount": "amount",
        "frequency": "frequency",
        "currency": "currency",
        "newsletter": "newsletter",
        "tags": "tags",
        "email_address": "email-address",
        "spouse_email_address": "Spouse-email-address",
        "phone": "phone",
        "spouse_phone_number": "Spouse-phone-number",
        "extra_notes": "extra-notes",
        "skip": "skip",
        "likely_giver": "likely-giver",
        "metro": "metro",
        "region": "region",
        "appeals": "appeals",
        "website": "website",
        "referred_by": "referred_by",
        "relationship_code": "relationship_code"
      },
      "file_headers_mappings": {
        "city": "city",
        "pledge_amount": "amount",
        "pledge_frequency": "frequency",
        "contact_name": "fname",
        "country": "country",
        "email_1": "email_address",
        "envelope_greeting": "envelope_greeting",
        "first_name": "fname",
        "greeting": "greeting",
        "last_name": "lname",
        "newsletter": "newsletter",
        "notes": "extra_notes",
        "phone_1": "phone",
        "spouse_email": "spouse_email_address",
        "spouse_first_name": "spouse_fname",
        "spouse_last_name": "spouse_lname",
        "spouse_phone": "spouse_phone_number",
        "state": "province",
        "status": "status",
        "street": "street",
        "zip": "zip_code"
      },
      "file_url": "http://api.mpdx.test/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhaVGxtTWpJNE9EWXpOMlJwYlhCeU9XeHVaRGcxYjJ4bmEyTjFhUVk2QmtWVU9oQmthWE53YjNOcGRHbHZia2tpYzJGMGRHRmphRzFsYm5RN0lHWnBiR1Z1WVcxbFBTSnpZVzF3YkdWZlkzTjJYM2RwZEdoZlkzVnpkRzl0WDJobFlXUmxjbk11WTNOMklqc2dabWxzWlc1aGJXVXFQVlZVUmkwNEp5ZHpZVzF3YkdWZlkzTjJYM2RwZEdoZlkzVnpkRzl0WDJobFlXUmxjbk11WTNOMkJqc0dWRG9SWTI5dWRHVnVkRjkwZVhCbFNTSVBkR1Y0ZEM5d2JHRnBiZ1k3QmxRNkVYTmxjblpwWTJWZmJtRnRaVG9KZEdWemRBPT0iLCJleHAiOiIyMDIyLTAxLTEyVDE3OjIzOjM1WiIsInB1ciI6ImJsb2Jfa2V5In19--0a4f823a3f5ac9fb87d4ddc752eefa4dc928b603/sample_csv_with_custom_headers.csv",
      "group_tags": null,
      "groups": [

      ],
      "import_by_group": false,
      "in_preview": true,
      "override": false,
      "source": "csv",
      "tag_list": null,
      "updated_at": "2022-01-12T17:18:35Z",
      "updated_in_db_at": "2022-01-12T17:18:35Z"
    },
    "relationships": {
      "user": {
        "data": {
          "id": "7671592c-bb11-460b-adf6-69197e0c45f9",
          "type": "users"
        }
      },
      "sample_contacts": {
        "data": [
          {
            "id": "bd998210-a12d-44a9-8ac9-d5d9035e333a",
            "type": "contacts"
          },
          {
            "id": "2156b26a-d42d-487d-bba0-f2e8a86e74cd",
            "type": "contacts"
          },
          {
            "id": "727e7bc5-4333-4be7-922e-c3ccdc608cf7",
            "type": "contacts"
          }
        ]
      }
    }
  }
}
PreviousImportsNextGoogle

Last updated 3 years ago