Tips for optimizing XML API usage
Less than to read
Use the maximum pagesize value in queries
- Using the maximum pagesize value returns more records in each response, which reduces the number of times you need to use
readMore
to retrieve more data. - Use 1,000 for
readByQuery
or 2,000 forquery
.
Optimize data filters in queries
- Use filtering criteria to narrow down the results of your queries and avoid returning unnecessary data.
- For example, filter on the
whenmodified
attribute of any object to filter for incremental changes in data instead of querying the entire dataset each time.
Use Smart Events or triggers instead of polling
- Use smart events for webhooks as needed.
- Use event-based triggers that call your external service to consume added, updated, or deleted records.
- For more information, see the following pages:
Use the read function for header and line-level details
- When possible, use
read
instead of readByQuery for retrieving both header-level and line-level details in the same query. - View an example read call
Investigate and eliminate unsuccessful requests
- Investigate unsuccessful requests and eliminate them. They contribute to your overall API transaction count.
View the API usage dashboards
- Use the developer portal dashboard to view API usage for your sender ID.
- Use the in-product dashboard under Company > Admin to view API usage for your company.
Implement data caching
- Implement data caching to store frequently accessed data locally, reducing the need for redundant API calls.
- For example, if you load dimensions into your third-party system, you don’t need to query all of the dimensions every time the page loads. Consider caching some of that data.
Additional tips
Reduce the frequency of data syncs
- Reduce the frequency of syncing data that does not change often such as
GLACCOUNT
,DEPARTMENT
, andLOCATION
objects.
Optimize General Ledger data syncing
- When syncing data from the General Ledger, consider the following tips:
- Use get_glaccountbalanacebydimension instead of glaccountbalance.
- Use the async version of get_accountbalancebydimension.
- Create dimension groups to reduce querying on every dimension.
- Consider using readReport for the
GLDETAIL
object to improve performance. While this might not reduce API calls, it eases the concurrency burden and improves overall performance.