Web Service To API Conversion - CharityCheck PDF Example

Document created by JackCowardin Administrator on Oct 31, 2016Last modified by JackCowardin Administrator on Jan 3, 2017
Version 4Show Document
  • View in full screen mode

CharityCheck PDF Example

For this example, the GuideStar CharityCheck Web Services will be examined and compared to the GuideStar CharityCheck APIs.

GuideStar CharityCheck is the only product in the world that is 100% compliant with all IRS requirements for determining a nonprofit’s eligibility to receive tax-deductible contributions. The ability to download and render a PDF that delivers CharityCheck information is a popular use of GuideStar Web Services and is now available as a ReST API.

 

CharityCheck SOAP web services are at these URLs:   

https://www.guidestar.org/WebServiceLogin.asmx and

http://www.guidestar.org/WebService.asmx

 

The services available at http://www.guidestar.org/WebService.asmx are:

 

We will use the GuideStar CharityCheck PDF web service,  GetCCPDF, and compare its implementation and results to the GuideStar CharityCheck PDF API.    Both the Web Service and the corresponding ReST API take as a parameter the EIN (Federal Employee Identification Number) for a specific organization

 

Since CharityCheck is a paid product, the GetCCPDF Web Service requires a login for a valid web services customer. Therefore cookies must be enabled and authentication credentials must be maintained in the browser session and propagated from the login call to the CharityCheck GetCCPDF call. 

An important difference between SOAP-based services and ReST-based ones is that ReST services do not maintain any state information between API calls. So the use of cookies to maintain data between calls is not done in the API as it is in the web service.

 

The first call is to the Login method at https://www.guidestar.org/WebServiceLogin.asmx.  This method takes two strings as parameters:

userName – the GuideStar Web Service account username (e.g. ws-user@domain.org)

password – the GuideStar password

The second call is to the methods at http://www.guidestar.org/WebService.asmx to download the API.

GetCCPDF – returns Charity Check report as a PDF

This method takes a single string parameter: EIN – the EIN of the organization you are querying.  (e.g. 54-1774039)

 

As with all Microsoft .NET SOAP calls, you first set up a web reference to https://www.guidestar.org/WebServiceLogin.asmx and http://www.guidestar.org/WebService.asmx. in the project file. The web reference handles much of the overhead of the web service call.

 

Sample C# code to call the web service is below. Adobe Acrobat is invoked to display the PDF document.

 

Text of code samples is here: Text Code Samples - Web Service to API Conversion

cc web service.PNG


For comparison, we will describe the equivalent implementation of the GuideStar CharityCheck PDFAPI that can be accessed with this URL:

https://data.guidestar.org/v3/CharityCheck/PDF/13-1624102

 

This code creates a web request object, add the user ID and password in the HTTP header, executes the request and starts Adobe Acrobat to display the PDF document. 

cc_pdf_api.PNG

The results of either call displays a PDF document:

 

audubon_pdf.png

 

Text Code Samples - Web Service to API Conversion

 

Results Comparison

Comparison:GuideStar Detail Web Service Results and Detail API Results

 

Back

Converting from GuideStar Web Services (SOAP) to APIs (REST).

Attachments

    Outcomes