This is a preview release so please use at your own risk and report any issues you may experience. Contact Givey Support if you have any questions.
Before using the Givey API you will want to create a new instance to work with. You will require an access token which can be obtained from the Givey Developer Portal.
var Givey = new GiveyApp({
token: "XXXX"
});
There are many entities on Givey which can be interacted with. The current entity list contains Charity, User, Business and Donation.
Givey.find('business', 'giveybiz').then(function (business) {
business.get('name'); // Givey Ltd
});
Entities can contain relationships to other entities which are resolved asynchronously. Relationships are not resolved until the first time they are called via entity.get()
.
Givey.find('business', 'giveybiz').then(function (business) {
business.get('employees').then(function (employees) {
$.each(employees, function (_, user) {
user.get('giveyTag');
});
});
});