|
Table of Contents
API Documentation: Getting StartedWelcomeThe SubscriptionBridge XML APIs were designed to help developers integrate third-party applications with SubscriptionBridge (SB), a subscription management system developed by Early Impact, Inc. This guide will provide a knowledgeable programmer with all the information needed to integrate a system with SB. The XML APIs will work with any programming language or platform that is capable of sending and receiving XML documents over the HTTPS POST protocol. If you're a “hands on” type of person feel free to skip on down to the resource section and grab some sample code. OverviewThe SubscriptionBridge APIs are a set of XML-based web services that allow third-party developers to integrate seamlessly with the SB system. APIs provide a vehicle for secure, bidirectional communication. Simply put… just about any application with internet access can be modified to work with the XML-based APIs. You can now create powerful, time-saving solutions that will streamline your business' recurring billing operations. The SubscriptionBridge XML APIs are designed for… Hit the Ground Running with Sample CodeSkill RequirementsThe power of the SubscriptionBridge API is in the ability to have an external application communicate bidirectionally, without human interaction. Skills required:
In the following pages we will cover everything you need to know about the APIs. We will discuss the use of the APIs and the formation of the XML messages. You will also find technical information and sample code in this section. Security StandardsTo ensure that all personal information is handled securely:
Using the APIsYour First XML API CallGet started in a snap with our sample code. Contact us for production ready examples in several languages. The following sections will provide you will all of the knowledge needed to send your first XML Call. Creating XMLAll SB XML documents have the same basic elements. Here is an example of the basic XML structure for all requests/responses. In the example below “ActivationResponse” is the response container. “Ack” and “Timestamp” are the response elements. <?xml version="1.0" encoding="utf-8"?> <ActivationResponse> <Ack>string</Ack> <Timestamp>timestamp</Timestamp> </ActivationResponse> Standard Request ElementsAll XML calls will have a container element, such as ”<ActivationRequest>” or ”<ActivationResponse>”. There are two elements that are required for every request transaction, in addition to the container element.
All required elements must be present in your XML. The elements must also be sent in the correct order. If the XML request is not formed correctly the API will issue a HTTP Status Code of 400 (Bad Request) and send an ErrorResponse document with additional details.
Example XML: <?xml version="1.0" encoding="utf-8"?> <Method> <Username>string</Username> <Token>string</Token> </Method> Standard Response ElementsThe following elements will always be returned with a response, in addition to the container element.
If the XML request is not formed correctly the API will issue a HTTP Status Code of 400 (Bad Request) and send an ErrorResponse document with additional details. In such a case the response elements may be different than the ones described in this section. For more information read over the ErrorResponse section.
Example XML: <?xml version="1.0" encoding="utf-8"?> <Method> <Ack>string</Ack> <Timestamp>timestamp</Timestamp> </Method> Executing the CallEndPointsTo make an API Call you need to find the EndPoint (or address) for the service. From the API Call Reference, click on the method name to find its EndPoint. A list of all the available EndPoints is listed below. You will need to replace the text in between the [] with your own. Notification API: Endpoint = https://www.subscriptionbridge.com/Notifications/Service1.svc/[method_name] Subscription API: Endpoint = https://www.subscriptionbridge.com/Subscriptions/Service2.svc/[method_name] Management API: Endpoint = https://www.subscriptionbridge.com/Management/Service3.svc/[method_name] The following is the EndPoint for an ActivationRequest: https://www.subscriptionbridge.com/Subscriptions/Service2.svc/ActivationRequest
The EndPoint must be HTTPS.
Call GuidelinesTo make an successful call you must follow these rules:
Sending API Requests with HTTPS POSTAlmost every programming language has its own method for sending XML via HTTPS POST. There are a number of resources on the internet that will assist you with the requirement. You may also view our Sample Code for additional help. Handling the ResponseThe following section outlines the procedure for dealing with SB responses. After you send your XML Call the first thing you should do is check the response HTTP Status Code. View the following section for a chart of possible HTTP Status Codes. If you get a 200 HTTP Status Code you can capture the response XML and check the Ack element for the results. The Ack element is the acknowledgment of your request. The value will be “Success”, “Warning”, or “Failure”. If you the Ack is “Success” you can proceed to parse the XML to complete the task. If you get a 400 or 500 HTTP Status Code you should check for an ErrorResponse with additional details. HTTP Status CodeThe table below lists the HTTP Status Codes used by the SB system. HTTP Status Codes are used when processing responses.
Error CodesUse the table below to lookup error codes returned by the SB system.
Troubleshooting
Resources (Sample Code, Links, Call References)About the API: Recommendations for common integration projects: |
Contact us for more information, or head over to the free trial sign-up form to give SubscriptionBridge a try! Sign Up Free