DonorHub ®
Bridging the information gap between you and your staff...

Can I programmatically query the the donation data from another application? If so, how?: Revision #16

You are currently reviewing an older revision of this page. Go to current version

Can I programmatically query the the donation data from another application? If so, how?

Filed under: , , ,

The DonorHub API Approach

If you want to support the largest number of organizations with your app, this is the best way to go. 

To learn more, read the: DonorHub API Documentation


The SOAP/XML Approach

DonorHub provides a SOAP/XML end point that other web applications can use to query donation data.  The Staff Portal which is included with DonorHub gets all of its data exclusively through this web service.  If you can see something on the Staff Portal, you can programmatically retrieve the same information.

Here's a demo of the Staff Portal:
https://www.mytntware.com/dataserver/test/staffportal/default.aspx

Here are demos of the SOAP web service endpoints where the Staff Portal gets its data:
https://www.mytntware.com/dataserver/test/dataquery/dataqueryservice2.asmx

You'll notice that the "dataquery" folder is next to the "staffportal" folder.  If you have a Staff Portal, url, replace "staffportal/*" in your url with "dataquery/dataqueryservice2.asmx" and you'll have your own SOAP endpoint.

The Staff Portal works with a single sign on provider.  The main SOAP endpoint has a SiteProperties informational record you can request.  It includes the URL to the authentication provider under "SSOProvider".  The main way authentication works with the DataQuery service is through a session id.  Let me explain:  When the user comes to the Staff Portal, it authenticates via the authentication provider and gets a service ticket.  It passes in the service name and service ticket to the SOAP method "Login(ServiceName, ServiceTicket)" which returns a SessionID, UserName, and UserIsRegistered.  You need to persists the SessionID as this is used for all subsequent method calls.  If the user is not registered, you need to prompt the user for a registration code and submit it to the method "RegisterUser(SessionID, RegistrationCode)" until the user is registered.

Trusted Portal URL Prefixes

To ensure that only trusted web applications are querying a user's donation data on their behalf (via the SOAP/XML api), DonorHub Lite requires you to maintain a list of "URL Prefixes".  This is available under: Tools | System Setup | Portal.  Here you'll notice a link to "(edit prefix list)" and a link to "(view log)".  When you're first getting started the "view log" option is handy as you can see exactly what's being attempted (but not "accepted").  If you see your portal in the log, copy the left most significant part of the URL (enough to make it "trusted" and add it to the list of trusted prefixes.

© 2024 TntWare, Inc. | Privacy | Terms of Use