Skip to content

Instantly share code, notes, and snippets.

@crowdfundhq crowdfundhq/api_usage.html
Last active Oct 26, 2016

What would you like to do?
An example of how to use the CrowdfundHQ API from within your site
// Enable 'Sessions enabled' in Manage Site > Configuration > Settings > API
// Then use this script in Manage Site > Design > Pages or Scripts to fetch users
document.addEventListener('DOMContentLoaded', function(){
// Define variables
var url = '/api/v1/user/list', result, list, user;
// Do ajax call using hq.js
hq.ajax(url, {
success: function(json) {
// Parse API response
result = JSON.parse(json);
// Parse list as JSON
list =;
// Look up first entry
user = list[0];
// Do something with user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.