Exporting assets

If you need to export all assets in your Eloqua database using the application API endpoints, there are URL parameters you can use to customize your requests. You can use these URL parameters in different scenarios to customize your requests and retrieve your assets.

Understanding the URL parameters

There are two URL parameters that help customize the results from the application API when retrieving lists of assets.

Query parameter Description Constraints
count Maximum number of entities to return Any whole number between 1 and 1000 inclusive.

Example: Return the first page of 20 landing pages (results 1...20):

GET .../assets/landingPages?count=20
page Specifies which page of entities to return (the count parameter defines the number of entities per page). If the page parameter is not supplied, 1 will be used by default. Any positive whole number.

Example: Return the second page of 20 landing pages (results 21...40):

GET .../assets/landingPages?page=2&count=20

Example requests

When forming your requests, you may want to do an initial pull to retrieve all assets you currently have in your database, and then perform requests later on to retrieve any assets created after your initial export.

Initial export

When exporting a large number of assets, first determine the number of assets that does not result in a timeout by setting the count parameter. For complex Eloqua assets, such as campaigns, 10 would be a safe number, but given the complexity, and data returned at complete depth, setting the count to 5 is recommended.

Once the count is decided you can loop through all the pages to retrieve all the assets. To determine how many pages there are just divide total by count, and round up.

In example, using campaigns let's retrieve the first page of 10 campaigns:

GET /api/rest/2.0/assets/campaigns?depth=complete&count=10

Retrieve the second page of 10 campaigns:

GET /api/rest/2.0/assets/campaigns?depth=complete&count=10&page=2
			

Retrieve the third page of 10 campaigns:

GET /api/rest/2.0/assets/campaigns?depth=complete&count=10&page=3
			

If continuing the example above, for the last request, the value for page will always be the total number of campaigns in your database divided by the count, rounded up. In example, if there are 55 campaigns and you’re using a count 10, the last page will be 6.

GET /api/rest/2.0/assets/campaigns?depth=complete&count=10&page=<total/count>
			

Alternatively, you could also keep incrementing the page URL parameter by 1 until you receive an empty result for the elements property.

Subsequent exports

After the initial export, you could update the request to retrieve only the assets which have been updated after a certain date and time. Most assets have an updatedAt property that could be used with the search URL parameter. Some assets, such as forms, specify time periods differently. This tutorial will focus on assets with updatedAt.

Now that you have the initial export complete, you’ll only need to retrieve modified assets on a periodic basis. This export should be significantly less than the initial export, so you might not even have to specify count.

In example using campaigns, let's retrieve the first page of 10 campaigns that have been updated after a date and time (in this case our date and time is when the initial export stated, and is expressed as XXXXXXXXX for a Unix timestamp in the examples below):

GET /api/rest/2.0/assets/campaigns?depth=complete&search='updatedAt>XXXXXXXXXX'&count=10
			

Retrieve the second page of 10 campaigns:

GET /api/rest/2.0/assets/campaigns?depth=complete&search='updatedAt>XXXXXXXXXX'&count=10&page=2
			

Retrieve the third page of 10 campaigns:

GET /api/rest/2.0/assets/campaigns?depth=complete&search='updatedAt>XXXXXXXXXX'&count=10&page=3
			

If continuing our example, for the last request, the value for page will always be the total number of entities in your database divided by the count, rounded up.

GET /api/rest/2.0/assets/campaigns?depth=complete&search='updatedAt>XXXXXXXXXX'&count=10&page=<total/count>
			

Learn more

Application API

Eloqua API tutorials

URL parameters