Git Product home page Git Product logo

apex-guidestar's Introduction

apex-guidestar

Salesforce.com Apex integration with the Guidestar API - supports search, detail, and charity check for Guidestar's extensive database of US nonprofit organizations.

Read all about the Guidestar API at data.guidestar.org.

Usage:

// initialize the api class using Guidestar API keys (Search, CharityCheck, and Detail API keys)
Guidestar gs = new Guidestar('123abcdefg123','123abcdefg123','123abcdefg123');    

// initialize the api class with Guidestar username and password
Guidestar gs = new Guidestar('[email protected]','password');    

// initialize the api class using credentials stored in custom settings
Guidestar gs = new Guidestar();    

// search for an org by name
Guidestar.OrgSearch result = gs.orgSearch('Salesforce');

// search for an org by EIN - can also search by name, city, state, zip, nteecode, or keyword
Guidestar.OrgSearch result = gs.orgSearch('94-3347800', 'ein');

// search for an org by zip code, retrieving the first page of 25 results
Guidestar.OrgSearch result = gs.orgSearch('98101', 'zip', 1, 25);

// search for an org using a custom Lucene query
Guidestar.OrgSearch result = gs.orgSearch('city:"San Francisco" AND state:"CA" AND nteecode:"S02"', null, 1, 25);

// perform 501c3 charity check based on EIN
Guidestar.CharityCheck cc = gs.charityCheck('94-3347800');

// retrieve full organization detail for a guidestar organization id (first get that id from search)
Guidestar.OrgDetail detail = gs.orgDetail( 8424440 );

// get an organization id and then retrieve full Exchange API data
GuidestarExchange gsex = new GuidestarExchange();
Guidestar.OrgSearch result = gsex.orgSearch('94-3347800', 'ein');
Integer guidestarOrgId = result.hits[0].organization_id;
GuidestarExchange.OrgExchange exchange = gsex.orgExchange( guidestarOrgId );

The package includes a custom setting where you can store your API credentials. This way, you won't have to pass them in when you initialize the api class. For better security, use API keys rather than username and password.

You can install the package into a Salesforce instance using the following URL: https://githubsfdeploy.herokuapp.com/?owner=SalesforceFoundation&repo=apex-guidestar

Comments and contributions are welcome!

apex-guidestar's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.