The 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.
The 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…
The 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.
To ensure that all personal information is handled securely:
Get 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.
All 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>
All 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.
Example XML:
<?xml version="1.0" encoding="utf-8"?> <Method> <Username>string</Username> <Token>string</Token> </Method>
The following elements will always be returned with a response, in addition to the container element.
Example XML:
<?xml version="1.0" encoding="utf-8"?> <Method> <Ack>string</Ack> <Timestamp>timestamp</Timestamp> </Method>
To 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
To make an successful call you must follow these rules:
Almost 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.
The 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.
The table below lists the HTTP Status Codes used by the SB system. HTTP Status Codes are used when processing responses.
Code | Name | Meaning |
---|---|---|
200 | OK | Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request the response will contain an entity describing or containing the result of the action. |
401 | Unauthorized | The username and/or password were incorrect. The session could not be authenticated. |
500 | Internal Server Error | A generic error message, given when no more specific message is suitable. |
Use the table below to lookup error codes returned by the SB system.
Code | Type | Meaning |
---|---|---|
10000 | Authorization | Authentication/Authorization Failed |
10002 | Authorization | Username/Password is incorrect |
20000 | Internal Errors | General Failure |
90002 | Notification API | Malformed Value |
90004 | Notification API | Unspecified Value |
About the API:
Recommendations for common integration projects: