Bulk Export Records

Use this API call to export records from Shape in bulk

POST api/leads/bulk/export

To export leads in bulk, send an authorized POST request to https://secure-api.setshape.com/api/leads/bulk/export

Parameters

This API endpoint accepts arrays of objects, each object is considered a lead. Export leads by including the field names to be created in the request body. To get a list of supported field names, please see the section below titled “How to Get Field Names.”

  • ids

    This is required in order to get lead information from Shape. Please list all lead IDs you'd like to select. This is accepted as an array.

  • createdDateRange

    To retrieve information based on creation date, utilize the "createdDateRange" parameter with "from" and "to" date parameters. If you omit the "from" and "to" parameters, the API will only retrieve data for today's date.

  • updatedDateRange

    To retrieve information based on creation date, utilize the "updatedDateRange" parameter with "from" and "to" date parameters. If you omit the "from" and "to" parameters, the API will only retrieve data for today's date.

  • pageNumber

    Additionally, the "pageNumber" parameter is included to enhance system performance when dealing with large datasets. In instances where there are thousands of records within a single day, querying for an extended date range could strain system resources. To mitigate this, we've implemented the "pageNumber" parameter. Each page displays 50 records, and by specifying the page number, users can navigate through the dataset more efficiently. By default, without a page number parameter, the system will return a maximum of 30 records.

  • fields

    The field mappings that you're trying to gather are accepted as an array. Find the available field mappings within the "Marketing Sources" settings page. Use the "Field Name" exactly as it appears in the field name column. If you'd like to send in custom field values, first create custom fields within your system and the custom mappings will automatically appear in your system's available field mappings.

Request Header

The authentication token must be passed in the request header for every API request. You can find and generate your authentication token in your system settings page under “API Integrations.”

Request Body

JSON request body formatting example:

{

    “ids”: {

        “56350467”,

        “56350209”

    },

    “fields”: [

        “firstname”,

        “lastname”,

        “email”,

        “leadreferenceid”,

        “leadsource”,

    ]

}

 

or

 

{

    “createdDateRange”: {

        “from”: “2024-02-01”,

        “to”: “2024-05-01”

    },

    “fields”: [

        “leadid”,

        “recordtype”,

        “createdDate”,

        “leadreferenceid”,

        “leadsource”,

        “firstname”,

        “lastname”,

        “email”

    ]

}

 

or

 

{

    “updatedDateRange”: {

        “from”: “2024-01-01”,

        “to”: “2024-05-01”

    },

    “fields”: [

        “leadid”,

        “recordtype”,

        “createdDate”,

        “lastActivityDate”,

        “leadreferenceid”,

        “leadsource”,

        “firstname”,

        “lastname”,

        “email”

    ]

}

Response

Upon success, the server returns HTTP codes and messages in the header with some additional elements and properties that are set by the server, such as id.

{

     “message”: “Data fetched successfully.”,

     “data”: {

          “56350467”: {

              “firstname”: “Mike”,

              “lastname”: “Johnson”,

              “email”: “mikejohnson@gmail.com”,

              “lastcallattempt”: “2023-06-30 15:25:36”,

              “leadsource”: “Mailer”

          },

          “56350209”: {

              “firstname”: “Jessica”,

              “lastname”: “Smith”,

              “email”: “jesssmith@gmail.com”,

              “lastcallattempt”: “2023-06-30 15:42:01”,

              “leadsource”: “Mailer”

            }

      },

      “fields_not_found”: []

}

*fields_not_found: This response key is an array indicating items passed through the API endpoint, but does not exists within Shape Software.

How to Get Field Names

Field names can be found within your CRM System’s settings pages under: Settings > Marketing Sources > Edit Any Marketing Source > Campaign Source Post URL Instructions.

After navigating to the marketing sources settings page and opening up a campaign, scroll to the bottom of the page to the “Campaign Source Post URL Instructions” section. Here, you will find a searchable table with a breakdown of all of the field names available for use. These field names can also be exported to a CSV via the “Export” dropdown.

Get in Touch

Our team of experts are here to help! Call our sales line at (888) 762-7211

Download

Contact Sales