How can we help? How can we help?

Load Record IDs using the Blimps API

MRI Box and Dice MRI Box and Dice

Summary

Learn how to load record IDs from Box+Dice using the Blimps API to support database synchronisation and detect deleted records in your system.

This article covers:


About loading record IDs with the Blimps API

The Blimps API allows client applications to load record IDs only, without full record data. This is especially useful for applications that synchronise their own databases with Box+Dice.

By comparing ID lists, your application can identify records that have been deleted in Box+Dice and should also be removed locally.


Load record IDs for any resources


You can request the IDs for any supported resource by setting ids to true.

To load IDs for any resource

$ curl -u 'admin:password' -H 'Content-Type: application/json' -d '{"contacts":{"ids":true}}' http://example.boxdice.com.au/blimps/ids
= {"contacts":[9,10,13,14,...]}


The response will contain IDs of all records.

It is possible to load IDs for multiple resources:

$ curl -u 'admin:password' -H 'Content-Type: application/json' -d '{"contacts":{"ids":true},"offices":{"ids":true}}' http://example.boxdice.com.au/blimps/ids
= {"contacts":[9,10,13,14,...],"offices":[1,2]}


You can use filters to load only IDs for records you are interested in:

$ curl -u 'admin:password' -H 'Content-Type: application/json' -d '{"salesListings":{"listed_on_gte":"2013-01-01","ids":true}}' http://example.boxdice.com.au/blimps/ids
= {"salesListings":[15,42,43,...]}


You can also load IDs of associated resources:

$ curl -u 'admin:password' -H 'Content-Type: application/json' -d '{"consultants":{"id":[7,10],"salesListings":{"ids":true}}}' http://localhost:8080/blimps/ids
= {"salesListings":[243,519,...]}